Codeforces Round 668 (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
1404 Codeforces Round 668 (Div. 1) FINISHED False 7200 137777063 Sept. 6, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7549 ) B Tree Tag PROGRAMMING dfs and similar dp games trees

B'Alice and Bob are playing a fun game of tree tag. The game is played on a tree of n vertices numbered from 1 to n . Recall that a tree on n vertices is an undirected, connected graph with n-1 edges. Initially, Alice is located at vertex a , and Bob at vertex b . They take turns alternately, and Alice makes the first move. In a move, Alice can jump to a vertex with distance at most da from the current vertex. And in a move, Bob can jump to a vertex with distance at most db from the current vertex. The distance between two vertices is defined as the number of edges on the unique simple path between them. In particular, either player is allowed to stay at the same vertex in a move. Note that when performing a move, a player only occupies the starting and ending vertices of their move, not the vertices between them. If after at most 10^{100} moves, Alice and Bob occupy the same vertex, then Alice is declared the winner. Otherwise, Bob wins. Determine the winner if both players play optimally. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). Description of the test cases follows. The first line of each test case contains five integers n,a,b,da,db ( 2 <= n <= 10^5 , 1 <= a,b <= n , a ne b , 1 <= da,db <= n-1 ) -- the number of vertices, Alice 's vertex, Bob 's vertex, Alice 's maximum jumping distance, and Bob 's maximum jumping distance, respectively. The following n-1 lines describe the edges of the tree. The i -th of these lines contains two integers u , v ( 1 <= u, v <= n, u ne v ), denoting an edge between vertices u and v . It is guaranteed that these edges form a tree structure. It is guaranteed that the sum of n across all test cases does not exceed 10^5 . For each test case, output a single line containing the winner of the game: "Alice" or "Bob". In the'...

Tutorials

