Codeforces Round 1054 (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
2149 Codeforces Round 1054 (Div. 3) FINISHED False 8100 17594723 Sept. 25, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2635 ) G Buratsuta 3 PROGRAMMING binary search brute force data structures divide and conquer probabilities

In the ruthless world of Blue Lock, Buratsuta 3 is a trio selected to overthrow the reigning champions and lead the Japan U-20 team to glory. Sae Itoshi has already secured his place as the first participant; the remaining two spots will be contested in the tough Side-B selection. To test the strategic abilities of the candidates, Buratsuta has posed the following challenge: You are given an array of (n) integers called "performance records" and (q) queries. Each query specifies a subarray (l, r). In this subarray, find all record values that occur strictly more than (\lfloor\tfrac{r - l + 1}{3}\rfloor) times. Each test consists of several test cases. The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. The following describes the test cases. The first line of each test case contains two integers (n) and (q) ((1 \le n, q \le 2\cdot10^5)) — the number of records and the number of queries. The second line of each test case contains (n) integers (a_1, a_2, \dots, a_n) ((1 \le a_i \le 10^9)) — the performance records. Each of the following (q) lines contains two integers (l) and (r) ((1 \le l \le r \le n)) — the boundaries of the query. It is guaranteed that the sum of (n) and sum of (q) over all test cases does not exceed (2 \cdot 10^5). For each query, output in one line all record values (in sorted order) that occur strictly more than (\lfloor\tfrac{r - l + 1}{3}\rfloor) times in the segment (l, r). If there are no such values, output (-1). In the second test case, the array is (a=1,1,2,3) and there are two queries: Query ((l,r)=(1,4)): The length of the segment (len=r-l+1=4), the threshold (\bigl\lfloor \frac{len}{3}\bigr\rfloor+1 = 2). Occurrences of numbers: (1\!\to\!2), (2\!\to\!1), (3\!\to\!1). Only the number (1) occurs at least (2) times, so the answer is: (1). Query $$$(l,r)=(2

Tutorials

__rose

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
340504851 TinK8_Tri G Sept. 25, 2025, 4:47 p.m. OK C++17 (GCC 7-32) TESTS 34 374 16384000
340544645 jose_mourinho G Sept. 26, 2025, 12:40 a.m. OK C++17 (GCC 7-32) TESTS 43 437 17203200
340504216 itsmehr G Sept. 25, 2025, 4:46 p.m. OK C++17 (GCC 7-32) TESTS 34 452 14438400
340545836 Kesrenal G Sept. 26, 2025, 1:04 a.m. OK C++17 (GCC 7-32) TESTS 43 452 60928000
340508144 lottle1212 G Sept. 25, 2025, 4:56 p.m. OK C++17 (GCC 7-32) TESTS 34 484 79462400
340559720 dauphailadui G Sept. 26, 2025, 4:38 a.m. OK C++17 (GCC 7-32) TESTS 43 514 12800000
340505199 Faiz_07_12 G Sept. 25, 2025, 4:47 p.m. OK C++17 (GCC 7-32) TESTS 34 514 17203200
340567867 xz7517 G Sept. 26, 2025, 5:59 a.m. OK C++17 (GCC 7-32) TESTS 61 546 19660800
340505416 ShadowSlayer1 G Sept. 25, 2025, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 34 546 22016000
340509565 KS_Fszha G Sept. 25, 2025, 5:03 p.m. OK C++17 (GCC 7-32) TESTS 34 577 27750400
340514964 starplatinumzawarudo G Sept. 25, 2025, 5:42 p.m. OK C++20 (GCC 13-64) TESTS 34 280 7577600
340557079 dreamjoker G Sept. 26, 2025, 4:03 a.m. OK C++20 (GCC 13-64) TESTS 43 374 12902400
340505189 BrotherCall G Sept. 25, 2025, 4:47 p.m. OK C++20 (GCC 13-64) TESTS 34 374 98816000
340511524 dvb1r G Sept. 25, 2025, 5:16 p.m. OK C++20 (GCC 13-64) TESTS 34 389 9728000
340514069 GOTKAKO G Sept. 25, 2025, 5:35 p.m. OK C++20 (GCC 13-64) TESTS 34 390 17920000
340544109 tiger2005 G Sept. 26, 2025, 12:28 a.m. OK C++20 (GCC 13-64) TESTS 43 421 72806400
340557894 aa2315 G Sept. 26, 2025, 4:14 a.m. OK C++20 (GCC 13-64) TESTS 43 436 66764800
340543219 line G Sept. 26, 2025, 12:07 a.m. OK C++20 (GCC 13-64) TESTS 43 437 2560000
340514134 fizaaaaaaaa G Sept. 25, 2025, 5:35 p.m. OK C++20 (GCC 13-64) TESTS 34 452 25088000
340547215 Fushengh G Sept. 26, 2025, 1:31 a.m. OK C++20 (GCC 13-64) TESTS 43 452 25497600
340518786 Proofy G Sept. 25, 2025, 6:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 249 11059200
340546919 zhcmmm G Sept. 26, 2025, 1:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 43 327 9011200
340549028 Codesystem G Sept. 26, 2025, 2:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 43 343 50585600
340521142 Proofy G Sept. 25, 2025, 6:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 359 11059200
340513734 grecil G Sept. 25, 2025, 5:32 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 359 37990400
340520899 Proofy G Sept. 25, 2025, 6:32 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 389 11059200
340539032 Kuroudo G Sept. 25, 2025, 10:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 405 121856000
340514191 okyh G Sept. 25, 2025, 5:36 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 436 27136000
340543965 perseverance_04 G Sept. 26, 2025, 12:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 43 436 31232000
340511561 tin.le2 G Sept. 25, 2025, 5:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 437 14745600
340504998 vellacoder1 G Sept. 25, 2025, 4:47 p.m. OK Java 21 TESTS 34 4062 82022400
340532100 Yousef_Badr G Sept. 25, 2025, 8:36 p.m. OK Java 21 TESTS 43 4468 52838400
340508544 __baozii__ G Sept. 25, 2025, 4:58 p.m. OK Kotlin 2.2 TESTS 34 1983 62259200
340516275 grecil G Sept. 25, 2025, 5:53 p.m. OK PyPy 3-64 TESTS 34 843 67174400
340513210 grecil G Sept. 25, 2025, 5:28 p.m. OK PyPy 3-64 TESTS 34 952 98611200
340512923 grecil G Sept. 25, 2025, 5:26 p.m. OK PyPy 3-64 TESTS 34 1140 102092800
340556975 wyzl G Sept. 26, 2025, 4:01 a.m. OK PyPy 3-64 TESTS 43 2405 80179200
340557389 wyzl G Sept. 26, 2025, 4:06 a.m. OK PyPy 3-64 TESTS 43 2686 76697600
340543006 IcyGirl G Sept. 26, 2025, 12:02 a.m. OK PyPy 3-64 TESTS 43 3811 99840000
340519346 DarkTemplarDrop G Sept. 25, 2025, 6:19 p.m. OK PyPy 3-64 TESTS 43 3952 77516800
340565073 krism G Sept. 26, 2025, 5:29 a.m. OK PyPy 3-64 TESTS 61 4046 95846400
340541549 IcyGirl G Sept. 25, 2025, 11:24 p.m. OK PyPy 3-64 TESTS 43 4140 97894400
340531638 LMeyling G Sept. 25, 2025, 8:30 p.m. OK PyPy 3-64 TESTS 43 4187 96051200

remove filters

Back to search problems