Codeforces Round 1032 (Div. 3)

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
2121 Codeforces Round 1032 (Div. 3) FINISHED False 8100 26234723 June 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 8064 ) F Yamakasi PROGRAMMING binary search brute force data structures greedy

You are given an array of integers (a_1, a_2, \ldots, a_n) and two integers (s) and (x). Count the number of subsegments of the array whose sum of elements equals (s) and whose maximum value equals (x). More formally, count the number of pairs (1 \leq l \leq r \leq n) such that: (a_l + a_{l + 1} + \ldots + a_r = s). (\max(a_l, a_{l + 1}, \ldots, a_r) = x). Each test consists of multiple test cases. The first line contains a single integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains three integers (n), (s), and (x) ((1 \leq n \leq 2 \cdot 10^5), (-2 \cdot 10^{14} \leq s \leq 2 \cdot 10^{14}), (-10^9 \leq x \leq 10^9)). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((-10^9 \leq a_i \leq 10^9)). It is guaranteed that the sum of (n) across all test cases does not exceed (2 \cdot 10^5). For each test case, output the number of subsegments of the array whose sum of elements equals (s) and whose maximum value equals (x). In the first test case, the suitable subsegment is (l = 1), (r = 1). In the third test case, the suitable subsegments are (l = 1), (r = 1) and (l = 3), (r = 3). In the fifth test case, the suitable subsegments are (l = 1), (r = 3) and (l = 6), (r = 8). In the sixth test case, the suitable subsegments are those for which (r = l + 2). In the seventh test case, the following subsegments are suitable: (l = 1), (r = 7). (l = 2), (r = 7). (l = 3), (r = 6). (l = 4), (r = 8). (l = 7), (r = 11). (l = 7), (r = 12). (l = 8), (r = 10). (l = 9), (r = 13).

Tutorials