Codeforces Round #668 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
92044331 Gassa B Sept. 6, 2020, 3:06 p.m. OK D TESTS 23 124 13721600
92046402 hos.lyric B Sept. 6, 2020, 3:10 p.m. OK D TESTS 23 124 13824000
92072477 pengin_2000 B Sept. 6, 2020, 4:29 p.m. OK GNU C11 TESTS 23 78 3993600
92044679 dqa2020 B Sept. 6, 2020, 3:07 p.m. OK GNU C++11 TESTS 23 31 2252800
92055011 Wall_breaker B Sept. 6, 2020, 3:32 p.m. OK GNU C++11 TESTS 23 31 2457600
92055362 SGColin B Sept. 6, 2020, 3:33 p.m. OK GNU C++11 TESTS 23 31 3276800
92098845 fzszchy2001 B Sept. 7, 2020, 2:38 a.m. OK GNU C++11 TESTS 23 31 16076800
92043726 201831990439 B Sept. 6, 2020, 3:04 p.m. OK GNU C++11 TESTS 23 31 18534400
92044195 Deep_Kevin B Sept. 6, 2020, 3:05 p.m. OK GNU C++11 TESTS 23 46 2048000
92051269 HXLLL B Sept. 6, 2020, 3:22 p.m. OK GNU C++11 TESTS 23 46 2252800
92068553 myx12345 B Sept. 6, 2020, 4:16 p.m. OK GNU C++11 TESTS 23 46 2662400
92050530 comld B Sept. 6, 2020, 3:20 p.m. OK GNU C++11 TESTS 23 46 2867200
92078105 Ghost_Dragon B Sept. 6, 2020, 5:27 p.m. OK GNU C++11 TESTS 23 46 2867200
92043310 Linkus B Sept. 6, 2020, 3:04 p.m. OK GNU C++14 TESTS 23 46 3584000
92079604 BSBandme B Sept. 6, 2020, 5:40 p.m. OK GNU C++14 TESTS 23 61 2457600
92044583 superguymj B Sept. 6, 2020, 3:06 p.m. OK GNU C++14 TESTS 23 62 2355200
92082052 xb0nS B Sept. 6, 2020, 6:10 p.m. OK GNU C++14 TESTS 23 62 3993600
92089724 JustasZ B Sept. 6, 2020, 8:35 p.m. OK GNU C++14 TESTS 23 62 5427200
92050780 DougZheng B Sept. 6, 2020, 3:21 p.m. OK GNU C++14 TESTS 23 62 7168000
92059839 fanqeixi B Sept. 6, 2020, 3:46 p.m. OK GNU C++14 TESTS 23 77 2867200
92060601 Kalptaru B Sept. 6, 2020, 3:49 p.m. OK GNU C++14 TESTS 23 77 3584000
92081814 clyring B Sept. 6, 2020, 6:06 p.m. OK GNU C++14 TESTS 23 77 3584000
92055485 Sofapuden B Sept. 6, 2020, 3:33 p.m. OK GNU C++14 TESTS 23 77 3584000
92038997 LayCurse B Sept. 6, 2020, 2:55 p.m. OK GNU C++17 TESTS 23 46 99532800
92053444 He_Ren B Sept. 6, 2020, 3:28 p.m. OK GNU C++17 TESTS 23 62 2764800
92069749 Austin_Griffin B Sept. 6, 2020, 4:20 p.m. OK GNU C++17 TESTS 23 62 2867200
92050235 lyuankai B Sept. 6, 2020, 3:19 p.m. OK GNU C++17 TESTS 23 62 2867200
92051551 Bennettz B Sept. 6, 2020, 3:23 p.m. OK GNU C++17 TESTS 23 62 3276800
92047975 Hyperbolic B Sept. 6, 2020, 3:14 p.m. OK GNU C++17 TESTS 23 62 3584000
92094673 goingtheextramile B Sept. 6, 2020, 11:58 p.m. OK GNU C++17 TESTS 23 62 3686400
92100447 ningBr B Sept. 7, 2020, 3:21 a.m. OK GNU C++17 TESTS 23 62 3993600
92098118 Ccucumber12 B Sept. 7, 2020, 2:17 a.m. OK GNU C++17 TESTS 23 62 3993600
92106028 Soumya1 B Sept. 7, 2020, 5:18 a.m. OK GNU C++17 TESTS 23 62 3993600
92095356 UniverseofHK B Sept. 7, 2020, 12:34 a.m. OK GNU C++17 (64) TESTS 23 46 7270400
92033158 Egor B Sept. 6, 2020, 2:47 p.m. OK GNU C++17 (64) TESTS 23 46 14336000
92094910 Frame233 B Sept. 7, 2020, 12:12 a.m. OK GNU C++17 (64) TESTS 23 61 2867200
92057578 achvanov B Sept. 6, 2020, 3:40 p.m. OK GNU C++17 (64) TESTS 23 61 4812800
92045087 Anus1373 B Sept. 6, 2020, 3:07 p.m. OK GNU C++17 (64) TESTS 23 62 2867200
92101126 DQ9911 B Sept. 7, 2020, 3:39 a.m. OK GNU C++17 (64) TESTS 23 62 4710400
92039672 AndreySergunin B Sept. 6, 2020, 2:57 p.m. OK GNU C++17 (64) TESTS 23 62 4710400
92043145 kessido B Sept. 6, 2020, 3:03 p.m. OK GNU C++17 (64) TESTS 23 62 4710400
92050085 sherlock0502 B Sept. 6, 2020, 3:19 p.m. OK GNU C++17 (64) TESTS 23 62 4812800
92067627 jacob.b.zhang B Sept. 6, 2020, 4:13 p.m. OK GNU C++17 (64) TESTS 23 62 4812800
92097089 synapse B Sept. 7, 2020, 1:44 a.m. OK Go TESTS 23 139 4608000
92053907 uwi B Sept. 6, 2020, 3:29 p.m. OK Java 11 TESTS 23 218 0
92046654 mikit B Sept. 6, 2020, 3:11 p.m. OK Java 11 TESTS 23 234 5632000
92079816 skittles1412 B Sept. 6, 2020, 5:42 p.m. OK Java 11 TESTS 23 295 19046400
92051748 ZeyadKhattab B Sept. 6, 2020, 3:23 p.m. OK Java 11 TESTS 23 326 16384000
92036191 qwerty787788 B Sept. 6, 2020, 2:51 p.m. OK Java 11 TESTS 23 327 16384000
92072194 Apfeloxid B Sept. 6, 2020, 4:28 p.m. OK Java 11 TESTS 23 343 15360000
92046583 cirno3153 B Sept. 6, 2020, 3:11 p.m. OK Java 11 TESTS 23 343 16793600
92048386 mphillotry B Sept. 6, 2020, 3:15 p.m. OK Java 11 TESTS 23 420 23859200
92063535 insert_cool_handle B Sept. 6, 2020, 3:59 p.m. OK Java 11 TESTS 23 436 18432000
92050432 yehara B Sept. 6, 2020, 3:20 p.m. OK Java 11 TESTS 23 624 15360000
92086396 fetetriste B Sept. 6, 2020, 7:20 p.m. OK Java 8 TESTS 23 155 0
92071856 iakovlev.zakhar B Sept. 6, 2020, 4:27 p.m. OK Java 8 TESTS 23 155 0
92047622 Taran_1407 B Sept. 6, 2020, 3:13 p.m. OK Java 8 TESTS 23 171 0
92052876 naam_me_kya_rakha_he B Sept. 6, 2020, 3:26 p.m. OK Java 8 TESTS 23 187 5324800
92043740 cwise B Sept. 6, 2020, 3:04 p.m. OK Java 8 TESTS 23 217 47001600
92045666 SecondThread B Sept. 6, 2020, 3:09 p.m. OK Java 8 TESTS 23 233 3993600
92042196 AnandOza B Sept. 6, 2020, 3:01 p.m. OK Java 8 TESTS 23 233 14233600
92046212 ijxjdjd B Sept. 6, 2020, 3:10 p.m. OK Java 8 TESTS 23 234 14438400
92042846 holeguma B Sept. 6, 2020, 3:03 p.m. OK Java 8 TESTS 23 249 17100800
92054444 Naman_123 B Sept. 6, 2020, 3:30 p.m. OK Java 8 TESTS 23 264 4915200
92052877 elizarov B Sept. 6, 2020, 3:26 p.m. OK Kotlin TESTS 23 186 102400
92059301 Hakiobo B Sept. 6, 2020, 3:45 p.m. OK Kotlin TESTS 23 217 6041600
92078224 ostroumov B Sept. 6, 2020, 5:28 p.m. OK Kotlin TESTS 23 326 18636800
92065726 batkhuyag B Sept. 6, 2020, 4:06 p.m. OK Kotlin TESTS 23 467 17203200
92048391 Yupiteru B Sept. 6, 2020, 3:15 p.m. OK Mono C# TESTS 23 187 26726400
92049989 mban259 B Sept. 6, 2020, 3:19 p.m. OK Mono C# TESTS 23 202 15257600
92079070 terry_u16 B Sept. 6, 2020, 5:35 p.m. OK Mono C# TESTS 23 202 15769600
92042456 keymoon B Sept. 6, 2020, 3:02 p.m. OK Mono C# TESTS 23 327 32460800
92047905 azukun B Sept. 6, 2020, 3:14 p.m. OK Mono C# TESTS 23 467 147763200
92052625 shirowa B Sept. 6, 2020, 3:25 p.m. OK MS C++ 2017 TESTS 23 93 3788800
92052424 vpike B Sept. 6, 2020, 3:25 p.m. OK MS C++ 2017 TESTS 23 171 3481600
92059126 AnnSuperstar B Sept. 6, 2020, 3:44 p.m. OK MS C++ 2017 TESTS 23 218 3993600
92054552 Gravekper B Sept. 6, 2020, 3:31 p.m. OK MS C++ 2017 TESTS 23 218 4812800
92087580 conqueror_of_tourist B Sept. 6, 2020, 7:43 p.m. OK PyPy 2 TESTS 23 545 8908800
92065964 kclee2172 B Sept. 6, 2020, 4:07 p.m. OK PyPy 3 TESTS 23 311 10854400
92045566 tamato B Sept. 6, 2020, 3:08 p.m. OK PyPy 3 TESTS 23 326 11366400
92046311 chudy_lukasz1337 B Sept. 6, 2020, 3:10 p.m. OK PyPy 3 TESTS 23 358 10547200
92052145 mkawa2 B Sept. 6, 2020, 3:24 p.m. OK PyPy 3 TESTS 23 358 75776000
92074030 juppy B Sept. 6, 2020, 4:33 p.m. OK PyPy 3 TESTS 23 374 12492800
92047545 pineriver B Sept. 6, 2020, 3:13 p.m. OK PyPy 3 TESTS 23 389 10752000
92048408 titia B Sept. 6, 2020, 3:15 p.m. OK PyPy 3 TESTS 23 389 10956800
92048056 neterukun B Sept. 6, 2020, 3:14 p.m. OK PyPy 3 TESTS 23 389 12595200
92043976 SPD_9X2 B Sept. 6, 2020, 3:05 p.m. OK PyPy 3 TESTS 23 420 11059200
92065550 conqueror_of_tourist B Sept. 6, 2020, 4:06 p.m. OK PyPy 3 TESTS 23 421 11161600
92087565 conqueror_of_tourist B Sept. 6, 2020, 7:43 p.m. OK Python 2 TESTS 23 483 11776000
92050706 r57shell B Sept. 6, 2020, 3:21 p.m. OK Python 3 TESTS 23 311 9420800
92087480 conqueror_of_tourist B Sept. 6, 2020, 7:41 p.m. OK Python 3 TESTS 23 373 9728000
92095086 kobae964 B Sept. 7, 2020, 12:21 a.m. OK Rust TESTS 23 124 11878400
92040961 ngtkana B Sept. 6, 2020, 2:59 p.m. OK Rust TESTS 23 202 4812800

remove filters

Back to search problems