Codeforces Round 1029 (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
2117 Codeforces Round 1029 (Div. 3) FINISHED False 8100 27012323 June 8, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 21985 ) D Retaliation PROGRAMMING binary search math

Yousef wants to explode an array (a_1, a_2, \dots, a_n). An array gets exploded when all of its elements become equal to zero. In one operation, Yousef can do exactly one of the following: For every index (i) in (a), decrease (a_i) by (i). For every index (i) in (a), decrease (a_i) by (n - i + 1). Your task is to help Yousef determine if it is possible to explode the array using any number of operations. The first line of the input contains an integer (t) ((1 \le t \le 10^4)) — the number of test cases. The first line of each test case contains an integer (n) ((2 \le n \le 2 \cdot 10^5)) — the size of the array. 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 elements of the array. It is guaranteed that the sum of (n) over all test cases doesn't exceed (2 \cdot 10^5). For each test case, print " YES " if Yousef can explode the array, otherwise output " NO ". 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 the second test case, we can do the following: Perform (1) operation of the first type. The array becomes (20, 16, 12, 8, 4). Perform (4) operations of the second type. The array becomes (0, 0, 0, 0, 0). In the first, third, fourth, and sixth test cases, it can be proven that it is impossible to make all elements equal to zero using any number of operations.

Tutorials

