Educational Codeforces Round 187 (Rated for 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
2203 Educational Codeforces Round 187 (Rated for Div. 2) FINISHED False 7200 4375523 Feb. 25, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 5237 ) D Divisibility Game PROGRAMMING brute force games greedy number theory

Alice and Bob are playing a game. They have an array (a) of (n) elements and an array (b) of (m) elements. The players take turns. Alice goes first. On their turn, each player chooses a number (x) from array (a) and a number (y) from array (b). Alice has her own rule for choosing (x) and (y), and Bob has his: Alice must choose (x) and (y) such that (y) is divisible by (x). Bob must choose (x) and (y) such that (y) is not divisible by (x). After choosing (x) and (y), (y) is removed from the array (b) (but (x) remains in (a)). When (y) is removed from (b), if there are multiple occurrences of (y), only one is removed. The player who cannot make a move loses. Who will win if both players play optimally? 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 two integers (n) and (m) ((1 \le n, m \le 10^{6})). The second line of each test case contains (n) integers (a_{i}) ((1 \le a_{i} \le n + m)) — the elements of the array (a). The last line of each test case contains (m) integers (b_{i}) ((1 \le b_{i} \le n + m)) — the elements of the array (b). Additional constraints on the input: the sum of (n) over all test cases does not exceed (10^6); the sum of (m) over all test cases does not exceed (10^6). For each test case, print one word: Alice if Alice wins; Bob if Bob wins. Consider the first test case. Let's show how Alice wins through the moves: Alice's move: (x = 3, y = 6) (after this, (6) will be removed from (b), resulting in (b = 7, 12)) Bob's move: (x = 3, y = 7) (Bob will choose (y = 7) on his turn anyway, since there is no (x) that does not divide (y = 12), after this move (b = 12)) Alice's move: $

Tutorials

