Codeforces Round 896 (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
1869 Codeforces Round 896 (Div. 2) FINISHED False 9000 37468499 Sept. 10, 2023, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 22330 ) A Make It Zero PROGRAMMING constructive algorithms

B'During Zhongkao examination, Reycloer met an interesting problem, but he cannot come up with a solution immediately. Time is running out! Please help him. Initially, you are given an array a consisting of n ge 2 integers, and you want to change all elements in it to 0 . In one operation, you select two indices l and r ( 1 <= l <= r <= n ) and do the following: You can use the operation above in any order at most 8 times in total. Find a sequence of operations, such that after performing the operations in order, all elements in a are equal to 0 . It can be proven that the solution always exists. The first line of input contains a single integer t ( 1 <= t <= 500 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 100 ) -- the length of the array a . The second line of each test case contains n integers a_1,a_2, ldots,a_n ( 0 <= a_i <= 100 ) -- the elements of the array a . For each test case, in the first line output a single integer k ( 0 <= k <= 8 ) -- the number of operations you use. Then print k lines, in the i -th line output two integers l_i and r_i ( 1 <= l_i <= r_i <= n ) representing that you select l_i and r_i in the i -th operation. Note that you do not have to minimize k . If there are multiple solutions, you may output any of them. In the first test case, since 1 oplus2 oplus3 oplus0=0 , after performing the operation on segment [1,4] , all the elements in the array are equal to 0 . In the second test case, after the first operation, the array becomes equal to [3,1,4,15,15,15,15,6] , after the second operation, the array becomes equal to [0,0,0,0,0,0,0,0] . In the third test case: In the fourth test case, the initial array contains only 0 , so we do not need to perfo'...

Tutorials

