Codeforces Global Round 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
1110 Codeforces Global Round 1 FINISHED False 7200 187979123 Feb. 7, 2019, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 634 ) G Tree-Tac-Toe PROGRAMMING constructive algorithms games trees 3000

B'The tic-tac-toe game is starting on a tree of n vertices. Some vertices are already colored in white while the remaining are uncolored. There are two players -- white and black. The players make moves alternatively. The white player starts the game. In his turn, a player must select one uncolored vertex and paint it in his color. The player wins if he paints some path of three vertices in his color. In case all vertices are colored and neither player won, the game ends in a draw. Could you please find who will win the game or whether it ends as a draw, assuming both players play optimally? The first line contains a single integer T ( 1 <= T <= 50 ,000 ) -- the number of test cases. Then descriptions of T test cases follow. The first line of each test contains a single integer n ( 1 <= n <= 5 cdot 10^5 ) -- the number of vertices in the tree. Each of the following n - 1 lines contains integers v , u ( 1 <= v, u <= n ) denoting an edge of the tree connecting vertices v and u . The last line of a test case contains a string of letters 'W ' (for white) and 'N ' (for not colored) of length n denoting already colored vertices. Vertexes already colored in white are denoted as 'W '. It 's guaranteed that the given edges form a tree, that there is at least one uncolored vertex and that there is no path of three white vertices. It 's guaranteed that sum of all n among all test cases is at most 5 cdot 10^5 . For every test case, print either "White", "Draw" or "Black", depending on the result of the game. In the first example, vertex 4 is already colored in white. The white player can win by coloring the vertex 1 in white first and the remaining vertex on his second turn. The process is illustrated with the pictures below. In the second example, we can show that no player can enforce their victory. '...

Tutorials

The Editorial of the First Codeforces Global Round

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
49617601 gayathriamulya98 G Feb. 8, 2019, 7:11 a.m. OK GNU C++11 TESTS 37 46 25088000 3000
52261877 Minamoto G April 3, 2019, 9:18 a.m. OK GNU C++11 TESTS 37 46 27136000 3000
60669918 Owen_codeisking G Sept. 16, 2019, 10:08 a.m. OK GNU C++11 TESTS 37 46 29081600 3000
49612942 gtrhetr G Feb. 8, 2019, 3:32 a.m. OK GNU C++11 TESTS 37 46 96665600 3000
60669971 Owen_codeisking G Sept. 16, 2019, 10:09 a.m. OK GNU C++11 TESTS 37 61 25088000 3000
49750201 yybyyb G Feb. 11, 2019, 2:09 a.m. OK GNU C++11 TESTS 37 61 25088000 3000
49617586 Itst G Feb. 8, 2019, 7:10 a.m. OK GNU C++11 TESTS 37 61 25088000 3000
56035744 vjudge1 G June 25, 2019, 11:58 a.m. OK GNU C++11 TESTS 37 61 50073600 3000
54220884 M_sea G May 16, 2019, 3:15 a.m. OK GNU C++11 TESTS 37 61 50073600 3000
54220864 M_sea G May 16, 2019, 3:14 a.m. OK GNU C++11 TESTS 37 61 50073600 3000
49653747 qiqi20021026 G Feb. 9, 2019, 8:53 a.m. OK GNU C++14 TESTS 37 202 51097600 3000
59642971 lzoiexplorer2004 G Aug. 29, 2019, 3:32 a.m. OK GNU C++14 TESTS 37 217 100249600 3000
51280577 yhx-12243 G March 14, 2019, 3:23 a.m. OK GNU C++14 TESTS 37 218 29286400 3000
59642928 lzoiexplorer2004 G Aug. 29, 2019, 3:29 a.m. OK GNU C++14 TESTS 37 218 50073600 3000
59642917 lzoiexplorer2004 G Aug. 29, 2019, 3:29 a.m. OK GNU C++14 TESTS 37 218 50073600 3000
49832316 bestFy G Feb. 12, 2019, 2:28 p.m. OK GNU C++14 TESTS 37 218 50073600 3000
49695056 Rabbittank G Feb. 10, 2019, 1:20 p.m. OK GNU C++14 TESTS 37 249 25088000 3000
49913383 Tommyr7 G Feb. 14, 2019, 3:16 p.m. OK GNU C++14 TESTS 37 265 90214400 3000
49895809 cristian1997 G Feb. 14, 2019, 6:51 a.m. OK GNU C++14 TESTS 37 295 9830400 3000
49815687 VioletSaber G Feb. 12, 2019, 5:44 a.m. OK GNU C++14 TESTS 37 295 15872000 3000
54405682 Romeolong G May 20, 2019, 6:02 a.m. OK GNU C++17 TESTS 37 62 93081600 3000
51931389 CMXRYNP G March 28, 2019, 10:33 a.m. OK GNU C++17 TESTS 37 77 33484800 3000
49658732 codgician G Feb. 9, 2019, 11:19 a.m. OK GNU C++17 TESTS 37 217 12800000 3000
49849782 mu_xia_xiu_ji G Feb. 13, 2019, 2:23 a.m. OK GNU C++17 TESTS 37 233 34508800 3000
52628157 Isonan G April 12, 2019, 5:18 a.m. OK GNU C++17 TESTS 37 280 74547200 3000
49829989 Rudy358 G Feb. 12, 2019, 1:29 p.m. OK GNU C++17 TESTS 37 327 16998400 3000
49643157 mareksom G Feb. 9, 2019, 12:54 a.m. OK GNU C++17 TESTS 37 342 17715200 3000
49763827 Gregory G Feb. 11, 2019, 10:34 a.m. OK GNU C++17 TESTS 37 342 18124800 3000
49606323 Benq G Feb. 7, 2019, 7:41 p.m. OK GNU C++17 TESTS 37 342 26828800 3000
61253339 Shayan.P G Sept. 25, 2019, 9:09 a.m. OK GNU C++17 TESTS 37 342 50892800 3000
49596342 uwi G Feb. 7, 2019, 3:31 p.m. OK Java 8 TESTS 37 233 13926400 3000
49598985 Egor G Feb. 7, 2019, 4:35 p.m. OK Java 8 TESTS 37 280 64921600 3000
51610780 burning_code G March 21, 2019, 10:14 a.m. OK Java 8 TESTS 37 857 66355200 3000
51610790 burning_code G March 21, 2019, 10:14 a.m. OK Java 8 TESTS 37 888 66252800 3000
51610365 burning_code G March 21, 2019, 9:59 a.m. OK Java 8 TESTS 37 904 66764800 3000
51610658 burning_code G March 21, 2019, 10:10 a.m. OK Java 8 TESTS 37 919 66252800 3000

remove filters

Back to search problems