Codeforces Round 908 (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
1894 Codeforces Round 908 (Div. 2) FINISHED False 7200 32455499 Nov. 7, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16070 ) B Two Out of Three PROGRAMMING constructive algorithms

B'You are given an array a_1, a_2, ldots, a_n . You need to find an array b_1, b_2, ldots, b_n consisting of numbers 1 , 2 , 3 such that exactly two out of the following three conditions are satisfied: If such an array does not exist, you should report it. Each test contains multiple test cases. The first line contains a single integer t (1 <= q t <= q 500) -- the number of test cases. Each test case is described as follows. The first line of each test case contains an integer n (1 <= q n <= q 100) -- the length of the array a . The second line of each test case contains n integers a_1, a_2, ldots, a_n (1 <= q a_i <= q 100) -- the elements of the array a . For each test case, print -1 if there is no solution. Otherwise, print b_1, b_2, ldots, b_n -- an array consisting of numbers 1 , 2 , 3 that satisfies exactly two out of three conditions. If there are multiple possible answers, you can print any of them. In the first test case, b = [1, 2, 3, 1, 1, 1] satisfies condition 1 because for i = 4 , j = 2 : a_i = a_j , b_i = 1 , and b_j = 2 . It also satisfies condition 2 because for i = 6 , j = 3 : a_i = a_j , b_i = 1 , and b_j = 3 . However, it does not satisfy condition 3 . In total, exactly two out of three conditions are satisfied. '...

Tutorials