Educational Codeforces Round 187 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
364383658 aditp D Feb. 25, 2026, 5:17 p.m. OK C++17 (GCC 7-32) TESTS 21 406 614400
364367940 Helperoa123 D Feb. 25, 2026, 4:12 p.m. OK C++17 (GCC 7-32) TESTS 21 406 8089600
364373332 FarbodChr D Feb. 25, 2026, 4:26 p.m. OK C++17 (GCC 7-32) TESTS 21 406 12083200
364375032 sathwika_006 D Feb. 25, 2026, 4:30 p.m. OK C++17 (GCC 7-32) TESTS 21 421 4608000
364372919 LinZhiheng D Feb. 25, 2026, 4:25 p.m. OK C++17 (GCC 7-32) TESTS 21 421 8192000
364391859 lazytoursit D Feb. 25, 2026, 6:30 p.m. OK C++17 (GCC 7-32) TESTS 21 437 4608000
364402948 WhyByteCoding D Feb. 25, 2026, 8:51 p.m. OK C++17 (GCC 7-32) TESTS 21 437 6860800
364372645 azer007 D Feb. 25, 2026, 4:24 p.m. OK C++17 (GCC 7-32) TESTS 21 437 8806400
364374463 mikyoch D Feb. 25, 2026, 4:28 p.m. OK C++17 (GCC 7-32) TESTS 21 453 4403200
364377960 cartofel D Feb. 25, 2026, 4:39 p.m. OK C++17 (GCC 7-32) TESTS 21 453 8089600
364376414 ysk510 D Feb. 25, 2026, 4:33 p.m. OK C++20 (GCC 13-64) TESTS 21 343 11878400
364419147 HaY0u D Feb. 26, 2026, 2:37 a.m. OK C++20 (GCC 13-64) TESTS 21 343 16281600
364368879 tretasingh4399 D Feb. 25, 2026, 4:15 p.m. OK C++20 (GCC 13-64) TESTS 21 359 8089600
364367648 xsh4n4 D Feb. 25, 2026, 4:12 p.m. OK C++20 (GCC 13-64) TESTS 21 359 8192000
364372951 __Dangcoder__ D Feb. 25, 2026, 4:25 p.m. OK C++20 (GCC 13-64) TESTS 21 359 9113600
364374809 DLLR.H D Feb. 25, 2026, 4:29 p.m. OK C++20 (GCC 13-64) TESTS 21 375 4608000
364369961 The.Egoist D Feb. 25, 2026, 4:18 p.m. OK C++20 (GCC 13-64) TESTS 21 375 8192000
364388209 DBFC31 D Feb. 25, 2026, 5:57 p.m. OK C++20 (GCC 13-64) TESTS 21 375 20172800
364425322 Gotenks69 D Feb. 26, 2026, 4:04 a.m. OK C++20 (GCC 13-64) TESTS 21 375 32256000
364375731 sarunabh666 D Feb. 25, 2026, 4:32 p.m. OK C++20 (GCC 13-64) TESTS 21 390 102400
364407915 WorldWarV D Feb. 25, 2026, 10:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 187 5632000
364385152 jakekim D Feb. 25, 2026, 5:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 250 18124800
364382809 mhnd01s D Feb. 25, 2026, 5:10 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 250 28467200
364384691 jakekim D Feb. 25, 2026, 5:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 312 18124800
364372469 Lynia D Feb. 25, 2026, 4:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 343 4505600
364386577 wizardkaey D Feb. 25, 2026, 5:42 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 343 6553600
364409763 PriashisG D Feb. 25, 2026, 11:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 343 12697600
364368933 Varun_Subramaniam D Feb. 25, 2026, 4:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 343 12697600
364409154 Istiyak_Raz D Feb. 25, 2026, 10:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 343 13721600
364368737 xixii_ D Feb. 25, 2026, 4:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 343 18227200
364371404 ruban D Feb. 25, 2026, 4:21 p.m. OK FPC TESTS 21 1062 228556800
364431717 ChuanxNi D Feb. 26, 2026, 5:25 a.m. OK GNU C11 TESTS 21 390 8192000
364376910 dhiraj_pgcat D Feb. 25, 2026, 4:34 p.m. OK GNU C11 TESTS 21 484 16076800
364381063 pengin_2000 D Feb. 25, 2026, 4:58 p.m. OK GNU C11 TESTS 21 578 24064000
364375871 Sybaul D Feb. 25, 2026, 4:32 p.m. OK Java 21 TESTS 21 328 25702400
364378192 smg_raza D Feb. 25, 2026, 4:40 p.m. OK Java 21 TESTS 21 375 22016000
364376722 syed_raza D Feb. 25, 2026, 4:34 p.m. OK Java 21 TESTS 21 375 22016000
364374097 aykhanasgarov251 D Feb. 25, 2026, 4:28 p.m. OK Java 21 TESTS 21 453 17817600
364372785 mh116727 D Feb. 25, 2026, 4:25 p.m. OK Java 21 TESTS 21 453 19046400
364374528 mastacoda D Feb. 25, 2026, 4:29 p.m. OK Java 21 TESTS 21 500 18227200
364371465 boki31 D Feb. 25, 2026, 4:21 p.m. OK Java 21 TESTS 21 515 34099200
364398212 GuLLu05 D Feb. 25, 2026, 7:43 p.m. OK Java 21 TESTS 21 734 49152000
364390739 JohnKramer D Feb. 25, 2026, 6:20 p.m. OK Java 21 TESTS 21 750 18329600
364392986 Azad_Singh D Feb. 25, 2026, 6:43 p.m. OK Java 21 TESTS 21 750 68198400
364370182 janarthan D Feb. 25, 2026, 4:18 p.m. OK Java 8 TESTS 21 265 11673600
364378326 rushi1105 D Feb. 25, 2026, 4:41 p.m. OK Java 8 TESTS 21 703 95641600
364368872 am_I_Newbie D Feb. 25, 2026, 4:15 p.m. OK Java 8 TESTS 21 1078 67481600
364390487 letscod2021 D Feb. 25, 2026, 6:18 p.m. OK Java 8 TESTS 21 1671 159232000
364368136 sajjanikhil123 D Feb. 25, 2026, 4:13 p.m. OK Kotlin 1.9 TESTS 21 515 68403200
364422597 chinesedfan D Feb. 26, 2026, 3:29 a.m. OK Node.js TESTS 21 937 40550400
364371988 Arivoli D Feb. 25, 2026, 4:23 p.m. OK PyPy 3 TESTS 21 1796 80691200
364372703 abhinav4710 D Feb. 25, 2026, 4:24 p.m. OK PyPy 3-64 TESTS 21 593 136806400
364422547 qyzm123 D Feb. 26, 2026, 3:28 a.m. OK PyPy 3-64 TESTS 21 593 139161600
364388302 Arpia D Feb. 25, 2026, 5:58 p.m. OK PyPy 3-64 TESTS 21 640 131993600
364390447 Cenix820 D Feb. 25, 2026, 6:17 p.m. OK PyPy 3-64 TESTS 21 656 131891200
364372963 spam_heet_070 D Feb. 25, 2026, 4:25 p.m. OK PyPy 3-64 TESTS 21 671 137011200
364397322 OAY71011 D Feb. 25, 2026, 7:33 p.m. OK PyPy 3-64 TESTS 21 687 136704000
364434005 youngdp D Feb. 26, 2026, 5:53 a.m. OK PyPy 3-64 TESTS 21 687 145203200
364373644 amanyvv D Feb. 25, 2026, 4:27 p.m. OK PyPy 3-64 TESTS 21 703 225484800
364434062 youngdp D Feb. 26, 2026, 5:53 a.m. OK PyPy 3-64 TESTS 21 718 145305600
364411979 isa773 D Feb. 26, 2026, 12:01 a.m. OK PyPy 3-64 TESTS 21 718 188211200
364374040 Nikita_Sobolev D Feb. 25, 2026, 4:27 p.m. OK Python 3 TESTS 21 1015 235008000
364368257 ChrisRichardF D Feb. 25, 2026, 4:13 p.m. OK Python 3 TESTS 21 1140 246681600
364426389 shivpatel271106 D Feb. 26, 2026, 4:15 a.m. OK Python 3 TESTS 21 1203 270745600
364378463 vanshit D Feb. 25, 2026, 4:42 p.m. OK Rust 2024 TESTS 21 531 57651200

remove filters

Back to search problems