Codeforces Round 1032 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
324929198 og.kostya F June 17, 2025, 5:32 p.m. OK C# 13 TESTS 23 671 30105600
324968949 NeoReaperX F June 18, 2025, 3:03 a.m. OK C++17 (GCC 7-32) TESTS 25 125 7065600
324928384 osource F June 17, 2025, 5:26 p.m. OK C++17 (GCC 7-32) TESTS 23 139 10547200
324966718 Neshwanth0. F June 18, 2025, 2:32 a.m. OK C++17 (GCC 7-32) TESTS 25 140 7987200
324966643 santosh_marumokam F June 18, 2025, 2:31 a.m. OK C++17 (GCC 7-32) TESTS 25 155 7884800
324982780 lccl19 F June 18, 2025, 5:39 a.m. OK C++17 (GCC 7-32) TESTS 25 155 9625600
324938650 yzljy F June 17, 2025, 5:56 p.m. OK C++17 (GCC 7-32) TESTS 24 155 40038400
324982706 lccl19 F June 18, 2025, 5:38 a.m. OK C++17 (GCC 7-32) TESTS 25 156 9728000
324953983 Phantom_Dreams F June 17, 2025, 9:09 p.m. OK C++17 (GCC 7-32) TESTS 25 156 15462400
324978507 RahilGupta F June 18, 2025, 4:55 a.m. OK C++17 (GCC 7-32) TESTS 25 171 5836800
324924404 whhsteven F June 17, 2025, 5 p.m. OK C++17 (GCC 7-32) TESTS 23 171 7168000
324977290 i_love_sqrt_decomp F June 18, 2025, 4:42 a.m. OK C++20 (GCC 13-64) TESTS 25 62 10342400
324940929 lzh66666666 F June 17, 2025, 6:17 p.m. OK C++20 (GCC 13-64) TESTS 24 124 11980800
324942870 Spicy_Syntax F June 17, 2025, 6:35 p.m. OK C++20 (GCC 13-64) TESTS 25 125 11571200
324943276 nargestaghizadeh89 F June 17, 2025, 6:40 p.m. OK C++20 (GCC 13-64) TESTS 25 139 13107200
324939902 NotFound F June 17, 2025, 6:07 p.m. OK C++20 (GCC 13-64) TESTS 24 140 9932800
324930419 CrazyCoder00 F June 17, 2025, 5:42 p.m. OK C++20 (GCC 13-64) TESTS 23 140 12390400
324927706 Awwab_coder123 F June 17, 2025, 5:21 p.m. OK C++20 (GCC 13-64) TESTS 23 140 13107200
324939279 GosarGawd F June 17, 2025, 6:02 p.m. OK C++20 (GCC 13-64) TESTS 24 140 13209600
324928651 tammmmmy F June 17, 2025, 5:28 p.m. OK C++20 (GCC 13-64) TESTS 23 140 18534400
324947612 jeff34 F June 17, 2025, 7:30 p.m. OK C++20 (GCC 13-64) TESTS 25 140 23142400
324953028 zondys F June 17, 2025, 8:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 109 2867200
324981993 Vipulkumar04 F June 18, 2025, 5:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 109 7065600
324960872 Kita11 F June 18, 2025, 12:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 109 12083200
324978680 prasanntrivedi6263 F June 18, 2025, 4:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 109 13107200
324942928 0M_2179 F June 17, 2025, 6:36 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 109 13209600
324967118 JiHuan F June 18, 2025, 2:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 109 13824000
324983661 AmiracleTa F June 18, 2025, 5:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 124 12902400
324965517 Hamza_28 F June 18, 2025, 2:13 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 140 11571200
324965851 azureboy F June 18, 2025, 2:19 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 140 13107200
324923622 Rahul_23M F June 17, 2025, 4:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 140 16896000
324943347 hemant F June 17, 2025, 6:40 p.m. OK Java 21 TESTS 25 421 41369600
324941502 ash432 F June 17, 2025, 6:22 p.m. OK Java 21 TESTS 25 515 19148800
324919382 RahulAhuja2901 F June 17, 2025, 4:47 p.m. OK Java 21 TESTS 23 577 42803200
324937835 WrongAnswerOnTestCase2 F June 17, 2025, 5:49 p.m. OK Java 21 TESTS 23 593 32563200
324929167 Bogys F June 17, 2025, 5:32 p.m. OK Java 21 TESTS 23 624 24166400
324965704 man-ray F June 18, 2025, 2:17 a.m. OK Java 21 TESTS 25 640 31334400
324919597 Manoj_mk F June 17, 2025, 4:47 p.m. OK Java 21 TESTS 23 905 17510400
324919446 sokhi-e F June 17, 2025, 4:47 p.m. OK Java 21 TESTS 23 936 18636800
324927133 choudharyyashu054 F June 17, 2025, 5:17 p.m. OK Java 21 TESTS 23 937 17715200
324928849 sreecharanreddypacharla F June 17, 2025, 5:30 p.m. OK Java 21 TESTS 23 968 43929600
324978830 tirthgohil1410 F June 18, 2025, 4:58 a.m. OK Java 8 TESTS 25 343 14131200
324947414 ppwani F June 17, 2025, 7:28 p.m. OK Java 8 TESTS 25 405 29184000
324921593 sarthaKKharKa_18 F June 17, 2025, 4:49 p.m. OK Java 8 TESTS 23 421 15257600
324980842 sandesh543 F June 18, 2025, 5:20 a.m. OK Java 8 TESTS 25 436 26624000
324940391 kasiru_69 F June 17, 2025, 6:12 p.m. OK Java 8 TESTS 24 515 28672000
324937528 Sumitsingh7 F June 17, 2025, 5:47 p.m. OK Java 8 TESTS 23 578 81715200
324927427 kesihai F June 17, 2025, 5:19 p.m. OK Java 8 TESTS 23 671 16076800
324922439 chinesedfan F June 17, 2025, 4:51 p.m. OK Node.js TESTS 23 608 95744000
324981930 mvkhanh F June 18, 2025, 5:31 a.m. OK PyPy 3-64 TESTS 25 186 34304000
324971162 YFffffffff F June 18, 2025, 3:32 a.m. OK PyPy 3-64 TESTS 25 218 33792000
324944214 ansere F June 17, 2025, 6:49 p.m. OK PyPy 3-64 TESTS 25 218 34099200
324922699 porcif F June 17, 2025, 4:52 p.m. OK PyPy 3-64 TESTS 23 265 37888000
324939761 V3k0r F June 17, 2025, 6:06 p.m. OK PyPy 3-64 TESTS 24 265 40448000
324923504 monocrap F June 17, 2025, 4:55 p.m. OK PyPy 3-64 TESTS 23 281 39526400
324966780 hxu10 F June 18, 2025, 2:33 a.m. OK PyPy 3-64 TESTS 25 296 40243200
324947843 Om_Singh_ F June 17, 2025, 7:33 p.m. OK PyPy 3-64 TESTS 25 296 57548800
324962684 minuki646 F June 18, 2025, 1:22 a.m. OK PyPy 3-64 TESTS 25 296 64204800
324980581 Taymyr F June 18, 2025, 5:17 a.m. OK PyPy 3-64 TESTS 25 312 60620800
324924534 sw0405 F June 17, 2025, 5:01 p.m. OK Python 3 TESTS 23 342 64716800
324950456 MadhavPeddi F June 17, 2025, 8:09 p.m. OK Python 3 TESTS 25 437 61542400
324969389 amal064 F June 18, 2025, 3:09 a.m. OK Rust 2021 TESTS 25 155 39219200

remove filters

Back to search problems