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 |
|---|---|---|---|---|---|---|
| 2123 | Codeforces Round 1034 (Div. 3) | FINISHED | False | 8100 | 25025123 | July 1, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 3223 ) | G | Modular Sorting | PROGRAMMING | brute force data structures math number theory |
You are given an integer (m) ((2\leq m\leq 5\cdot 10^5)) and an array (a) consisting of nonnegative integers smaller than (m). Answer queries of the following form: (1) (i) (x): assign (a_i := x) (2) (k): in one operation, you may choose an element (a_i) and assign (a_i := (a_i + k) \pmod m)(^{\text{∗}}) — determine if there exists some sequence of (possibly zero) operations to make (a) nondecreasing(^{\text{†}}). Note that instances of query (2) are independent; that is, no actual operations are taking place. Instances of query (1) are persistent. (^{\text{∗}})(a\pmod m) is defined as the unique integer (b) such that (0\leq b<m) and (a-b) is an integer multiple of (m). (^{\text{†}})An array (a) of size (n) is called nondecreasing if and only if (a_i\leq a_{i+1}) for all (1\leq i<n). The first line contains an integer (t) ((1\leq t\leq 10^4)) — the number of test cases. The first line of each test case contains three integers, (n), (m), and (q) ((2\leq n \leq 10^5), (2\leq m\leq 5\cdot10^5), (1\leq q\leq 10^5)) — the size of the array (a), the integer (m), and the number of queries. The second line of each test case contains (n) integers, (a_1,a_2,\dots,a_n) ((0\leq a_i < m)). Then follows (q) lines. Each line is of one of the following forms: (1) (i) (x) ((1\leq i\leq n), (0\leq x<m)) (2) (k) ((1\leq k<m)) It is guaranteed that the sum of (n) and the sum of (q) over all test cases each do not exceed (10^5). For each instance of query (2), output on a single line " YES " if there exists some sequence of (possibly zero) operations to make (a) nondecreasing, and " NO " otherwise. You can output the answer in any case (upper or lower). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will be recognized as positive responses. In |
| Codeforces Round 1034 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 327179283 | og.kostya | G | July 3, 2025, 6:05 a.m. | OK | C# 13 | TESTS | 38 | 639 | 69529600 | ||
| 327092470 | -firefly- | G | July 2, 2025, 1:20 p.m. | OK | C# 13 | TESTS | 38 | 2702 | 92569600 | ||
| 327024569 | shibaaaaa | G | July 2, 2025, 4:43 a.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 515 | 102400 | ||
| 327028080 | Phantom_Dreams | G | July 2, 2025, 5:19 a.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 577 | 1638400 | ||
| 327088208 | -adhd- | G | July 2, 2025, 12:50 p.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 609 | 102400 | ||
| 327111267 | I_will_AKIOI | G | July 2, 2025, 3:36 p.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 671 | 6041600 | ||
| 327093084 | hangogogo | G | July 2, 2025, 1:25 p.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 687 | 200499200 | ||
| 327161562 | LiuKH | G | July 3, 2025, 2:49 a.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 702 | 2457600 | ||
| 327091821 | hangogogo | G | July 2, 2025, 1:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 703 | 240640000 | ||
| 327081171 | Good_WeekDay_ | G | July 2, 2025, 12:04 p.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 765 | 6041600 | ||
| 327165874 | nazeeftham007 | G | July 3, 2025, 3:42 a.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 828 | 102400 | ||
| 327121601 | lucky_64 | G | July 2, 2025, 4:53 p.m. | OK | C++17 (GCC 7-32) | TESTS | 38 | 890 | 81715200 | ||
| 327106752 | Abuseini | G | July 2, 2025, 3:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 390 | 2048000 | ||
| 327087342 | Harshvardhan_Acharya | G | July 2, 2025, 12:45 p.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 515 | 102400 | ||
| 327107843 | rayban | G | July 2, 2025, 3:10 p.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 531 | 102400 | ||
| 327120337 | dsogari | G | July 2, 2025, 4:44 p.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 546 | 102400 | ||
| 327022765 | ConvexHulllllll | G | July 2, 2025, 4:22 a.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 561 | 8499200 | ||
| 327073296 | FlowerandYou | G | July 2, 2025, 11:13 a.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 578 | 102400 | ||
| 327023905 | LuOH3_ | G | July 2, 2025, 4:35 a.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 593 | 77926400 | ||
| 327027182 | Leo11wasd | G | July 2, 2025, 5:12 a.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 624 | 76697600 | ||
| 327121594 | Mighilon | G | July 2, 2025, 4:53 p.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 624 | 161792000 | ||
| 327141213 | mathworker21 | G | July 2, 2025, 7:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 38 | 765 | 0 | ||
| 327111822 | 424479543 | G | July 2, 2025, 3:40 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 359 | 102400 | ||
| 327113120 | 424479543 | G | July 2, 2025, 3:49 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 374 | 102400 | ||
| 327022301 | fishcathu | G | July 2, 2025, 4:16 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 390 | 2457600 | ||
| 327138948 | arshad739811 | G | July 2, 2025, 7:30 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 390 | 83865600 | ||
| 327093776 | Kam25haiwe23 | G | July 2, 2025, 1:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 468 | 102400 | ||
| 327114979 | stargazing_ | G | July 2, 2025, 4:03 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 484 | 512000 | ||
| 327071593 | UltramanDecker | G | July 2, 2025, 11:01 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 562 | 2150400 | ||
| 327025592 | Mkswll | G | July 2, 2025, 4:55 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 593 | 2048000 | ||
| 327064474 | prasoon107 | G | July 2, 2025, 10:10 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 609 | 6553600 | ||
| 327085038 | Incredible0306 | G | July 2, 2025, 12:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 38 | 624 | 0 | ||
| 327027797 | kl2300030434 | G | July 2, 2025, 5:17 a.m. | OK | GNU C11 | TESTS | 38 | 358 | 2560000 | ||
| 327076320 | xzx_com | G | July 2, 2025, 11:33 a.m. | OK | GNU C11 | TESTS | 38 | 1109 | 512000 | ||
| 327139327 | cpp10 | G | July 2, 2025, 7:34 p.m. | OK | Java 21 | TESTS | 38 | 906 | 2969600 | ||
| 327139201 | cpp10 | G | July 2, 2025, 7:33 p.m. | OK | Java 21 | TESTS | 38 | 968 | 2764800 | ||
| 327116708 | hemant | G | July 2, 2025, 4:16 p.m. | OK | Java 21 | TESTS | 38 | 1999 | 1126400 | ||
| 327175126 | deepak7355 | G | July 3, 2025, 5:24 a.m. | OK | Java 21 | TESTS | 38 | 2077 | 1843200 | ||
| 327126836 | Suhani_Rawat | G | July 2, 2025, 5:38 p.m. | OK | Java 21 | TESTS | 38 | 2092 | 1740800 | ||
| 327163136 | filliones | G | July 3, 2025, 3:09 a.m. | OK | PyPy 3-64 | TESTS | 38 | 2358 | 42803200 | ||
| 327055814 | Skyblock127 | G | July 2, 2025, 9:16 a.m. | OK | PyPy 3-64 | TESTS | 38 | 2561 | 17715200 | ||
| 327115397 | yejordan8888 | G | July 2, 2025, 4:06 p.m. | OK | PyPy 3-64 | TESTS | 38 | 2593 | 50688000 | ||
| 327085998 | kamio-misuzu | G | July 2, 2025, 12:35 p.m. | OK | PyPy 3-64 | TESTS | 38 | 2952 | 19968000 | ||
| 327087824 | kamio-misuzu | G | July 2, 2025, 12:48 p.m. | OK | PyPy 3-64 | TESTS | 38 | 2984 | 19660800 | ||
| 327089873 | kruebbelegassiemz2154 | G | July 2, 2025, 1:02 p.m. | OK | PyPy 3-64 | TESTS | 38 | 3078 | 22835200 | ||
| 327152525 | Puddles_Penguin | G | July 2, 2025, 11:45 p.m. | OK | PyPy 3-64 | TESTS | 38 | 3218 | 14233600 | ||
| 327130535 | smz.26 | G | July 2, 2025, 6:09 p.m. | OK | PyPy 3-64 | TESTS | 38 | 3296 | 19558400 | ||
| 327079869 | Munbo | G | July 2, 2025, 11:56 a.m. | OK | PyPy 3-64 | TESTS | 38 | 3374 | 20889600 | ||
| 327093753 | kamio-misuzu | G | July 2, 2025, 1:29 p.m. | OK | PyPy 3-64 | TESTS | 38 | 3484 | 14336000 | ||
| 327057713 | BlackAura1337 | G | July 2, 2025, 9:27 a.m. | OK | Rust 2021 | TESTS | 38 | 1093 | 163532800 | ||
| 327169695 | Spheniscine | G | July 3, 2025, 4:29 a.m. | OK | Rust 2021 | TESTS | 38 | 1156 | 102400 | ||
| 327169260 | Spheniscine | G | July 3, 2025, 4:24 a.m. | OK | Rust 2021 | TESTS | 38 | 1342 | 78950400 |
Back to search problems