Codeforces Round 896 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
222799039 hoakg2000 A Sept. 10, 2023, 4:22 p.m. OK C# 10 TESTS 6 62 2662400
222796839 Avinvini A Sept. 10, 2023, 4:16 p.m. OK C# 10 TESTS 6 62 2867200
222840599 uuuulll A Sept. 11, 2023, 12:58 a.m. OK Clang++17 Diagnostics TESTS 6 171 0
222799742 fugah271202 A Sept. 10, 2023, 4:23 p.m. OK GNU C11 TESTS 6 15 0
222830842 c0derro A Sept. 10, 2023, 9 p.m. OK GNU C11 TESTS 6 31 0
222812133 mathbergsant A Sept. 10, 2023, 5:44 p.m. OK GNU C11 TESTS 6 31 0
222831085 c0derro A Sept. 10, 2023, 9:04 p.m. OK GNU C11 TESTS 6 31 0
222842515 cw_lry A Sept. 11, 2023, 1:41 a.m. OK GNU C++14 TESTS 6 0 0
222848494 Washington2022 A Sept. 11, 2023, 3:41 a.m. OK GNU C++14 TESTS 6 15 0
222844866 Keith.6 A Sept. 11, 2023, 2:28 a.m. OK GNU C++14 TESTS 6 15 0
222844524 KrowFeather A Sept. 11, 2023, 2:21 a.m. OK GNU C++14 TESTS 6 15 0
222844286 zzzjw A Sept. 11, 2023, 2:16 a.m. OK GNU C++14 TESTS 6 15 0
222841483 RongC A Sept. 11, 2023, 1:18 a.m. OK GNU C++14 TESTS 6 15 0
222840847 honey A Sept. 11, 2023, 1:04 a.m. OK GNU C++14 TESTS 6 15 0
222840172 CWzwz A Sept. 11, 2023, 12:48 a.m. OK GNU C++14 TESTS 6 15 0
222839980 huanghongye A Sept. 11, 2023, 12:44 a.m. OK GNU C++14 TESTS 6 15 0
222854753 rsanshu A Sept. 11, 2023, 5:23 a.m. OK GNU C++14 TESTS 6 15 0
222854465 Gaoyx A Sept. 11, 2023, 5:19 a.m. OK GNU C++17 TESTS 6 15 0
222853922 secret___coder A Sept. 11, 2023, 5:11 a.m. OK GNU C++17 TESTS 6 15 0
222853751 mayurkk7 A Sept. 11, 2023, 5:09 a.m. OK GNU C++17 TESTS 6 15 0
222853133 Mahmoud_khattab26 A Sept. 11, 2023, 5:01 a.m. OK GNU C++17 TESTS 6 15 0
222853059 KH_B_SH A Sept. 11, 2023, 4:59 a.m. OK GNU C++17 TESTS 6 15 0
222852970 protons831 A Sept. 11, 2023, 4:58 a.m. OK GNU C++17 TESTS 6 15 0
222855651 imsnto A Sept. 11, 2023, 5:36 a.m. OK GNU C++17 TESTS 6 15 0
222856256 Moksha1729 A Sept. 11, 2023, 5:44 a.m. OK GNU C++17 TESTS 6 15 0
222856374 feiyuH A Sept. 11, 2023, 5:46 a.m. OK GNU C++17 TESTS 6 15 0
222854704 wsy123 A Sept. 11, 2023, 5:22 a.m. OK GNU C++17 TESTS 6 15 0
222848281 shuvocoder2025 A Sept. 11, 2023, 3:37 a.m. OK GNU C++17 (64) TESTS 6 15 0
222856284 sadhukhansubham588 A Sept. 11, 2023, 5:45 a.m. OK GNU C++17 (64) TESTS 6 15 0
222853801 xiangji A Sept. 11, 2023, 5:10 a.m. OK GNU C++17 (64) TESTS 6 15 0
222852826 Alfa A Sept. 11, 2023, 4:56 a.m. OK GNU C++17 (64) TESTS 6 15 0
222850152 MUNISJONI_KHURSHEDJON A Sept. 11, 2023, 4:12 a.m. OK GNU C++17 (64) TESTS 6 15 0
222850004 remon17 A Sept. 11, 2023, 4:09 a.m. OK GNU C++17 (64) TESTS 6 15 0
222847668 FeathBow A Sept. 11, 2023, 3:25 a.m. OK GNU C++17 (64) TESTS 6 15 0
222847613 lotato A Sept. 11, 2023, 3:23 a.m. OK GNU C++17 (64) TESTS 6 15 0
222845216 ZXG_DZXX A Sept. 11, 2023, 2:35 a.m. OK GNU C++17 (64) TESTS 6 15 0
222844142 starrall A Sept. 11, 2023, 2:14 a.m. OK GNU C++17 (64) TESTS 6 15 0
222810112 shakhawat2277 A Sept. 10, 2023, 5:30 p.m. OK GNU C++20 (64) TESTS 6 0 0
222829601 _Hazem_ A Sept. 10, 2023, 8:42 p.m. OK GNU C++20 (64) TESTS 6 0 0
222839261 Linzhixuan A Sept. 11, 2023, 12:28 a.m. OK GNU C++20 (64) TESTS 6 0 0
222839387 Ahmad_Abdullah A Sept. 11, 2023, 12:31 a.m. OK GNU C++20 (64) TESTS 6 0 0
222842103 virinci A Sept. 11, 2023, 1:32 a.m. OK GNU C++20 (64) TESTS 6 0 0
222853208 The-Fourth-Pole A Sept. 11, 2023, 5:02 a.m. OK GNU C++20 (64) TESTS 6 0 102400
222840542 cmk666 A Sept. 11, 2023, 12:56 a.m. OK GNU C++20 (64) TESTS 6 0 512000
222857275 AG___ A Sept. 11, 2023, 5:58 a.m. OK GNU C++20 (64) TESTS 6 15 0
222857661 liyouwen A Sept. 11, 2023, 6:03 a.m. OK GNU C++20 (64) TESTS 6 15 0
222857480 liyouwen A Sept. 11, 2023, 6 a.m. OK GNU C++20 (64) TESTS 6 15 0
222824849 cohadar A Sept. 10, 2023, 7:40 p.m. OK Go TESTS 6 46 614400
222813180 ahmad.mhmd.sakr A Sept. 10, 2023, 5:52 p.m. OK Go TESTS 6 436 2560000
222850321 katomasao A Sept. 11, 2023, 4:15 a.m. OK Haskell TESTS 6 31 0
222827517 pakkapapad A Sept. 10, 2023, 8:13 p.m. OK Java 11 TESTS 6 187 0
222819641 0kie10 A Sept. 10, 2023, 6:45 p.m. OK Java 11 TESTS 6 218 0
222809611 imprakharzz A Sept. 10, 2023, 5:27 p.m. OK Java 11 TESTS 6 218 0
222809198 imprakharzz A Sept. 10, 2023, 5:24 p.m. OK Java 11 TESTS 6 233 0
222816860 creativegiant A Sept. 10, 2023, 6:21 p.m. OK Java 11 TESTS 6 233 0
222842335 biu_biu_biu A Sept. 11, 2023, 1:37 a.m. OK Java 11 TESTS 6 265 0
222850945 aman_deep21 A Sept. 11, 2023, 4:25 a.m. OK Java 11 TESTS 6 296 0
222849701 Priyanshupbh072 A Sept. 11, 2023, 4:05 a.m. OK Java 11 TESTS 6 311 102400
222807656 anonuser A Sept. 10, 2023, 5:16 p.m. OK Java 11 TESTS 6 326 204800
222814368 vijay21 A Sept. 10, 2023, 6:02 p.m. OK Java 11 TESTS 6 327 204800
222813073 vaibhav_1710 A Sept. 10, 2023, 5:51 p.m. OK Java 17 TESTS 6 186 102400
222816137 mangos194 A Sept. 10, 2023, 6:16 p.m. OK Java 17 TESTS 6 202 512000
222812123 mangos194 A Sept. 10, 2023, 5:44 p.m. OK Java 17 TESTS 6 202 716800
222844343 ShresCodes A Sept. 11, 2023, 2:17 a.m. OK Java 17 TESTS 6 218 307200
222818063 mangos194 A Sept. 10, 2023, 6:31 p.m. OK Java 17 TESTS 6 218 512000
222829077 Rgrt A Sept. 10, 2023, 8:34 p.m. OK Java 17 TESTS 6 218 819200
222809408 sahil.dhiman03022001 A Sept. 10, 2023, 5:26 p.m. OK Java 17 TESTS 6 218 1024000
222810444 mangos194 A Sept. 10, 2023, 5:32 p.m. OK Java 17 TESTS 6 233 819200
222817778 ak959 A Sept. 10, 2023, 6:29 p.m. OK Java 17 TESTS 6 280 819200
222839964 rahiljakir A Sept. 11, 2023, 12:44 a.m. OK Java 17 TESTS 6 296 921600
222826470 sary-bala A Sept. 10, 2023, 8 p.m. OK Java 8 TESTS 6 93 0
222855978 Nanthakumar06 A Sept. 11, 2023, 5:41 a.m. OK Java 8 TESTS 6 109 0
222796388 Eslam_Ahmed A Sept. 10, 2023, 4:15 p.m. OK Java 8 TESTS 6 109 0
222854540 Kmoulyprasanna A Sept. 11, 2023, 5:20 a.m. OK Java 8 TESTS 6 124 0
222852633 yaminiv A Sept. 11, 2023, 4:52 a.m. OK Java 8 TESTS 6 124 0
222810667 prashanth_rebala A Sept. 10, 2023, 5:34 p.m. OK Java 8 TESTS 6 124 0
222803504 gyani1088 A Sept. 10, 2023, 4:32 p.m. OK Java 8 TESTS 6 139 0
222818113 Sumitsingh7 A Sept. 10, 2023, 6:32 p.m. OK Java 8 TESTS 6 155 5939200
222854357 amit_roy A Sept. 11, 2023, 5:17 a.m. OK Java 8 TESTS 6 171 0
222845819 icebean A Sept. 11, 2023, 2:47 a.m. OK Java 8 TESTS 6 186 0
222822683 sarakasara A Sept. 10, 2023, 7:17 p.m. OK MS C++ 2017 TESTS 6 46 0
222815452 Iseeuinmyd A Sept. 10, 2023, 6:10 p.m. OK MS C++ 2017 TESTS 6 46 0
222815544 Iseeuinmyd A Sept. 10, 2023, 6:11 p.m. OK MS C++ 2017 TESTS 6 61 0
222815418 Iseeuinmyd A Sept. 10, 2023, 6:10 p.m. OK MS C++ 2017 TESTS 6 62 0
222827762 A_G A Sept. 10, 2023, 8:16 p.m. OK Perl TESTS 6 15 0
222818681 jvatsal0709 A Sept. 10, 2023, 6:37 p.m. OK PyPy 3 TESTS 6 124 4096000
222812532 Bleeding_steel A Sept. 10, 2023, 5:47 p.m. OK PyPy 3 TESTS 6 124 4608000
222809039 WalrusRamen21 A Sept. 10, 2023, 5:23 p.m. OK PyPy 3 TESTS 6 155 4198400
222811789 Bleeding_steel A Sept. 10, 2023, 5:42 p.m. OK PyPy 3 TESTS 6 171 4608000
222854705 thota_chinmai A Sept. 11, 2023, 5:22 a.m. OK PyPy 3 TESTS 6 186 6041600
222801033 Vegasus A Sept. 10, 2023, 4:27 p.m. OK PyPy 3 TESTS 6 186 6041600
222842217 niketagarwal653 A Sept. 11, 2023, 1:34 a.m. OK PyPy 3 TESTS 6 202 6758400
222826241 A_G A Sept. 10, 2023, 7:57 p.m. OK PyPy 3-64 TESTS 6 62 3584000
222826173 A_G A Sept. 10, 2023, 7:56 p.m. OK PyPy 3-64 TESTS 6 62 3584000
222821754 rmr A Sept. 10, 2023, 7:07 p.m. OK PyPy 3-64 TESTS 6 77 3584000
222821545 rmr A Sept. 10, 2023, 7:05 p.m. OK PyPy 3-64 TESTS 6 77 5017600
222850805 MdAshrafuzzaman_Sunny02 A Sept. 11, 2023, 4:23 a.m. OK PyPy 3-64 TESTS 6 78 6246400
222829109 injust A Sept. 10, 2023, 8:35 p.m. OK PyPy 3-64 TESTS 6 92 5632000
222819765 Abu-Haithem A Sept. 10, 2023, 6:47 p.m. OK PyPy 3-64 TESTS 6 93 6041600
222846219 MdAbedin A Sept. 11, 2023, 2:56 a.m. OK PyPy 3-64 TESTS 6 93 6246400
222817530 ganta.jashu A Sept. 10, 2023, 6:27 p.m. OK PyPy 3-64 TESTS 6 93 6348800
222824233 whatshisbucket A Sept. 10, 2023, 7:34 p.m. OK PyPy 3-64 TESTS 6 93 6656000
222824509 alexpods A Sept. 10, 2023, 7:36 p.m. OK Python 3 TESTS 6 31 0
222823571 alexpods A Sept. 10, 2023, 7:26 p.m. OK Python 3 TESTS 6 31 0
222802092 kashapoV A Sept. 10, 2023, 4:29 p.m. OK Python 3 TESTS 6 31 0
222818052 Shakilkhan A Sept. 10, 2023, 6:31 p.m. OK Python 3 TESTS 6 31 512000
222854600 sujan_21 A Sept. 11, 2023, 5:21 a.m. OK Python 3 TESTS 6 46 0
222853476 betaboomer A Sept. 11, 2023, 5:05 a.m. OK Python 3 TESTS 6 46 0
222850297 upwarder1 A Sept. 11, 2023, 4:14 a.m. OK Python 3 TESTS 6 46 0
222848270 AnOldMan A Sept. 11, 2023, 3:37 a.m. OK Python 3 TESTS 6 46 0
222846294 sawvik.dipto10 A Sept. 11, 2023, 2:57 a.m. OK Python 3 TESTS 6 46 0
222844295 chakriyvs A Sept. 11, 2023, 2:16 a.m. OK Python 3 TESTS 6 46 0
222846452 gr8den A Sept. 11, 2023, 3:01 a.m. OK Rust 2021 TESTS 6 15 0

remove filters

Back to search problems