Codeforces Round 908 (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
231802411 DIOrite B Nov. 7, 2023, 4:22 p.m. OK C# 10 TESTS 4 46 3481600
231807477 Mahmoud_Medhat2002 B Nov. 7, 2023, 4:25 p.m. OK C# 10 TESTS 4 171 4096000
231869655 bluemegane B Nov. 8, 2023, 12:44 a.m. OK C# 8 TESTS 4 77 2969600
231850746 2021331001 B Nov. 7, 2023, 7:59 p.m. OK Clang++17 Diagnostics TESTS 4 467 1126400
231859973 ReCRuS B Nov. 7, 2023, 8:57 p.m. OK Clang++17 Diagnostics TESTS 4 826 7372800
231827126 __coffee__ B Nov. 7, 2023, 5:08 p.m. OK Clang++20 Diagnostics TESTS 4 296 5222400
231787384 Nick2048 B Nov. 7, 2023, 4:07 p.m. OK D TESTS 4 31 1945600
231843250 eastnman B Nov. 7, 2023, 7:02 p.m. OK FPC TESTS 4 140 512000
231849072 sp_mehedi B Nov. 7, 2023, 7:38 p.m. OK GNU C11 TESTS 4 202 0
231789622 Nahian95 B Nov. 7, 2023, 4:13 p.m. OK GNU C11 TESTS 4 202 0
231825471 fast_learner_aadi B Nov. 7, 2023, 5:01 p.m. OK GNU C11 TESTS 4 202 0
231829777 ChiyoYuki_if B Nov. 7, 2023, 5:24 p.m. OK GNU C11 TESTS 4 202 409600
231873234 Arsud B Nov. 8, 2023, 1:59 a.m. OK GNU C11 TESTS 4 218 0
231818394 shaunak81 B Nov. 7, 2023, 4:33 p.m. OK GNU C11 TESTS 4 218 0
231788656 gugugu. B Nov. 7, 2023, 4:11 p.m. OK GNU C11 TESTS 4 233 0
231789181 tlw B Nov. 7, 2023, 4:12 p.m. OK GNU C11 TESTS 4 405 0
231791162 Piper_ B Nov. 7, 2023, 4:18 p.m. OK GNU C++14 TESTS 4 15 0
231788989 jielosc B Nov. 7, 2023, 4:11 p.m. OK GNU C++14 TESTS 4 15 0
231798264 slappy B Nov. 7, 2023, 4:18 p.m. OK GNU C++14 TESTS 4 15 0
231818175 xyhuuz B Nov. 7, 2023, 4:32 p.m. OK GNU C++14 TESTS 4 15 0
231865513 omeganot B Nov. 7, 2023, 10:50 p.m. OK GNU C++14 TESTS 4 15 0
231868283 taochuxia B Nov. 8, 2023, 12:13 a.m. OK GNU C++14 TESTS 4 15 0
231868518 bjbs B Nov. 8, 2023, 12:18 a.m. OK GNU C++14 TESTS 4 15 0
231876689 mdshakib2003. B Nov. 8, 2023, 2:58 a.m. OK GNU C++14 TESTS 4 15 0
231877711 asfsoodsa12 B Nov. 8, 2023, 3:12 a.m. OK GNU C++14 TESTS 4 15 0
231886971 jay363 B Nov. 8, 2023, 5:30 a.m. OK GNU C++14 TESTS 4 15 0
231837361 maksudul B Nov. 7, 2023, 6:24 p.m. OK GNU C++17 TESTS 4 0 0
231849707 NoxProgrammer B Nov. 7, 2023, 7:46 p.m. OK GNU C++17 TESTS 4 0 102400
231839596 genakol B Nov. 7, 2023, 6:46 p.m. OK GNU C++17 TESTS 4 15 0
231835571 ashraful9194 B Nov. 7, 2023, 6:08 p.m. OK GNU C++17 TESTS 4 15 0
231860856 Wolowitz B Nov. 7, 2023, 9:11 p.m. OK GNU C++17 TESTS 4 15 0
231836386 Forestmy17 B Nov. 7, 2023, 6:15 p.m. OK GNU C++17 TESTS 4 15 0
231884202 Tarnished_ B Nov. 8, 2023, 4:50 a.m. OK GNU C++17 TESTS 4 15 0
231883445 Rishikesh_Reddy_ B Nov. 8, 2023, 4:38 a.m. OK GNU C++17 TESTS 4 15 0
231877249 ErrorMaker. B Nov. 8, 2023, 3:06 a.m. OK GNU C++17 TESTS 4 15 0
231870693 i_am_rusher B Nov. 8, 2023, 1:06 a.m. OK GNU C++17 TESTS 4 15 0
231869169 Pointy B Nov. 8, 2023, 12:34 a.m. OK GNU C++17 (64) TESTS 4 0 0
231865987 Qg5 B Nov. 7, 2023, 11:03 p.m. OK GNU C++17 (64) TESTS 4 0 102400
231876711 FangYifan B Nov. 8, 2023, 2:58 a.m. OK GNU C++17 (64) TESTS 4 15 0
231885364 hskyr- B Nov. 8, 2023, 5:07 a.m. OK GNU C++17 (64) TESTS 4 15 0
231882786 imsuck12 B Nov. 8, 2023, 4:28 a.m. OK GNU C++17 (64) TESTS 4 15 0
231877997 JustA7 B Nov. 8, 2023, 3:17 a.m. OK GNU C++17 (64) TESTS 4 15 0
231877645 y_combinator B Nov. 8, 2023, 3:11 a.m. OK GNU C++17 (64) TESTS 4 15 0
231875686 Fakedreamer B Nov. 8, 2023, 2:40 a.m. OK GNU C++17 (64) TESTS 4 15 0
231875382 BODH B Nov. 8, 2023, 2:35 a.m. OK GNU C++17 (64) TESTS 4 15 0
231871659 wuyin331 B Nov. 8, 2023, 1:33 a.m. OK GNU C++17 (64) TESTS 4 15 0
231843563 ashu_2004 B Nov. 7, 2023, 7:06 p.m. OK GNU C++20 (64) TESTS 4 0 0
231877245 Kofler B Nov. 8, 2023, 3:06 a.m. OK GNU C++20 (64) TESTS 4 0 0
231875069 Nefelibata__ B Nov. 8, 2023, 2:30 a.m. OK GNU C++20 (64) TESTS 4 0 0
231788739 msp_008987 B Nov. 7, 2023, 4:11 p.m. OK GNU C++20 (64) TESTS 4 0 0
231790082 virinci B Nov. 7, 2023, 4:14 p.m. OK GNU C++20 (64) TESTS 4 0 0
231838519 Black_Boss B Nov. 7, 2023, 6:34 p.m. OK GNU C++20 (64) TESTS 4 0 0
231840425 ErenYeagar B Nov. 7, 2023, 6:55 p.m. OK GNU C++20 (64) TESTS 4 0 0
231871402 AC.12 B Nov. 8, 2023, 1:20 a.m. OK GNU C++20 (64) TESTS 4 0 409600
231877871 yshpdyt B Nov. 8, 2023, 3:15 a.m. OK GNU C++20 (64) TESTS 4 0 4812800
231889305 einekleine17 B Nov. 8, 2023, 5:58 a.m. OK GNU C++20 (64) TESTS 4 15 0
231803771 vs256 B Nov. 7, 2023, 4:23 p.m. OK Go TESTS 4 31 4915200
231832564 TCchen B Nov. 7, 2023, 5:43 p.m. OK Java 11 TESTS 4 202 0
231790872 yeah-boy B Nov. 7, 2023, 4:17 p.m. OK Java 11 TESTS 4 202 0
231838887 anonuser B Nov. 7, 2023, 6:38 p.m. OK Java 11 TESTS 4 405 307200
231789724 prog-student B Nov. 7, 2023, 4:13 p.m. OK Java 11 TESTS 4 405 716800
231830358 goldener B Nov. 7, 2023, 5:27 p.m. OK Java 11 TESTS 4 420 512000
231786521 sanjanapinjarla B Nov. 7, 2023, 4:05 p.m. OK Java 11 TESTS 4 420 819200
231840409 vishesh9096 B Nov. 7, 2023, 6:55 p.m. OK Java 11 TESTS 4 421 307200
231815707 prerna26 B Nov. 7, 2023, 4:27 p.m. OK Java 11 TESTS 4 436 512000
231785851 Dobrii_Gnoms_Father B Nov. 7, 2023, 4:03 p.m. OK Java 11 TESTS 4 451 614400
231808870 Samhitha_13 B Nov. 7, 2023, 4:25 p.m. OK Java 11 TESTS 4 452 614400
231815897 mehrotramanvendra B Nov. 7, 2023, 4:27 p.m. OK Java 17 TESTS 4 187 1024000
231888140 Prime369 B Nov. 8, 2023, 5:44 a.m. OK Java 17 TESTS 4 218 1024000
231863110 Harwinvanak B Nov. 7, 2023, 9:51 p.m. OK Java 17 TESTS 4 233 716800
231868670 fightingxjz B Nov. 8, 2023, 12:22 a.m. OK Java 17 TESTS 4 265 1331200
231827738 thisis_mahyar B Nov. 7, 2023, 5:12 p.m. OK Java 17 TESTS 4 312 1126400
231862461 rohitshee92 B Nov. 7, 2023, 9:39 p.m. OK Java 17 TESTS 4 374 1740800
231840013 VanshBlade B Nov. 7, 2023, 6:51 p.m. OK Java 17 TESTS 4 405 819200
231785506 patelcodeforces B Nov. 7, 2023, 4:02 p.m. OK Java 17 TESTS 4 405 1228800
231801480 codeanand17 B Nov. 7, 2023, 4:20 p.m. OK Java 17 TESTS 4 436 1331200
231815654 Tocoung B Nov. 7, 2023, 4:26 p.m. OK Java 17 TESTS 4 451 1024000
231871509 Ligh0x74 B Nov. 8, 2023, 1:22 a.m. OK Java 21 TESTS 4 218 512000
231788298 sventeen1 B Nov. 7, 2023, 4:10 p.m. OK Java 21 TESTS 4 420 409600
231785980 Satish_Rathod_ B Nov. 7, 2023, 4:03 p.m. OK Java 21 TESTS 4 436 1024000
231880465 wdjuruo B Nov. 8, 2023, 3:56 a.m. OK Java 21 TESTS 4 467 921600
231826503 s2110676154 B Nov. 7, 2023, 5:05 p.m. OK Java 21 TESTS 4 499 716800
231786361 arihant.18 B Nov. 7, 2023, 4:04 p.m. OK Java 21 TESTS 4 514 1228800
231785475 madhanirahul92 B Nov. 7, 2023, 4:02 p.m. OK Java 21 TESTS 4 530 1331200
231789977 V0ice B Nov. 7, 2023, 4:14 p.m. OK Java 21 TESTS 4 545 1331200
231789275 clcwcxfwf B Nov. 7, 2023, 4:12 p.m. OK Java 8 TESTS 4 108 0
231848696 Akarsh2810 B Nov. 7, 2023, 7:33 p.m. OK Java 8 TESTS 4 124 0
231847327 Akarsh2810 B Nov. 7, 2023, 7:29 p.m. OK Java 8 TESTS 4 124 0
231789129 himanshubhardwaj169 B Nov. 7, 2023, 4:12 p.m. OK Java 8 TESTS 4 124 0
231804998 mohamedhassan_c B Nov. 7, 2023, 4:24 p.m. OK Java 8 TESTS 4 124 6758400
231880367 yvbf B Nov. 8, 2023, 3:55 a.m. OK Java 8 TESTS 4 170 0
231839344 devesh434 B Nov. 7, 2023, 6:43 p.m. OK Java 8 TESTS 4 233 0
231878837 jitu7033 B Nov. 8, 2023, 3:30 a.m. OK Java 8 TESTS 4 249 0
231787628 applezk B Nov. 7, 2023, 4:08 p.m. OK Java 8 TESTS 4 296 0
231839369 Sumitsingh7 B Nov. 7, 2023, 6:44 p.m. OK Java 8 TESTS 4 296 6656000
231785970 PolarisJing B Nov. 7, 2023, 4:03 p.m. OK MS C++ 2017 TESTS 4 31 0
231815412 CC_dsm B Nov. 7, 2023, 4:26 p.m. OK MS C++ 2017 TESTS 4 46 0
231789047 Twoliges B Nov. 7, 2023, 4:12 p.m. OK MS C++ 2017 TESTS 4 61 0
231843912 ivan.812 B Nov. 7, 2023, 7:10 p.m. OK MS C++ 2017 TESTS 4 62 0
231837506 baloomba B Nov. 7, 2023, 6:25 p.m. OK MS C++ 2017 TESTS 4 62 0
231802123 alone_gifted B Nov. 7, 2023, 4:22 p.m. OK MS C++ 2017 TESTS 4 62 0
231791113 NajlSadek B Nov. 7, 2023, 4:17 p.m. OK MS C++ 2017 TESTS 4 62 0
231789890 breevandekamp B Nov. 7, 2023, 4:14 p.m. OK MS C++ 2017 TESTS 4 62 0
231786329 payal_27 B Nov. 7, 2023, 4:04 p.m. OK MS C++ 2017 TESTS 4 62 0
231888111 Ravitosh B Nov. 8, 2023, 5:44 a.m. OK MS C++ 2017 TESTS 4 78 0
231870770 chinesedfan B Nov. 8, 2023, 1:08 a.m. OK Node.js TESTS 4 109 4812800
231802416 Underground_Evo B Nov. 7, 2023, 4:22 p.m. OK PHP TESTS 4 46 0
231865611 DRDIV B Nov. 7, 2023, 10:53 p.m. OK PyPy 3 TESTS 4 124 3788800
231828749 hxu10 B Nov. 7, 2023, 5:18 p.m. OK PyPy 3 TESTS 4 124 6860800
231829895 jvatsal0709 B Nov. 7, 2023, 5:24 p.m. OK PyPy 3 TESTS 4 140 6758400
231835050 Mdt18 B Nov. 7, 2023, 6:03 p.m. OK PyPy 3 TESTS 4 187 6144000
231802402 seeforty4040 B Nov. 7, 2023, 4:22 p.m. OK PyPy 3 TESTS 4 249 8499200
231804990 chinhhoangmanutd20nam B Nov. 7, 2023, 4:24 p.m. OK PyPy 3 TESTS 4 265 9728000
231886057 maoxiang B Nov. 8, 2023, 5:16 a.m. OK PyPy 3 TESTS 4 280 8806400
231838221 rmr B Nov. 7, 2023, 6:31 p.m. OK PyPy 3-64 TESTS 4 77 3481600
231879869 stalkmarket B Nov. 8, 2023, 3:47 a.m. OK PyPy 3-64 TESTS 4 77 4812800
231838061 rmr B Nov. 7, 2023, 6:30 p.m. OK PyPy 3-64 TESTS 4 92 3686400
231839948 zouyu9631 B Nov. 7, 2023, 6:50 p.m. OK PyPy 3-64 TESTS 4 93 5324800
231802362 yy174 B Nov. 7, 2023, 4:22 p.m. OK PyPy 3-64 TESTS 4 93 9523200
231784769 kurony B Nov. 7, 2023, 4 p.m. OK PyPy 3-64 TESTS 4 108 7782400
231830099 MenaceJn B Nov. 7, 2023, 5:25 p.m. OK PyPy 3-64 TESTS 4 108 9420800
231785960 plato_001 B Nov. 7, 2023, 4:03 p.m. OK PyPy 3-64 TESTS 4 124 6041600
231870345 Yansou B Nov. 8, 2023, 12:59 a.m. OK PyPy 3-64 TESTS 4 124 6451200
231785430 kidus72 B Nov. 7, 2023, 4:02 p.m. OK PyPy 3-64 TESTS 4 124 9318400
231886386 gzthomashuang B Nov. 8, 2023, 5:21 a.m. OK Python 3 TESTS 4 46 819200
231788880 Edison_H B Nov. 7, 2023, 4:11 p.m. OK Python 3 TESTS 4 61 0
231870155 Schichow B Nov. 8, 2023, 12:55 a.m. OK Python 3 TESTS 4 61 307200
231824565 kimsaeron B Nov. 7, 2023, 4:57 p.m. OK Python 3 TESTS 4 62 0
231807373 saidi_007 B Nov. 7, 2023, 4:24 p.m. OK Python 3 TESTS 4 62 0
231790332 Brash_Ketchup B Nov. 7, 2023, 4:15 p.m. OK Python 3 TESTS 4 62 0
231788065 CMRIT25_21R01A7309 B Nov. 7, 2023, 4:09 p.m. OK Python 3 TESTS 4 62 0
231876098 Suzukazee B Nov. 8, 2023, 2:48 a.m. OK Python 3 TESTS 4 77 0
231823880 M7mdOdeh B Nov. 7, 2023, 4:55 p.m. OK Python 3 TESTS 4 77 102400
231806375 Salomon_006 B Nov. 7, 2023, 4:24 p.m. OK Python 3 TESTS 4 77 1024000
231818372 shashankkathuroju B Nov. 7, 2023, 4:33 p.m. OK Ruby 3 TESTS 4 421 512000
231803887 gr8den B Nov. 7, 2023, 4:23 p.m. OK Rust 2021 TESTS 4 15 409600
231794102 ReZero___ B Nov. 7, 2023, 4:18 p.m. OK Rust 2021 TESTS 4 15 512000
231887242 NotSpaceBoy B Nov. 8, 2023, 5:33 a.m. OK Rust 2021 TESTS 4 31 512000

remove filters

Back to search problems