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
( 1020 ) F Triple Attack PROGRAMMING brute force data structures greedy trees two pointers

Zeus is analyzing a replay of the fight to understand his opponent's attack patterns. The opponent has a special ability: if they land three attacks on a target within a time frame of (z), their third attack becomes a powerful, boosted attack. To outplay his opponent, Zeus should not let his opponent trigger their boosted attack. Let (Y = \{y_1, y_2, \ldots, y_m\}) be the multiset of (m) timestamps, where each (y_i) represents the time when the opponent's attack landed. We call (Y) to be safe if for every three timestamps (\{y_i, y_j, y_k\}) such that (1 \le i < j < k \le m), it holds that (\max(y_i, y_j, y_k) - \min(y_i, y_j, y_k) > z), where (z) is the duration of the time frame that is given to you as an input. Zeus has a log of (n) timestamps, (x_1, x_2, \ldots, x_n), representing when the opponent's attacks landed. The timestamps are sorted in nondecreasing order of occurrence. In other words, (x_i \le x_{i+1}) for all (1 \le i < n). Zeus has (q) intervals of interest, denoted as two integers (1 \le l \le r \le n). For each interval, Zeus wants to find the maximum number of attacks among (x_l, x_{l+1}, \ldots, x_r) that he could have let through: In other words, Zeus wants to find a maximum size subset of the multiset (\{x_l, x_{l+1}, \ldots, x_r\}) such that the subset is safe . Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 20\,000)). The description of the test cases follows. The first line contains two integers (n) and (z) ((1 \le n \le 250\,000), (1 \le z \le 10^9)). The second line contains (n) integers (x_1, x_2, \ldots, x_n) ((1 \le x_i \le 10^9)) — the timestamps of the opponent's attacks. It is guaranteed that the array (x) is sorted, i.e., (x_i \le x_{i+1}) for all (1 \le i < n). The third line contains a single integer (q) ((1 \le q \le 250\,000)). The next

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
341773989 lxeason F Oct. 4, 2025, 2:56 a.m. OK C++17 (GCC 7-32) TESTS 80 640 29081600
341746102 _Fake4Fun F Oct. 3, 2025, 6:50 p.m. OK C++17 (GCC 7-32) TESTS 80 671 54169600
341730175 0xF1 F Oct. 3, 2025, 5:10 p.m. OK C++17 (GCC 7-32) TESTS 80 686 70963200
341724213 kangleni F Oct. 3, 2025, 4:52 p.m. OK C++17 (GCC 7-32) TESTS 80 702 61132800
341731389 crescent_yhw F Oct. 3, 2025, 5:14 p.m. OK C++17 (GCC 7-32) TESTS 80 702 61235200
341738394 mhxtc F Oct. 3, 2025, 5:34 p.m. OK C++17 (GCC 7-32) TESTS 80 702 65228800
341782558 cxf2006 F Oct. 4, 2025, 4:52 a.m. OK C++17 (GCC 7-32) TESTS 80 703 90521600
341767488 crpQwQ F Oct. 4, 2025, 1:07 a.m. OK C++17 (GCC 7-32) TESTS 80 734 55193600
341783570 cxf2006 F Oct. 4, 2025, 5:04 a.m. OK C++17 (GCC 7-32) TESTS 80 734 90521600
341774901 Splashing F Oct. 4, 2025, 3:08 a.m. OK C++17 (GCC 7-32) TESTS 80 749 82841600
341721524 Isoeasy F Oct. 3, 2025, 4:44 p.m. OK C++20 (GCC 13-64) TESTS 80 405 164556800
341773920 uuku F Oct. 4, 2025, 2:56 a.m. OK C++20 (GCC 13-64) TESTS 80 530 64307200
341757295 thisislike_fan F Oct. 3, 2025, 8:49 p.m. OK C++20 (GCC 13-64) TESTS 80 546 48947200
341744434 noya2 F Oct. 3, 2025, 6:38 p.m. OK C++20 (GCC 13-64) TESTS 80 578 65536000
341786199 hshhh_ F Oct. 4, 2025, 5:31 a.m. OK C++20 (GCC 13-64) TESTS 80 624 59392000
341729158 fangzhijian2020 F Oct. 3, 2025, 5:07 p.m. OK C++20 (GCC 13-64) TESTS 80 624 69836800
341734625 wcdr F Oct. 3, 2025, 5:24 p.m. OK C++20 (GCC 13-64) TESTS 80 624 77209600
341726991 AsiraeM F Oct. 3, 2025, 5 p.m. OK C++20 (GCC 13-64) TESTS 80 624 125337600
341735878 max0810 F Oct. 3, 2025, 5:28 p.m. OK C++20 (GCC 13-64) TESTS 80 639 64204800
341730456 Hamed_Ghaffari F Oct. 3, 2025, 5:11 p.m. OK C++20 (GCC 13-64) TESTS 80 640 70348800
341776097 Benq F Oct. 4, 2025, 3:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 327 5324800
341723342 tkacper F Oct. 3, 2025, 4:49 p.m. OK C++23 (GCC 14-64, msys2) TESTS 80 514 40960000
341745280 star354 F Oct. 3, 2025, 6:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 80 530 61849600
341781589 Calculatelove F Oct. 4, 2025, 4:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 562 55193600
341766280 AmirAli-Asgari F Oct. 4, 2025, 12:36 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 562 176844800
341783028 enslaved F Oct. 4, 2025, 4:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 577 63590400
341778108 Sk1ua F Oct. 4, 2025, 3:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 577 75673600
341720914 maspy F Oct. 3, 2025, 4:42 p.m. OK C++23 (GCC 14-64, msys2) TESTS 80 608 65843200
341770713 DangHoaNguyen F Oct. 4, 2025, 2:08 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 609 61542400
341725685 d_k_d F Oct. 3, 2025, 4:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 80 609 67174400

remove filters

Back to search problems