Codeforces Round 941 (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
1965 Codeforces Round 941 (Div. 1) FINISHED False 7200 22951463 April 27, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14264 ) A Everything Nim PROGRAMMING games greedy math sortings 1400

B'Alice and Bob are playing a game on n piles of stones. On each player 's turn, they select a positive integer k that is at most the size of the smallest nonempty pile and remove k stones from each nonempty pile at once. The first player who is unable to make a move (because all piles are empty) loses. Given that Alice goes first, who will win the game if both players play optimally? The first line of the input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of piles in the game. The next line of each test case contains n integers a_1, a_2, ldots a_n ( 1 <= a_i <= 10^9 ), where a_i is the initial number of stones in the i -th pile. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print a single line with the name of the winner, assuming both players play optimally. If Alice wins, print "Alice", otherwise print "Bob" (without quotes). In the first test case, Alice can win by choosing k=3 on her first turn, which will empty all of the piles at once. In the second test case, Alice must choose k=1 on her first turn since there is a pile of size 1 , so Bob can win on the next turn by choosing k=6 . '...

Tutorials

Codeforces Round #941 (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
259620340 loop42 A May 5, 2024, 10:46 a.m. OK C# 10 TESTS 44 155 15872000 1400
259616364 loop42 A May 5, 2024, 10:09 a.m. OK C# 10 TESTS 44 155 15872000 1400
258422863 mban259 A April 27, 2024, 2:46 p.m. OK C# 10 TESTS 42 187 23552000 1400
262866562 qwqazxcrgbygvujijn A May 27, 2024, 10:48 a.m. OK C++14 (GCC 6-32) TESTS 44 93 819200 1400
261488512 Wind_Walker A May 18, 2024, 8:16 a.m. OK C++14 (GCC 6-32) TESTS 44 93 1228800 1400
260506768 TG178X A May 11, 2024, 7:53 a.m. OK C++14 (GCC 6-32) TESTS 44 93 1638400 1400
260084091 Tuli_93 A May 9, 2024, 7:13 a.m. OK C++14 (GCC 6-32) TESTS 44 108 0 1400
258508609 Swing1 A April 28, 2024, 3:44 a.m. OK C++14 (GCC 6-32) TESTS 42 108 0 1400
260021296 surroundedcity A May 8, 2024, 3:44 p.m. OK C++14 (GCC 6-32) TESTS 44 108 819200 1400
259970210 tkswls A May 8, 2024, 8:26 a.m. OK C++14 (GCC 6-32) TESTS 44 108 819200 1400
258418725 StarSilk A April 27, 2024, 2:39 p.m. OK C++14 (GCC 6-32) TESTS 42 108 819200 1400
258698982 juan.yeesha A April 29, 2024, 1:51 p.m. OK C++14 (GCC 6-32) TESTS 42 108 1638400 1400
261160781 luogu_bot1 A May 16, 2024, 7:51 a.m. OK C++14 (GCC 6-32) TESTS 44 108 3993600 1400
258483034 Ferrriccc A April 27, 2024, 7:15 p.m. OK C++17 (GCC 7-32) TESTS 42 77 307200 1400
262631885 nathanDuncan A May 25, 2024, 11:54 p.m. OK C++17 (GCC 7-32) TESTS 44 93 0 1400
260809286 huanhuanonly A May 13, 2024, 2 p.m. OK C++17 (GCC 7-32) TESTS 44 93 0 1400
260243565 unnati_dutt A May 10, 2024, 11:31 a.m. OK C++17 (GCC 7-32) TESTS 44 93 0 1400
258809865 PoetryFactory A April 30, 2024, 4:04 a.m. OK C++17 (GCC 7-32) TESTS 42 93 0 1400
258641120 PipRa A April 29, 2024, 5:23 a.m. OK C++17 (GCC 7-32) TESTS 42 93 0 1400
258568094 m4h A April 28, 2024, 1:26 p.m. OK C++17 (GCC 7-32) TESTS 42 93 0 1400
258518604 GALA A April 28, 2024, 5:41 a.m. OK C++17 (GCC 7-32) TESTS 42 93 0 1400
258506285 trainerherp A April 28, 2024, 2:53 a.m. OK C++17 (GCC 7-32) TESTS 42 93 0 1400
258423700 efishel A April 27, 2024, 2:47 p.m. OK C++17 (GCC 7-32) TESTS 42 93 102400 1400
258521662 FlowRays A April 28, 2024, 6:22 a.m. OK C++20 (GCC 13-64) TESTS 42 62 4812800 1400
258499870 N_z__ A April 28, 2024, 12:02 a.m. OK C++20 (GCC 13-64) TESTS 42 77 102400 1400
258418557 shiomusubi496 A April 27, 2024, 2:39 p.m. OK C++20 (GCC 13-64) TESTS 42 77 1126400 1400
258419761 maspy A April 27, 2024, 2:41 p.m. OK C++20 (GCC 13-64) TESTS 42 77 1433600 1400
259956234 Maharaj7_ A May 8, 2024, 6:17 a.m. OK C++20 (GCC 13-64) TESTS 44 78 0 1400
262494878 itzchefcoder A May 25, 2024, 10:16 a.m. OK C++20 (GCC 13-64) TESTS 44 93 0 1400
261791676 abhiinormal A May 20, 2024, 2:12 p.m. OK C++20 (GCC 13-64) TESTS 44 93 0 1400
261301763 moon_star A May 17, 2024, 8:50 a.m. OK C++20 (GCC 13-64) TESTS 44 93 0 1400
260968921 Geto A May 14, 2024, 6:02 p.m. OK C++20 (GCC 13-64) TESTS 44 93 0 1400
260885909 MyHandleWasTaken A May 14, 2024, 6:35 a.m. OK C++20 (GCC 13-64) TESTS 44 93 0 1400
258419522 Gassa A April 27, 2024, 2:41 p.m. OK D TESTS 42 203 10752000 1400
259086506 Alexanderter10 A May 2, 2024, 6:05 a.m. OK FPC TESTS 44 546 3993600 1400
258548039 ACoderBoy A April 28, 2024, 10:22 a.m. OK GNU C11 TESTS 42 124 2457600 1400
258422872 chro4896 A April 27, 2024, 2:46 p.m. OK GNU C11 TESTS 42 140 921600 1400
259598029 ykt836 A May 5, 2024, 7:30 a.m. OK Go TESTS 44 77 9216000 1400
259554452 stolis A May 4, 2024, 7:45 p.m. OK Java 21 TESTS 44 296 512000 1400
259580993 Mahinr10 A May 5, 2024, 4:07 a.m. OK Java 21 TESTS 44 342 21196800 1400
260728667 oneafter A May 13, 2024, 3:14 a.m. OK Java 21 TESTS 44 359 3584000 1400
259581071 harshparashar A May 5, 2024, 4:09 a.m. OK Java 21 TESTS 44 374 20787200 1400
260729132 oneafter A May 13, 2024, 3:23 a.m. OK Java 21 TESTS 44 390 3072000 1400
263669329 Alpha_Zero00 A June 1, 2024, 6:21 p.m. OK Java 21 TESTS 44 421 5734400 1400
260729776 oneafter A May 13, 2024, 3:34 a.m. OK Java 21 TESTS 44 468 25497600 1400
258424938 profchi A April 27, 2024, 2:49 p.m. OK Java 21 TESTS 42 468 39628800 1400
260515944 oneafter A May 11, 2024, 8:56 a.m. OK Java 21 TESTS 44 499 30003200 1400
262170337 Leoyee A May 22, 2024, 4:35 p.m. OK Java 21 TESTS 44 514 18739200 1400
258420652 knightL A April 27, 2024, 2:42 p.m. OK Java 8 TESTS 42 249 0 1400
258422970 golions A April 27, 2024, 2:46 p.m. OK Java 8 TESTS 42 249 3686400 1400
262091687 Blue_BEE A May 22, 2024, 5:24 a.m. OK Java 8 TESTS 44 249 4608000 1400
258430094 MagentaCobra A April 27, 2024, 2:58 p.m. OK Java 8 TESTS 42 280 0 1400
260971251 kasiru_69 A May 14, 2024, 6:26 p.m. OK Java 8 TESTS 44 296 4505600 1400
258857755 prakhar_30 A April 30, 2024, 1:27 p.m. OK Java 8 TESTS 42 296 6758400 1400
258423719 SecondThread A April 27, 2024, 2:47 p.m. OK Java 8 TESTS 42 328 69427200 1400
258423754 yvbf A April 27, 2024, 2:47 p.m. OK Java 8 TESTS 42 390 6246400 1400
260689205 .shinchan_ A May 12, 2024, 4:09 p.m. OK Java 8 TESTS 44 390 6553600 1400
258860383 Baidiki A April 30, 2024, 1:53 p.m. OK Java 8 TESTS 42 452 0 1400
258419608 bruhopen A April 27, 2024, 2:41 p.m. OK Kotlin 1.9 TESTS 42 436 17817600 1400
258421886 Tlatoani A April 27, 2024, 2:44 p.m. OK Kotlin 1.9 TESTS 42 499 17408000 1400
260200367 thuantnn A May 10, 2024, 4:07 a.m. OK Node.js TESTS 44 249 59699200 1400
258497561 erekle A April 27, 2024, 10:50 p.m. OK OCaml TESTS 42 234 7884800 1400
258420000 bcollet A April 27, 2024, 2:41 p.m. OK PyPy 2 TESTS 42 234 12800000 1400
259580178 vagish_rao A May 5, 2024, 3:53 a.m. OK PyPy 3 TESTS 44 296 18227200 1400
262510450 nun A May 25, 2024, 12:43 p.m. OK PyPy 3 TESTS 44 327 17715200 1400
260511222 john.d.cheong A May 11, 2024, 8:22 a.m. OK PyPy 3 TESTS 44 327 18124800 1400
258631983 nealzane A April 29, 2024, 2:59 a.m. OK PyPy 3 TESTS 42 359 28364800 1400
261689738 CodeArmy A May 19, 2024, 6:10 p.m. OK PyPy 3 TESTS 44 406 21708800 1400
258421851 Alex239 A April 27, 2024, 2:44 p.m. OK PyPy 3-64 TESTS 42 171 21299200 1400
259590393 AbrarShakhi A May 5, 2024, 6:16 a.m. OK PyPy 3-64 TESTS 44 171 27238400 1400
263576381 thinkphp A June 1, 2024, 5:08 a.m. OK PyPy 3-64 TESTS 44 186 27136000 1400
259081779 Manas_Patil A May 2, 2024, 5:02 a.m. OK PyPy 3-64 TESTS 44 186 27136000 1400
260162321 cheeto1 A May 9, 2024, 6 p.m. OK PyPy 3-64 TESTS 44 186 34713600 1400
258545942 SoonOOv A April 28, 2024, 10:04 a.m. OK PyPy 3-64 TESTS 42 187 20582400 1400
258479437 Arnoob2120 A April 27, 2024, 6:39 p.m. OK PyPy 3-64 TESTS 42 187 26931200 1400
262895384 sal_the_1 A May 27, 2024, 2:32 p.m. OK PyPy 3-64 TESTS 44 187 27136000 1400
262070147 BananaSlug A May 22, 2024, 12:41 a.m. OK PyPy 3-64 TESTS 44 187 27136000 1400
260851278 mawo78 A May 13, 2024, 7:49 p.m. OK PyPy 3-64 TESTS 44 187 27136000 1400
258422225 Jimanbanashi A April 27, 2024, 2:45 p.m. OK Python 2 TESTS 42 265 10752000 1400
259372362 quochungbuile A May 3, 2024, 2:36 p.m. OK Python 3 TESTS 44 187 26931200 1400
259846626 moody07 A May 7, 2024, 8:29 a.m. OK Python 3 TESTS 44 202 28364800 1400
258668407 TSChandra A April 29, 2024, 10:29 a.m. OK Python 3 TESTS 42 202 28364800 1400
258658912 IDONI A April 29, 2024, 8:53 a.m. OK Python 3 TESTS 42 202 28364800 1400
258638981 nazeeftham007 A April 29, 2024, 4:50 a.m. OK Python 3 TESTS 42 202 28364800 1400
258506987 joelsolizchoque A April 28, 2024, 3:08 a.m. OK Python 3 TESTS 42 202 28364800 1400
258843474 Ivan19981305 A April 30, 2024, 11:13 a.m. OK Python 3 TESTS 42 203 27340800 1400
261344220 BullyMaguire_ A May 17, 2024, 2:32 p.m. OK Python 3 TESTS 44 203 28467200 1400
258692801 Zak.kon A April 29, 2024, 12:57 p.m. OK Python 3 TESTS 42 203 28467200 1400
260231124 xiayangyang0616xyy A May 10, 2024, 9:31 a.m. OK Python 3 TESTS 44 217 28364800 1400
258525286 vstiff A April 28, 2024, 6:58 a.m. OK Rust 2021 TESTS 42 62 3174400 1400
258526829 vstiff A April 28, 2024, 7:13 a.m. OK Rust 2021 TESTS 42 77 2969600 1400
258526617 vstiff A April 28, 2024, 7:11 a.m. OK Rust 2021 TESTS 42 77 2969600 1400
258418036 sansen A April 27, 2024, 2:38 p.m. OK Rust 2021 TESTS 42 93 1843200 1400
258420912 toomer A April 27, 2024, 2:43 p.m. OK Rust 2021 TESTS 42 93 4300800 1400
259816236 cck111 A May 7, 2024, 2:09 a.m. OK Rust 2021 TESTS 44 108 1126400 1400
258418091 qwerty787788 A April 27, 2024, 2:38 p.m. OK Rust 2021 TESTS 42 109 1126400 1400
258424484 MaxBuzz A April 27, 2024, 2:48 p.m. OK Scala TESTS 42 812 14438400 1400

remove filters

Back to search problems