Squarepoint Challenge (Codeforces Round 1055, Div. 1 + Div. 2)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
2152 Squarepoint Challenge (Codeforces Round 1055, Div. 1 + Div. 2) FINISHED False 10800 16903523 Oct. 3, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 22213 ) A Increase or Smash PROGRAMMING implementation

Geumjae has an array (a) consisting of (n) zeros. His goal is to transform it into a given target array using a minimum number of operations. He can perform the following two types of operations any number of times, in any order: Increase : Choose any positive integer (x). Increase all elements of the array (a) by (x). In other words, he chooses a positive integer (x), and for each (i) ((1 \le i \le n)), he replaces (a_i) with (a_i + x). Smash : Set some elements (possibly none or all) of the array (a) to (0). In other words, for each (i) ((1 \le i \le n)), he either replaces (a_i) with (0) or leaves it as before. Given the final target state of the array (a), find the minimum total number of operations (both Increase and Smash ) Geumjae needs to perform. It can be shown that for any given final array, a sequence of operations always exists. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 1000)). The description of the test cases follows. The first line contains a single integer (n) ((1 \le n \le 100)) — the number of elements in the array (a). The second line contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le 100)) — the elements of the target array (a). For each test case, output a single integer — the minimum number of operations required. Explanation of the first test case: The target array is (1, 1, 3). A possible sequence of 3 operations (which is the minimum) is: Initially, the array is (0, 0, 0). After an Increase operation with (x = 2), the array becomes (2, 2, 2). Next, after a Smash operation on the first two elements, the array becomes (0, 0, 2). Finally, after an Increase operation with (x = 1), the array becomes (1, 1, 3). We used (2) Increase operations and (1) Smash operation for a total of (3) operations. Explanation of

Tutorials

