Codeforces Round 1021 (Div. 1)

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
2097 Codeforces Round 1021 (Div. 1) FINISHED False 10800 30749123 April 26, 2025, 8:35 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 8490 ) A Sports Betting PROGRAMMING math sortings

The boarding process for various flights can occur in different ways: either by bus or through a telescopic jet bridge . Every day, exactly one flight is made from St. Petersburg to Minsk, and Vadim decided to demonstrate to the students that he always knows in advance how the boarding will take place. Vadim made a bet with (n) students, and with the (i)-th student, he made a bet on day (a_i). Vadim wins the bet if he correctly predicts the boarding process on both day (a_i+1) and day (a_i+2). Although Vadim does not know in advance how the boarding will occur, he really wants to win the bet at least with one student and convince him of his predictive abilities. Check if there exists a strategy for Vadim that allows him to guarantee success. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1 \le n \le 10^5)) — the number of students Vadim made bets with. The second line of each test case contains (n) integers (a_1, \ldots, a_n) ((1 \le a_i \le 10^9)) — the days on which Vadim made bets with the students. It is guaranteed that the sum of (n) over all test cases does not exceed (10^5). For each test case, output " Yes " (without quotes) if Vadim can guarantee convincing at least one student, 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 the first test case, Vadim needs to make at least one correct prediction about the boarding process on the second and third days. There are a total of (4) possible boarding scenarios for these days, so Vadim can give all (4) students different predictions and guarantee that at least one of them will be correct. In the second test case, Vadim only made be

Tutorials

