Codeforces Round 1068 (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
2173 Codeforces Round 1068 (Div. 2) FINISHED False 7200 11460323 Dec. 5, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 548 ) F Isla's Memory Thresholds PROGRAMMING binary search data structures divide and conquer math

In the world of Plastic Memories , Isla is collecting (n) memory fragments. The (i)-th fragment has size (a_i), and the sizes are non-increasing , that is, (a_1 \ge a_2 \ge \cdots \ge a_n). During retrieval, Isla processes fragments on a range and stores their sizes into a buffer. Whenever the buffer reaches a given threshold (x), it overflows: one capsule is recorded, and the buffer is cleared to zero. There are (q) independent queries, each described by a triple ((l,r,x)). For each query, (x) denotes Isla's memory capacity. Isla then picks up the (i)-th memory fragment one by one for each (l \le i \le r). At any moment, if the total size of the fragments she is currently holding is at least (x), she clears her memory completely (keeping nothing). You must determine how many times Isla clears her memory and the final sum of the size of the fragments she holds. 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 of each test case contains two integers (n) and (q) ((1 \le n, q \le 150,000)) — the length of (a) and the number of queries. The second line of each test case contains (n) integers (a_1,a_2,\ldots,a_n) ((1 \le a_i \le 10^9)) — the elements of (a). It is guaranteed that (a_1 \ge a_2 \ge \cdots \ge a_n). Then (q) lines follow, each containing three integers (l), (r), and (x) ((1 \le l \le r \le n), (1 \le x \le 10^9)) — a query. It is guaranteed that the sum of (n) over all test cases does not exceed (150,000). It is guaranteed that the sum of (q) over all test cases does not exceed (150,000). For each test case, output two integers for each query — the number of times Isla clears her memory and the final sum of the size of the fragments she holds. Let (cnt) be how many times Isla has cleared

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
352099467 fogrevelation F Dec. 5, 2025, 4:34 p.m. OK C++17 (GCC 7-32) TESTS 22 1281 6656000
352094508 _Decoder-1 F Dec. 5, 2025, 4:25 p.m. OK C++17 (GCC 7-32) TESTS 22 3843 0
352096015 isfull F Dec. 5, 2025, 4:28 p.m. OK C++17 (GCC 7-32) TESTS 22 4062 102400
352159517 hungchi17 F Dec. 6, 2025, 4:44 a.m. OK C++17 (GCC 7-32) TESTS 27 4109 418508800
352128741 chiku_fsa F Dec. 5, 2025, 8:39 p.m. OK C++17 (GCC 7-32) TESTS 25 4281 418508800
352119747 KentShnurnikova F Dec. 5, 2025, 7:10 p.m. OK C++17 (GCC 7-32) TESTS 25 4296 0
352161311 ACr0bat F Dec. 6, 2025, 5 a.m. OK C++17 (GCC 7-32) TESTS 27 4375 418508800
352129753 chiku_fsa F Dec. 5, 2025, 8:53 p.m. OK C++17 (GCC 7-32) TESTS 25 4406 2457600
352130006 chiku_fsa F Dec. 5, 2025, 8:57 p.m. OK C++17 (GCC 7-32) TESTS 25 4421 2457600
352130217 chiku_fsa F Dec. 5, 2025, 9 p.m. OK C++17 (GCC 7-32) TESTS 25 4437 1228800
352110313 kondasujay2 F Dec. 5, 2025, 5:58 p.m. OK C++20 (GCC 13-64) TESTS 25 453 0
352111404 kondasujay2 F Dec. 5, 2025, 6:05 p.m. OK C++20 (GCC 13-64) TESTS 25 453 102400
352112878 kondasujay2 F Dec. 5, 2025, 6:15 p.m. OK C++20 (GCC 13-64) TESTS 25 625 0
352137022 zltzlt F Dec. 5, 2025, 11:28 p.m. OK C++20 (GCC 13-64) TESTS 25 1187 4608000
352109276 Mohammad-Parsa F Dec. 5, 2025, 5:51 p.m. OK C++20 (GCC 13-64) TESTS 24 1671 16076800
352108266 Fysty F Dec. 5, 2025, 5:45 p.m. OK C++20 (GCC 13-64) TESTS 24 1812 1843200
352097685 HuyAT F Dec. 5, 2025, 4:31 p.m. OK C++20 (GCC 13-64) TESTS 22 2000 102400
352108300 Fysty F Dec. 5, 2025, 5:45 p.m. OK C++20 (GCC 13-64) TESTS 24 2156 1843200
352119939 244mhq F Dec. 5, 2025, 7:12 p.m. OK C++20 (GCC 13-64) TESTS 25 2312 3276800
352125664 Gorang_rathi F Dec. 5, 2025, 8:04 p.m. OK C++20 (GCC 13-64) TESTS 25 2500 1228800
352110878 maspy F Dec. 5, 2025, 6:02 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 328 307200
352112018 maspy F Dec. 5, 2025, 6:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 343 307200
352149167 ali2005_syr F Dec. 6, 2025, 2:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 27 468 102400
352142826 sho_eib_w_sho_msh_eib F Dec. 6, 2025, 1:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 1171 16076800
352107454 thisislike F Dec. 5, 2025, 5:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 1281 7884800
352126097 JeanBombeur F Dec. 5, 2025, 8:08 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 1296 0
352151085 myagkov F Dec. 6, 2025, 3:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 27 1453 102400
352105569 pinchmee F Dec. 5, 2025, 5:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 1468 4608000
352163515 FWKnightship F Dec. 6, 2025, 5:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 27 1484 11468800
352106591 thisislike F Dec. 5, 2025, 5:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 1500 7884800
352109717 toor F Dec. 5, 2025, 5:54 p.m. OK Rust 2024 TESTS 25 4656 2355200

remove filters

Back to search problems