Squarepoint Challenge (Codeforces Round 1055, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
341743454 jyunni A Oct. 3, 2025, 6:32 p.m. OK C# 10 TESTS 3 93 3174400
341775946 AsadGalib A Oct. 4, 2025, 3:23 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
341774358 guywholovesrandomness A Oct. 4, 2025, 3:01 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
341787168 phtung0701 A Oct. 4, 2025, 5:41 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
341786705 someone_28 A Oct. 4, 2025, 5:36 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
341785804 AbhiAbhi100 A Oct. 4, 2025, 5:28 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
341784878 jakekim A Oct. 4, 2025, 5:19 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
341784852 red_scorpion A Oct. 4, 2025, 5:19 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
341783220 Kekan A Oct. 4, 2025, 5 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
341789527 zhaoyuebo A Oct. 4, 2025, 6 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
341788949 nikhileswar1026 A Oct. 4, 2025, 5:55 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
341789733 Believer_112 A Oct. 4, 2025, 6:02 a.m. OK C++20 (GCC 13-64) TESTS 3 31 102400
341784397 Manowar02 A Oct. 4, 2025, 5:14 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
341789557 _MH_ A Oct. 4, 2025, 6 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
341789350 xzh A Oct. 4, 2025, 5:59 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
341787355 mansi_jamwal_ A Oct. 4, 2025, 5:42 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
341787250 AANNUUBBHHAAVV A Oct. 4, 2025, 5:41 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
341785573 sakshamrathi21 A Oct. 4, 2025, 5:26 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
341784913 jakekim A Oct. 4, 2025, 5:19 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
341784440 _Venti A Oct. 4, 2025, 5:14 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
341784385 Anamul_102 A Oct. 4, 2025, 5:14 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
341784663 AloneInLoops A Oct. 4, 2025, 5:16 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
341790064 Butterfly_qwq A Oct. 4, 2025, 6:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
341766685 samkim21 A Oct. 4, 2025, 12:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
341745232 Tanmay1822 A Oct. 3, 2025, 6:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
341725615 pm23ecb0f17 A Oct. 3, 2025, 4:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
341775486 limingyuan1232 A Oct. 4, 2025, 3:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 1638400
341788250 winterbear95 A Oct. 4, 2025, 5:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
341788563 WingSpan A Oct. 4, 2025, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
341788544 SpicyOctopus A Oct. 4, 2025, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
341788339 Atharva2007 A Oct. 4, 2025, 5:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
341729899 hollow_knight_14 A Oct. 3, 2025, 5:09 p.m. OK C# 8 TESTS 3 124 3174400
341754056 REHITE A Oct. 3, 2025, 8:09 p.m. OK GNU C11 TESTS 3 31 102400
341756942 REHITE A Oct. 3, 2025, 8:44 p.m. OK GNU C11 TESTS 3 46 0
341723256 rupantimahamud A Oct. 3, 2025, 4:49 p.m. OK GNU C11 TESTS 3 46 0
341756550 REHITE A Oct. 3, 2025, 8:39 p.m. OK GNU C11 TESTS 3 46 102400
341727790 xMETTLEx A Oct. 3, 2025, 5:03 p.m. OK GNU C11 TESTS 3 61 0
341726958 Y0U5UF A Oct. 3, 2025, 5 p.m. OK GNU C11 TESTS 3 61 0
341765801 Fakhrul_91 A Oct. 4, 2025, 12:23 a.m. OK GNU C11 TESTS 3 61 102400
341728764 Mushfiq_156 A Oct. 3, 2025, 5:06 p.m. OK GNU C11 TESTS 3 61 102400
341778889 polok4687 A Oct. 4, 2025, 4:03 a.m. OK GNU C11 TESTS 3 62 0
341770361 Bhuvi_will A Oct. 4, 2025, 2:02 a.m. OK GNU C11 TESTS 3 62 0
341771307 tahsin_ferdous A Oct. 4, 2025, 2:17 a.m. OK Go TESTS 3 62 4608000
341729245 inblank A Oct. 3, 2025, 5:07 p.m. OK Go TESTS 3 62 4608000
341730334 uber_calm_18 A Oct. 3, 2025, 5:11 p.m. OK Java 21 TESTS 3 202 0
341749520 sulabhambule A Oct. 3, 2025, 7:20 p.m. OK Java 21 TESTS 3 217 0
341737108 SahilMalavi A Oct. 3, 2025, 5:31 p.m. OK Java 21 TESTS 3 218 0
341784756 the_striker A Oct. 4, 2025, 5:18 a.m. OK Java 21 TESTS 3 233 614400
341729700 Pssikriwal_47 A Oct. 3, 2025, 5:09 p.m. OK Java 21 TESTS 3 233 819200
341783233 I_AM_SPEED A Oct. 4, 2025, 5 a.m. OK Java 21 TESTS 3 234 409600
341786151 tekka_ity A Oct. 4, 2025, 5:31 a.m. OK Java 21 TESTS 3 234 512000
341782382 ccj123 A Oct. 4, 2025, 4:49 a.m. OK Java 21 TESTS 3 249 819200
341776769 dudul01 A Oct. 4, 2025, 3:33 a.m. OK Java 21 TESTS 3 265 0
341777147 utkarsh20 A Oct. 4, 2025, 3:38 a.m. OK Java 21 TESTS 3 280 614400
341776748 lupunish A Oct. 4, 2025, 3:33 a.m. OK Java 8 TESTS 3 124 0
341747895 Eslam_Ahmed A Oct. 3, 2025, 7:06 p.m. OK Java 8 TESTS 3 139 0
341788740 dhruvv.j A Oct. 4, 2025, 5:53 a.m. OK Java 8 TESTS 3 187 0
341759734 Shafat04 A Oct. 3, 2025, 9:28 p.m. OK Java 8 TESTS 3 217 0
341761824 kefalio A Oct. 3, 2025, 10:14 p.m. OK Java 8 TESTS 3 233 0
341746741 revant0501 A Oct. 3, 2025, 6:55 p.m. OK Java 8 TESTS 3 233 0
341721289 Cibani A Oct. 3, 2025, 4:43 p.m. OK Java 8 TESTS 3 234 0
341778905 abhaysolanki1712 A Oct. 4, 2025, 4:04 a.m. OK Java 8 TESTS 3 249 0
341757496 Endle A Oct. 3, 2025, 8:52 p.m. OK Java 8 TESTS 3 249 0
341726192 mailstosprethika A Oct. 3, 2025, 4:58 p.m. OK Java 8 TESTS 3 249 0
341754130 AsianCoder01 A Oct. 3, 2025, 8:10 p.m. OK PyPy 3 TESTS 3 124 2560000
341789882 kaedeeeee A Oct. 4, 2025, 6:03 a.m. OK PyPy 3 TESTS 3 156 3379200
341760235 morraconda A Oct. 3, 2025, 9:38 p.m. OK PyPy 3 TESTS 3 171 5017600
341776413 klu2300080337 A Oct. 4, 2025, 3:28 a.m. OK PyPy 3 TESTS 3 202 5017600
341728419 MACLOVER A Oct. 3, 2025, 5:04 p.m. OK PyPy 3 TESTS 3 217 5836800
341722391 Abhinav4116 A Oct. 3, 2025, 4:46 p.m. OK PyPy 3 TESTS 3 296 6451200
341763882 gardengnome A Oct. 3, 2025, 11:18 p.m. OK PyPy 3-64 TESTS 3 77 1843200
341732722 Lion_2056 A Oct. 3, 2025, 5:18 p.m. OK PyPy 3-64 TESTS 3 78 14131200
341778406 SrEy_P-0-7 A Oct. 4, 2025, 3:57 a.m. OK PyPy 3-64 TESTS 3 93 1945600
341747499 explainer A Oct. 3, 2025, 7:02 p.m. OK PyPy 3-64 TESTS 3 93 1945600
341746190 jvatsal0709 A Oct. 3, 2025, 6:51 p.m. OK PyPy 3-64 TESTS 3 93 2252800
341744713 ehdnjs14 A Oct. 3, 2025, 6:40 p.m. OK PyPy 3-64 TESTS 3 93 2252800
341755156 Anirban2046 A Oct. 3, 2025, 8:22 p.m. OK PyPy 3-64 TESTS 3 108 1536000
341772022 tuan7 A Oct. 4, 2025, 2:28 a.m. OK PyPy 3-64 TESTS 3 108 2764800
341759752 ram_python A Oct. 3, 2025, 9:28 p.m. OK PyPy 3-64 TESTS 3 108 3072000
341731839 RanjanV_1 A Oct. 3, 2025, 5:15 p.m. OK PyPy 3-64 TESTS 3 109 2048000
341782861 NidHESh27 A Oct. 4, 2025, 4:56 a.m. OK Python 3 TESTS 3 46 0
341758250 GradientsGone A Oct. 3, 2025, 9:03 p.m. OK Python 3 TESTS 3 61 0
341778183 Biggaypig A Oct. 4, 2025, 3:54 a.m. OK Python 3 TESTS 3 62 0
341747380 good_angel A Oct. 3, 2025, 7 p.m. OK Python 3 TESTS 3 62 0
341724767 TobiacFever A Oct. 3, 2025, 4:53 p.m. OK Python 3 TESTS 3 62 0
341720714 helaughsking A Oct. 3, 2025, 4:41 p.m. OK Python 3 TESTS 3 62 0
341720598 Phantomlocator A Oct. 3, 2025, 4:41 p.m. OK Python 3 TESTS 3 62 1024000
341733050 mownisha18 A Oct. 3, 2025, 5:19 p.m. OK Python 3 TESTS 3 62 6348800
341786639 Jaijnuak A Oct. 4, 2025, 5:36 a.m. OK Python 3 TESTS 3 77 0
341781634 jkey725 A Oct. 4, 2025, 4:39 a.m. OK Python 3 TESTS 3 77 0
341780383 YhuanDebeste A Oct. 4, 2025, 4:21 a.m. OK Ruby 3 TESTS 3 311 512000
341775772 0x81 A Oct. 4, 2025, 3:20 a.m. OK Rust 2024 TESTS 3 61 0

remove filters

Back to search problems