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
( 6703 ) D Division Versus Addition PROGRAMMING bitmasks data structures games

For an array (b=b_1,b_2,\ldots,b_m) of length (m) ((b_i \geq 2)), consider the following two-player game played by Poby and Rekkles. The players take turns, with Poby moving first. On Poby's turn, he must choose an element (x \ge 2) and replace it with (\left\lfloor \frac{x}{2} \right\rfloor). In other words, he picks (i) ((1 \leq i \leq m)) such that (b_i \ge 2), then does (b_i := \left\lfloor \frac{b_i}{2} \right\rfloor). On Rekkles' turn, he must choose an element (x \ge 2) from the array (b) and replace it with (x+1). In other words, he picks (i) ((1 \leq i \leq m)) such that (b_i \ge 2), then does (b_i := b_i+1). The game ends once all elements in the array (b) are equal to (1). Define the score of the game as the number of moves that Poby makes. Poby's goal is to minimize the score , while Rekkles's goal is to maximize the score . Then, the value of the array (b) is the score of the game when both players play optimally. You are given an integer array (a) of length (n) ((a_i \ge 2)). Answer (q) independent queries. In each query, you are given a range (1 \leq l \leq r \leq n) and must find the value of the array (a_l, a_{l+1}, \ldots, a_r). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains two integers (n) and (q) ((1 \le n, q \le 250\,000)) — the length of the array and the number of queries. The next line contains (n) integers (a_1, a_2, \ldots, a_n) ((2 \le a_i \le 10^9)) — the elements of the array (a). Then (q) lines follow. The (j)-th of them contains two integers (l_j) and (r_j) ((1 \le l_j \le r_j \le n)) — the range of the subarray for the (i)-th query. It is guaranteed that the sum of (n) over all test cases does not exceed $$$2

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
341777453 mban259 D Oct. 4, 2025, 3:43 a.m. OK C# 10 TESTS 11 327 29593600
341776281 marscheng D Oct. 4, 2025, 3:27 a.m. OK C++17 (GCC 7-32) TESTS 11 93 6144000
341785888 TrendBattles D Oct. 4, 2025, 5:29 a.m. OK C++17 (GCC 7-32) TESTS 11 203 0
341789497 wisdom_grass D Oct. 4, 2025, 6 a.m. OK C++17 (GCC 7-32) TESTS 11 233 0
341732504 quant77 D Oct. 3, 2025, 5:18 p.m. OK C++17 (GCC 7-32) TESTS 11 233 2150400
341722443 cristinaoo1 D Oct. 3, 2025, 4:46 p.m. OK C++17 (GCC 7-32) TESTS 11 233 2150400
341774773 shy_robot_No8 D Oct. 4, 2025, 3:07 a.m. OK C++17 (GCC 7-32) TESTS 11 233 4096000
341737551 MMG101 D Oct. 3, 2025, 5:32 p.m. OK C++17 (GCC 7-32) TESTS 11 233 4096000
341742756 -Guts D Oct. 3, 2025, 6:28 p.m. OK C++17 (GCC 7-32) TESTS 11 234 102400
341764776 DataEraserQ D Oct. 3, 2025, 11:51 p.m. OK C++17 (GCC 7-32) TESTS 11 234 5017600
341766598 sbarreto D Oct. 4, 2025, 12:44 a.m. OK C++17 (GCC 7-32) TESTS 11 249 0
341733387 jaiswaz07 D Oct. 3, 2025, 5:20 p.m. OK C++20 (GCC 13-64) TESTS 11 93 2150400
341727860 _Kee D Oct. 3, 2025, 5:03 p.m. OK C++20 (GCC 13-64) TESTS 11 93 3276800
341724990 Renzok D Oct. 3, 2025, 4:54 p.m. OK C++20 (GCC 13-64) TESTS 11 109 3379200
341778279 operator_ D Oct. 4, 2025, 3:55 a.m. OK C++20 (GCC 13-64) TESTS 11 155 9113600
341770732 TwindT D Oct. 4, 2025, 2:08 a.m. OK C++20 (GCC 13-64) TESTS 11 171 204800
341727261 THATS_HOW_LIFE_WORKS D Oct. 3, 2025, 5:01 p.m. OK C++20 (GCC 13-64) TESTS 11 171 1228800
341768441 yuanmouren D Oct. 4, 2025, 1:27 a.m. OK C++20 (GCC 13-64) TESTS 11 171 2150400
341767518 MinhKien D Oct. 4, 2025, 1:08 a.m. OK C++20 (GCC 13-64) TESTS 11 171 3072000
341769827 pursueVoid D Oct. 4, 2025, 1:53 a.m. OK C++20 (GCC 13-64) TESTS 11 171 16076800
341722508 flying_saucer D Oct. 3, 2025, 4:47 p.m. OK C++20 (GCC 13-64) TESTS 11 186 0
341778262 ZaleClover D Oct. 4, 2025, 3:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 124 5120000
341728857 radhikaashardaa D Oct. 3, 2025, 5:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 139 8294400
341770884 ddbjiang D Oct. 4, 2025, 2:11 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 171 0
341768168 xzc426_0vo D Oct. 4, 2025, 1:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 171 0
341766365 resnick28 D Oct. 4, 2025, 12:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 171 0
341770296 ddbjiang D Oct. 4, 2025, 2:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 171 204800
341781400 Citypop D Oct. 4, 2025, 4:36 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 171 1331200
341768561 jishnu260p D Oct. 4, 2025, 1:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 171 31334400
341780481 __ALBION__ D Oct. 4, 2025, 4:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 186 0
341770868 FakeDuck D Oct. 4, 2025, 2:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 186 0
341727186 toroloco D Oct. 3, 2025, 5:01 p.m. OK D TESTS 11 578 20787200
341726478 pengin_2000 D Oct. 3, 2025, 4:59 p.m. OK GNU C11 TESTS 11 234 3072000
341731780 york135 D Oct. 3, 2025, 5:15 p.m. OK GNU C11 TESTS 11 1171 5017600
341732845 kodxity D Oct. 3, 2025, 5:19 p.m. OK GNU C11 TESTS 11 1203 3072000
341732681 glebsamsonov D Oct. 3, 2025, 5:18 p.m. OK Go TESTS 11 640 18534400
341721164 Animesh1008 D Oct. 3, 2025, 4:43 p.m. OK Java 21 TESTS 11 327 2764800
341788822 ccj123 D Oct. 4, 2025, 5:54 a.m. OK Java 21 TESTS 11 342 409600
341771133 kpiyush1024 D Oct. 4, 2025, 2:14 a.m. OK Java 21 TESTS 11 343 819200
341733496 flashinglight333 D Oct. 3, 2025, 5:21 p.m. OK Java 21 TESTS 11 359 2764800
341750833 oishiki22 D Oct. 3, 2025, 7:34 p.m. OK Java 21 TESTS 11 499 7987200
341737035 raghav_guptaa D Oct. 3, 2025, 5:31 p.m. OK Java 21 TESTS 11 499 11571200
341733479 Only_Sanity D Oct. 3, 2025, 5:21 p.m. OK Java 21 TESTS 11 514 6860800
341760440 Balu2907 D Oct. 3, 2025, 9:42 p.m. OK Java 21 TESTS 11 515 8294400
341736204 chainkulikibehenkhuli D Oct. 3, 2025, 5:29 p.m. OK Java 21 TESTS 11 546 5427200
341735891 akttripathi395 D Oct. 3, 2025, 5:28 p.m. OK Java 21 TESTS 11 577 3481600
341776563 BrutHawk D Oct. 4, 2025, 3:30 a.m. OK Java 8 TESTS 11 421 15155200
341758226 Eslam_Ahmed D Oct. 3, 2025, 9:02 p.m. OK Java 8 TESTS 11 453 7372800
341743344 saiashish9 D Oct. 3, 2025, 6:31 p.m. OK Java 8 TESTS 11 1874 7475200
341727483 YesBhai D Oct. 3, 2025, 5:02 p.m. OK Java 8 TESTS 11 1983 0
341735415 _Zuno_ D Oct. 3, 2025, 5:26 p.m. OK Node.js TESTS 11 952 111820800
341736812 vlk0 D Oct. 3, 2025, 5:31 p.m. OK PyPy 3 TESTS 11 780 30105600
341763375 morraconda D Oct. 3, 2025, 11 p.m. OK PyPy 3 TESTS 11 874 34816000
341763433 morraconda D Oct. 3, 2025, 11:02 p.m. OK PyPy 3 TESTS 11 968 23859200
341723760 ossau D Oct. 3, 2025, 4:50 p.m. OK PyPy 3-64 TESTS 11 233 42700800
341782462 gardengnome D Oct. 4, 2025, 4:50 a.m. OK PyPy 3-64 TESTS 11 296 34611200
341730891 samchen123 D Oct. 3, 2025, 5:12 p.m. OK PyPy 3-64 TESTS 11 312 33894400
341745868 minuki646 D Oct. 3, 2025, 6:48 p.m. OK PyPy 3-64 TESTS 11 312 35328000
341755909 RobinFromTheHood D Oct. 3, 2025, 8:32 p.m. OK PyPy 3-64 TESTS 11 343 35225600
341744964 Om_Singh_ D Oct. 3, 2025, 6:42 p.m. OK PyPy 3-64 TESTS 11 343 35737600
341733398 RanjanV_1 D Oct. 3, 2025, 5:20 p.m. OK PyPy 3-64 TESTS 11 343 83353600
341733166 bribritt D Oct. 3, 2025, 5:20 p.m. OK PyPy 3-64 TESTS 11 358 40550400
341743218 Tz1934 D Oct. 3, 2025, 6:31 p.m. OK PyPy 3-64 TESTS 11 374 33996800
341724052 blue_clay D Oct. 3, 2025, 4:51 p.m. OK PyPy 3-64 TESTS 11 374 35225600
341735029 Mohammed_Almasry D Oct. 3, 2025, 5:25 p.m. OK Python 3 TESTS 11 531 92160000
341738393 koushcodes D Oct. 3, 2025, 5:34 p.m. OK Python 3 TESTS 11 608 92262400
341727606 praveenLakhara D Oct. 3, 2025, 5:02 p.m. OK Python 3 TESTS 11 890 31129600
341750393 bharatkharbanda4 D Oct. 3, 2025, 7:29 p.m. OK Python 3 TESTS 11 1046 80076800
341721404 dhlinhdn00 D Oct. 3, 2025, 4:44 p.m. OK Python 3 TESTS 11 1218 94310400
341734840 Yuvraj_Veer D Oct. 3, 2025, 5:25 p.m. OK Python 3 TESTS 11 1530 77312000
341722585 crystalsu D Oct. 3, 2025, 4:47 p.m. OK Python 3 TESTS 11 1640 32972800
341729140 pragyaat_goel D Oct. 3, 2025, 5:07 p.m. OK Python 3 TESTS 11 1937 27955200
341727960 hbjp_2007 D Oct. 3, 2025, 5:03 p.m. OK Ruby 3 TESTS 11 1405 39936000
341765444 null_lambda D Oct. 4, 2025, 12:14 a.m. OK Rust 2021 TESTS 11 155 1126400

remove filters

Back to search problems