Codeforces Round 1029 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
323639957 IRacle D June 9, 2025, 1:25 p.m. OK C# 10 TESTS 12 124 17920000
323713462 og.kostya D June 10, 2025, 5:12 a.m. OK C# 13 TESTS 12 124 1433600
323635872 Kush_Likhdhari D June 9, 2025, 12:56 p.m. OK C++17 (GCC 7-32) TESTS 12 77 0
323714131 ylh_ D June 10, 2025, 5:20 a.m. OK C++17 (GCC 7-32) TESTS 12 77 0
323682301 waqar_ahmed_madni D June 9, 2025, 7:08 p.m. OK C++17 (GCC 7-32) TESTS 12 77 0
323656222 PradyunT D June 9, 2025, 3:28 p.m. OK C++17 (GCC 7-32) TESTS 12 77 0
323647387 darkDeveloper_228 D June 9, 2025, 2:20 p.m. OK C++17 (GCC 7-32) TESTS 12 77 102400
323626327 ZUHAYER_ D June 9, 2025, 11:45 a.m. OK C++17 (GCC 7-32) TESTS 12 77 102400
323618731 aryank07 D June 9, 2025, 10:47 a.m. OK C++17 (GCC 7-32) TESTS 12 78 0
323662867 notmrabhi D June 9, 2025, 4:21 p.m. OK C++17 (GCC 7-32) TESTS 12 78 0
323619168 morex3 D June 9, 2025, 10:50 a.m. OK C++17 (GCC 7-32) TESTS 12 78 0
323672687 lahoax D June 9, 2025, 5:40 p.m. OK C++17 (GCC 7-32) TESTS 12 78 102400
323619699 DuyAnhYeuPTIT D June 9, 2025, 10:54 a.m. OK C++20 (GCC 13-64) TESTS 12 62 102400
323586444 One_Wan D June 9, 2025, 6:25 a.m. OK C++20 (GCC 13-64) TESTS 12 62 1740800
323671460 Noob_er_Bacca D June 9, 2025, 5:29 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
323674869 becastal D June 9, 2025, 5:58 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
323668386 Kriith D June 9, 2025, 5:03 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
323665731 MohmedGado_255 D June 9, 2025, 4:43 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
323664953 The_Batman99 D June 9, 2025, 4:38 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
323655415 817 D June 9, 2025, 3:21 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
323645715 CodeAlpha07 D June 9, 2025, 2:07 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
323645304 cse D June 9, 2025, 2:04 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
323585375 20412014 D June 9, 2025, 6:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 0
323655045 Subhodip_86 D June 9, 2025, 3:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 102400
323655013 subho86 D June 9, 2025, 3:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 102400
323642877 jjwawy999 D June 9, 2025, 1:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 102400
323627529 aloocoder D June 9, 2025, 11:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 102400
323647560 Antumbra01 D June 9, 2025, 2:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 3174400
323715418 one_unknown D June 10, 2025, 5:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
323713728 wthutsav D June 10, 2025, 5:16 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
323706481 ys_26 D June 10, 2025, 3:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
323705696 zombie627 D June 10, 2025, 3:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
323609897 bluemegane D June 9, 2025, 9:43 a.m. OK C# 8 TESTS 12 171 16588800
323693619 djad04 D June 9, 2025, 10:32 p.m. OK GNU C11 TESTS 12 93 819200
323644764 ShauryaVats D June 9, 2025, 2:01 p.m. OK GNU C11 TESTS 12 109 819200
323686679 Adamant18 D June 9, 2025, 8:06 p.m. OK GNU C11 TESTS 12 109 819200
323642364 eatyumi D June 9, 2025, 1:42 p.m. OK GNU C11 TESTS 12 109 921600
323694136 djad04 D June 9, 2025, 10:48 p.m. OK GNU C11 TESTS 12 109 921600
323651348 shubhayandas2004 D June 9, 2025, 2:48 p.m. OK GNU C11 TESTS 12 109 1740800
323654172 roy1012 D June 9, 2025, 3:11 p.m. OK GNU C11 TESTS 12 124 819200
323607183 RachitSoni D June 9, 2025, 9:23 a.m. OK GNU C11 TESTS 12 124 819200
323641760 eatyumi D June 9, 2025, 1:38 p.m. OK GNU C11 TESTS 12 139 921600
323675301 abhi23100 D June 9, 2025, 6:01 p.m. OK GNU C11 TESTS 12 140 1843200
323620463 HarhsSoni D June 9, 2025, 11 a.m. OK Java 21 TESTS 12 281 716800
323642750 sahil_14 D June 9, 2025, 1:45 p.m. OK Java 21 TESTS 12 296 204800
323677330 codes411 D June 9, 2025, 6:19 p.m. OK Java 21 TESTS 12 296 614400
323707615 flicktoss D June 10, 2025, 3:56 a.m. OK Java 21 TESTS 12 296 1945600
323583095 2manas1 D June 9, 2025, 5:49 a.m. OK Java 21 TESTS 12 311 921600
323639501 Pramod_Bhosale67 D June 9, 2025, 1:21 p.m. OK Java 21 TESTS 12 312 1331200
323658048 WrongAnswerOnTestCase2 D June 9, 2025, 3:43 p.m. OK Java 21 TESTS 12 327 204800
323647170 one_minus_one D June 9, 2025, 2:19 p.m. OK Java 21 TESTS 12 327 307200
323605118 amit_roy D June 9, 2025, 9:10 a.m. OK Java 21 TESTS 12 327 307200
323605018 priyaroy3370 D June 9, 2025, 9:09 a.m. OK Java 21 TESTS 12 327 614400
323688650 Sumitsingh7 D June 9, 2025, 8:38 p.m. OK Java 8 TESTS 12 171 6860800
323687041 satyams_9001 D June 9, 2025, 8:12 p.m. OK Java 8 TESTS 12 171 6860800
323638120 NischayCodes D June 9, 2025, 1:12 p.m. OK Java 8 TESTS 12 218 3584000
323607214 bhishma_v2 D June 9, 2025, 9:23 a.m. OK Java 8 TESTS 12 218 3891200
323654140 AchalVishnoi D June 9, 2025, 3:11 p.m. OK Java 8 TESTS 12 467 0
323668891 aviral20040 D June 9, 2025, 5:08 p.m. OK Java 8 TESTS 12 468 0
323637277 jroy.karnati D June 9, 2025, 1:05 p.m. OK Java 8 TESTS 12 468 0
323627147 sunil_singh D June 9, 2025, 11:52 a.m. OK Java 8 TESTS 12 468 0
323630455 Divyanshu_Lila D June 9, 2025, 12:16 p.m. OK Java 8 TESTS 12 499 3481600
323634822 Ishaan__23 D June 9, 2025, 12:48 p.m. OK Java 8 TESTS 12 515 0
323657352 chinesedfan D June 9, 2025, 3:37 p.m. OK Node.js TESTS 12 171 29286400
323692693 unknow754389 D June 9, 2025, 10:05 p.m. OK PyPy 3 TESTS 12 452 18124800
323679343 sushmanth.dampur8780 D June 9, 2025, 6:36 p.m. OK PyPy 3-64 TESTS 12 139 27238400
323650632 Sanoy-si D June 9, 2025, 2:43 p.m. OK PyPy 3-64 TESTS 12 140 26521600
323608391 Manish_Jangir D June 9, 2025, 9:32 a.m. OK PyPy 3-64 TESTS 12 140 27136000
323604861 Ihateyounow D June 9, 2025, 9:08 a.m. OK PyPy 3-64 TESTS 12 140 27136000
323674287 Neem_Ko D June 9, 2025, 5:53 p.m. OK PyPy 3-64 TESTS 12 140 27238400
323679680 smz.26 D June 9, 2025, 6:39 p.m. OK PyPy 3-64 TESTS 12 140 30412800
323662626 swayampal_2003 D June 9, 2025, 4:20 p.m. OK PyPy 3-64 TESTS 12 156 27136000
323716829 Om_Singh_ D June 10, 2025, 5:50 a.m. OK PyPy 3-64 TESTS 12 156 29184000
323676004 fawnPersona D June 9, 2025, 6:08 p.m. OK PyPy 3-64 TESTS 12 171 25804800
323607728 Haksell D June 9, 2025, 9:27 a.m. OK PyPy 3-64 TESTS 12 186 27340800
323582988 denisvlasov D June 9, 2025, 5:48 a.m. OK Python 3 TESTS 12 109 26316800
323582194 denisvlasov D June 9, 2025, 5:41 a.m. OK Python 3 TESTS 12 140 26521600
323592061 ayushdreams147 D June 9, 2025, 7:21 a.m. OK Python 3 TESTS 12 155 26726400
323609612 FyReX_KING635 D June 9, 2025, 9:41 a.m. OK Python 3 TESTS 12 155 26931200
323682991 sh.4teen D June 9, 2025, 7:16 p.m. OK Python 3 TESTS 12 171 25088000
323628868 mastacoda D June 9, 2025, 12:05 p.m. OK Python 3 TESTS 12 171 25395200
323678659 nirupamatiitd D June 9, 2025, 6:30 p.m. OK Python 3 TESTS 12 171 26726400
323612875 scorpion D June 9, 2025, 10:04 a.m. OK Python 3 TESTS 12 171 26931200
323706649 pundruvarshith17 D June 10, 2025, 3:42 a.m. OK Python 3 TESTS 12 187 25395200
323610560 ___a_s_1_2___ D June 9, 2025, 9:48 a.m. OK Python 3 TESTS 12 187 26726400
323668009 ramialkawadri D June 9, 2025, 5 p.m. OK Rust 2021 TESTS 12 77 2560000
323714990 PlaceOrientedProgrammer D June 10, 2025, 5:30 a.m. OK Rust 2021 TESTS 12 77 4198400

remove filters

Back to search problems