142316

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
317336826 og.kostya A April 26, 2025, 12:56 p.m. OK C# 10 TESTS 24 109 2252800
317284013 while_zeze A April 26, 2025, 8:45 a.m. OK C++17 (GCC 7-32) TESTS 24 62 921600
317383626 gentlecoder29 A April 26, 2025, 7:46 p.m. OK C++17 (GCC 7-32) TESTS 25 77 0
317364031 AlRntn A April 26, 2025, 5:04 p.m. OK C++17 (GCC 7-32) TESTS 24 77 102400
317283582 Morphed A April 26, 2025, 8:44 a.m. OK C++17 (GCC 7-32) TESTS 24 77 409600
317285056 BB13 A April 26, 2025, 8:47 a.m. OK C++17 (GCC 7-32) TESTS 24 78 0
317285592 Wielomian A April 26, 2025, 8:49 a.m. OK C++17 (GCC 7-32) TESTS 24 93 0
317285266 weebyes A April 26, 2025, 8:48 a.m. OK C++17 (GCC 7-32) TESTS 24 93 0
317284558 SpinSpen A April 26, 2025, 8:46 a.m. OK C++17 (GCC 7-32) TESTS 24 93 0
317284201 panospask A April 26, 2025, 8:45 a.m. OK C++17 (GCC 7-32) TESTS 24 93 0
317283892 amsraman A April 26, 2025, 8:45 a.m. OK C++17 (GCC 7-32) TESTS 24 93 0
317410966 fazliddin2001 A April 27, 2025, 4:55 a.m. OK C++20 (GCC 13-64) TESTS 25 62 102400
317393613 svinoxx A April 26, 2025, 9:36 p.m. OK C++20 (GCC 13-64) TESTS 25 62 102400
317346108 tdiv A April 26, 2025, 2:09 p.m. OK C++20 (GCC 13-64) TESTS 24 62 819200
317346371 sh1ziku A April 26, 2025, 2:11 p.m. OK C++20 (GCC 13-64) TESTS 24 77 0
317333817 5am__Arpit A April 26, 2025, 12:34 p.m. OK C++20 (GCC 13-64) TESTS 24 77 0
317284931 kwoncycle A April 26, 2025, 8:47 a.m. OK C++20 (GCC 13-64) TESTS 24 77 0
317345817 Nameless_Mist A April 26, 2025, 2:06 p.m. OK C++20 (GCC 13-64) TESTS 24 77 102400
317342606 zzzrrrccc A April 26, 2025, 1:40 p.m. OK C++20 (GCC 13-64) TESTS 24 77 102400
317288067 prins A April 26, 2025, 8:55 a.m. OK C++20 (GCC 13-64) TESTS 24 77 102400
317285637 cockatooo_2025GM A April 26, 2025, 8:49 a.m. OK C++20 (GCC 13-64) TESTS 24 77 102400
317330929 FzArK A April 26, 2025, 12:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 0
317409965 Nathan4 A April 27, 2025, 4:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 25 62 102400
317333229 N_z__ A April 26, 2025, 12:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 204800
317286786 MarcosK A April 26, 2025, 8:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 0
317283666 Dalek_of_Rivia A April 26, 2025, 8:44 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 0
317396559 enslaved A April 26, 2025, 10:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 77 102400
317344846 KnahG A April 26, 2025, 1:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 102400
317324194 Noam527 A April 26, 2025, 11:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 102400
317293313 Piashy A April 26, 2025, 9:13 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 102400
317284380 iridescent_1024 A April 26, 2025, 8:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 102400
317288494 hos.lyric A April 26, 2025, 8:57 a.m. OK D TESTS 24 139 2560000
317286187 Gassa A April 26, 2025, 8:50 a.m. OK D TESTS 24 140 2969600
317284375 pengin_2000 A April 26, 2025, 8:46 a.m. OK GNU C11 TESTS 24 92 921600
317367018 ahmedafeef A April 26, 2025, 5:31 p.m. OK GNU C11 TESTS 24 1296 4710400
317333582 Transformer911 A April 26, 2025, 12:32 p.m. OK Go TESTS 24 140 5632000
317280008 CyntaxError A April 26, 2025, 8:38 a.m. OK Java 21 TESTS 24 296 716800
317399262 johnfkennedy123 A April 26, 2025, 11:51 p.m. OK Java 21 TESTS 25 359 3993600
317290061 DarLam A April 26, 2025, 9:02 a.m. OK Java 21 TESTS 24 374 1638400
317340555 Jai_Yadav_ A April 26, 2025, 1:25 p.m. OK Java 21 TESTS 24 389 7270400
317410238 Master_Shifu46 A April 27, 2025, 4:39 a.m. OK Java 21 TESTS 25 405 4812800
317363625 Aaditysa01sehgal A April 26, 2025, 5 p.m. OK Java 21 TESTS 24 499 1638400
317284151 arnabmanna A April 26, 2025, 8:45 a.m. OK Java 8 TESTS 24 296 2764800
317286693 elizarov A April 26, 2025, 8:52 a.m. OK Kotlin 1.9 TESTS 24 374 10547200
317285923 SPD_9X2 A April 26, 2025, 8:50 a.m. OK PyPy 3 TESTS 24 312 12902400
317405916 some_times A April 27, 2025, 2:58 a.m. OK PyPy 3-64 TESTS 25 156 19353600
317283645 smilences A April 26, 2025, 8:44 a.m. OK PyPy 3-64 TESTS 24 171 14028800
317286469 tassei903 A April 26, 2025, 8:51 a.m. OK PyPy 3-64 TESTS 24 171 14950400
317281432 teekaytai A April 26, 2025, 8:40 a.m. OK PyPy 3-64 TESTS 24 171 18329600
317285767 kavorka A April 26, 2025, 8:49 a.m. OK PyPy 3-64 TESTS 24 186 17510400
317284081 Z_actuary A April 26, 2025, 8:45 a.m. OK PyPy 3-64 TESTS 24 186 18227200
317286370 Mukundan314 A April 26, 2025, 8:51 a.m. OK PyPy 3-64 TESTS 24 187 13824000
317359608 dyppp A April 26, 2025, 4:20 p.m. OK PyPy 3-64 TESTS 24 187 16998400
317291806 chinerist A April 26, 2025, 9:08 a.m. OK PyPy 3-64 TESTS 24 187 18944000
317282905 LMeyling A April 26, 2025, 8:43 a.m. OK PyPy 3-64 TESTS 24 217 16998400
317331352 shashanksp851 A April 26, 2025, 12:17 p.m. OK Python 3 TESTS 24 155 12288000
317365292 DeepShtorm A April 26, 2025, 5:16 p.m. OK Python 3 TESTS 24 186 13516800
317287281 shade34 A April 26, 2025, 8:53 a.m. OK Python 3 TESTS 24 186 13516800
317288490 kingmoshe A April 26, 2025, 8:57 a.m. OK Python 3 TESTS 24 281 26419200
317404918 JakeMate14 A April 27, 2025, 2:34 a.m. OK Rust 2021 TESTS 25 62 1843200
317296753 Dpkasd_12 A April 26, 2025, 9:25 a.m. OK Rust 2021 TESTS 24 77 2355200
317283973 null_lambda A April 26, 2025, 8:45 a.m. OK Rust 2021 TESTS 24 108 102400
317285070 darkkcyan A April 26, 2025, 8:48 a.m. OK Rust 2021 TESTS 24 124 7680000
317281440 DanielAnker A April 26, 2025, 8:40 a.m. OK Rust 2021 TESTS 24 140 1228800

remove filters

Back to search problems