Pinely Round 4 (Div. 1 + 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
1991 Pinely Round 4 (Div. 1 + Div. 2) FINISHED False 10800 15002663 July 28, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 514 ) H Prime Split Game PROGRAMMING fft games math number theory

B'Alice and Bob are playing a game with n piles of stones, where the i -th pile has a_i stones. Players take turns making moves, with Alice going first. On each move, the player does the following three-step process: The player who is unable to make a move loses. Determine who will win if both players play optimally. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- 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 <= 2 cdot 10^5 ) -- the number of piles of stones. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 2 cdot 10^5 ) -- the number of stones in the piles. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output "Alice" (without quotes) if Alice wins and "Bob" (without quotes) otherwise. You can output each letter in any case (upper or lower). For example, the strings "alIcE", "Alice", and "alice" will all be considered identical. In the first test case, there are 2 piles of stones with 2 and 1 stones respectively. Since neither 1 nor 2 can be split into two prime numbers, Alice cannot make a move, so Bob wins. In the second test case, there are 3 piles of stones with 3 , 5 , and 7 stones respectively. Alice can choose k = 1 , remove the pile of 7 stones, and then split the pile of 5 stones into two piles of prime numbers of stones, 2 and 3 . Then, the piles consist of 3 piles of stones with 3 , 2 , and 3 stones respectively, leaving Bob with no valid moves, so Alice wins. In the third test case, there are 4 piles of stones with 4 , 6 , 8 , and 10 stones respectively. Alice can choose k = 2 , removing two pil'...

Tutorials

Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
273237872 jdurie H July 28, 2024, 7:16 p.m. OK C++17 (GCC 7-32) TESTS 12 124 2048000
273220804 Szoboszlai10 H July 28, 2024, 5:15 p.m. OK C++17 (GCC 7-32) TESTS 12 202 3993600
273281579 K_M_offical H July 29, 2024, 5:42 a.m. OK C++17 (GCC 7-32) TESTS 12 265 819200
273237245 shilpabanerjee50 H July 28, 2024, 7:11 p.m. OK C++17 (GCC 7-32) TESTS 12 296 819200
273248170 Noobish_Monk H July 28, 2024, 9:35 p.m. OK C++17 (GCC 7-32) TESTS 12 327 12492800
273226512 hank55663 H July 28, 2024, 5:30 p.m. OK C++17 (GCC 7-32) TESTS 12 374 12902400
273270670 Hanghang007 H July 29, 2024, 3:36 a.m. OK C++17 (GCC 7-32) TESTS 12 406 307200
273273613 wzc_IOI_czw H July 29, 2024, 4:10 a.m. OK C++17 (GCC 7-32) TESTS 12 843 15360000
273263599 Sparkle_Twilight H July 29, 2024, 2:14 a.m. OK C++17 (GCC 7-32) TESTS 12 1187 51507200
273229115 dreamoon_love_AA H July 28, 2024, 5:34 p.m. OK C++17 (GCC 7-32) TESTS 12 1484 2457600
273240528 Agreb H July 28, 2024, 7:43 p.m. OK C++20 (GCC 13-64) TESTS 12 93 3276800
273278298 zwh2008 H July 29, 2024, 5:06 a.m. OK C++20 (GCC 13-64) TESTS 12 108 1945600
273272275 xvzhiming H July 29, 2024, 3:55 a.m. OK C++20 (GCC 13-64) TESTS 12 109 3379200
273241197 orz H July 28, 2024, 7:51 p.m. OK C++20 (GCC 13-64) TESTS 12 124 2560000
273250616 maxplus H July 28, 2024, 10:21 p.m. OK C++20 (GCC 13-64) TESTS 12 139 614400
273249423 Mangooste H July 28, 2024, 9:58 p.m. OK C++20 (GCC 13-64) TESTS 12 186 7577600
273257689 Richard1211 H July 29, 2024, 12:57 a.m. OK C++20 (GCC 13-64) TESTS 12 187 33075200
273252915 jiangbowen_ H July 28, 2024, 11:09 p.m. OK C++20 (GCC 13-64) TESTS 12 202 3993600
273226666 Ormlis H July 28, 2024, 5:30 p.m. OK C++20 (GCC 13-64) TESTS 12 202 20070400
273251605 skittles1412 H July 28, 2024, 10:41 p.m. OK C++20 (GCC 13-64) TESTS 12 234 0

remove filters

Back to search problems