Codeforces Global Round 18

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
1615 Codeforces Global Round 18 FINISHED False 9000 96909863 Dec. 24, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1946 ) D X(or)-mas Tree PROGRAMMING 2-sat bitmasks dfs and similar graphs trees

B"'Twas the night before Christmas, and Santa's frantically setting up his new Christmas tree! There are n nodes in the tree, connected by n-1 edges. On each edge of the tree, there's a set of Christmas lights, which can be represented by an integer in binary representation. He has m elves come over and admire his tree. Each elf is assigned two nodes, a and b , and that elf looks at all lights on the simple path between the two nodes. After this, the elf's favorite number becomes the bitwise XOR of the values of the lights on the edges in that path. However, the North Pole has been recovering from a nasty bout of flu. Because of this, Santa forgot some of the configurations of lights he had put on the tree, and he has already left the North Pole! Fortunately, the elves came to the rescue, and each one told Santa what pair of nodes he was assigned (a_i, b_i) , as well as the parity of the number of set bits in his favorite number. In other words, he remembers whether the number of 1 's when his favorite number is written in binary is odd or even. Help Santa determine if it's possible that the memories are consistent, and if it is, remember what his tree looked like, and maybe you'll go down in history! The first line contains one integer t ( 1 <= q t <= q 2 cdot 10^4 ) -- the number of test cases. Then t cases follow. The first line of each test case contains two integers, n and m ( 2 <= q n <= q 2 cdot 10^5 ; 1 <= q m <= q 2 cdot 10^5 ) -- the size of tree and the number of elves respectively. The next n-1 lines of each test case each contains three integers, x , y , and v ( 1 <= q x, y <= q n ; -1 <= q v < 2^{30} ) -- meaning that there's an edge between nodes x and y . If The next m lines of each test case each contains three integers, a , b , and p ( 1 <= q a, b <= q n ; a neq b ; 0 <= q p <= q "...

Tutorials

Global Round 18 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
140527499 gxlois D Dec. 24, 2021, 10:29 p.m. OK D TESTS 30 654 62156800
140537275 Toby-Shi D Dec. 25, 2021, 4:11 a.m. OK GNU C++14 TESTS 30 311 16588800
140536226 LptN21 D Dec. 25, 2021, 3:46 a.m. OK GNU C++14 TESTS 30 327 3993600
140532428 lytQAQ D Dec. 25, 2021, 2 a.m. OK GNU C++14 TESTS 30 327 6451200
140536691 hokarikanae D Dec. 25, 2021, 3:58 a.m. OK GNU C++14 TESTS 30 343 18124800
140531859 JoesSR D Dec. 25, 2021, 1:44 a.m. OK GNU C++14 TESTS 30 358 21299200
140493896 walk_alone D Dec. 24, 2021, 4:20 p.m. OK GNU C++14 TESTS 30 374 19148800
140527005 saritesh D Dec. 24, 2021, 10:09 p.m. OK GNU C++14 TESTS 30 389 17715200
140493453 vccaiji D Dec. 24, 2021, 4:19 p.m. OK GNU C++14 TESTS 30 390 5222400
140539006 5ab D Dec. 25, 2021, 4:45 a.m. OK GNU C++14 TESTS 30 405 4812800
140496429 chsuhan D Dec. 24, 2021, 4:29 p.m. OK GNU C++14 TESTS 30 405 7987200
140533882 AhoCorasick D Dec. 25, 2021, 2:42 a.m. OK GNU C++17 TESTS 30 327 5939200
140511082 louroborus D Dec. 24, 2021, 5:52 p.m. OK GNU C++17 TESTS 30 327 10854400
140534971 beacon_cwk D Dec. 25, 2021, 3:13 a.m. OK GNU C++17 TESTS 30 327 17817600
140495939 yokozuna57 D Dec. 24, 2021, 4:27 p.m. OK GNU C++17 TESTS 30 342 7987200
140504052 Kelvin2005 D Dec. 24, 2021, 4:57 p.m. OK GNU C++17 TESTS 30 343 4812800
140512784 skywalkert D Dec. 24, 2021, 6:10 p.m. OK GNU C++17 TESTS 30 358 48435200
140496236 Joysky D Dec. 24, 2021, 4:28 p.m. OK GNU C++17 TESTS 30 373 9625600
140504063 yuanhaowei D Dec. 24, 2021, 4:57 p.m. OK GNU C++17 TESTS 30 389 6451200
140516335 woml D Dec. 24, 2021, 6:48 p.m. OK GNU C++17 TESTS 30 389 10547200
140530810 xxafhixx D Dec. 25, 2021, 1:09 a.m. OK GNU C++17 TESTS 30 405 3993600
140515819 NegaTeeF D Dec. 24, 2021, 6:42 p.m. OK GNU C++17 (64) TESTS 30 296 5632000
140510744 yx20201301 D Dec. 24, 2021, 5:48 p.m. OK GNU C++17 (64) TESTS 30 296 17100800
140509124 yx20201301 D Dec. 24, 2021, 5:33 p.m. OK GNU C++17 (64) TESTS 30 326 18944000
140504204 Honey_Badger D Dec. 24, 2021, 4:57 p.m. OK GNU C++17 (64) TESTS 30 327 5632000
140509242 yx20201301 D Dec. 24, 2021, 5:34 p.m. OK GNU C++17 (64) TESTS 30 342 17100800
140496683 YouKn0wWho D Dec. 24, 2021, 4:30 p.m. OK GNU C++17 (64) TESTS 30 343 8806400
140508852 yx20201301 D Dec. 24, 2021, 5:32 p.m. OK GNU C++17 (64) TESTS 30 358 18944000
140507888 KADR D Dec. 24, 2021, 5:25 p.m. OK GNU C++17 (64) TESTS 30 373 22016000
140495424 narangkay D Dec. 24, 2021, 4:25 p.m. OK GNU C++17 (64) TESTS 30 389 10547200
140529524 ttttan D Dec. 25, 2021, 12:06 a.m. OK GNU C++17 (64) TESTS 30 389 17715200
140524565 p3rfect D Dec. 24, 2021, 8:59 p.m. OK GNU C++20 (64) TESTS 30 233 3993600
140531501 couplefire D Dec. 25, 2021, 1:33 a.m. OK GNU C++20 (64) TESTS 30 233 13721600
140539374 SaiAryan D Dec. 25, 2021, 4:51 a.m. OK GNU C++20 (64) TESTS 30 248 7987200
140541925 SaiAryan D Dec. 25, 2021, 5:30 a.m. OK GNU C++20 (64) TESTS 30 249 6758400
140509048 wisest D Dec. 24, 2021, 5:33 p.m. OK GNU C++20 (64) TESTS 30 249 6758400
140533455 Melonade D Dec. 25, 2021, 2:30 a.m. OK GNU C++20 (64) TESTS 30 264 6451200
140505097 achvanov D Dec. 24, 2021, 5:01 p.m. OK GNU C++20 (64) TESTS 30 265 7577600
140533818 syksykCCC D Dec. 25, 2021, 2:41 a.m. OK GNU C++20 (64) TESTS 30 265 16281600
140497928 351F44 D Dec. 24, 2021, 4:34 p.m. OK GNU C++20 (64) TESTS 30 280 3993600
140528599 Nanored D Dec. 24, 2021, 11:19 p.m. OK GNU C++20 (64) TESTS 30 327 24678400
140499385 anvorguesa D Dec. 24, 2021, 4:40 p.m. OK Go TESTS 30 1045 35430400
140510226 hiromi_ayase D Dec. 24, 2021, 5:43 p.m. OK Java 11 TESTS 30 654 19865600
140500482 kencho8128 D Dec. 24, 2021, 4:44 p.m. OK Java 11 TESTS 30 732 43110400
140535626 Ste D Dec. 25, 2021, 3:31 a.m. OK Java 11 TESTS 30 1216 64512000
140525293 dzhi D Dec. 24, 2021, 9:17 p.m. OK Java 11 TESTS 30 1528 13824000
140524983 dzhi D Dec. 24, 2021, 9:09 p.m. OK Java 11 TESTS 30 1653 13824000
140497434 martins D Dec. 24, 2021, 4:32 p.m. OK Java 11 TESTS 30 1965 103424000
140497718 fetetriste D Dec. 24, 2021, 4:33 p.m. OK Java 8 TESTS 30 514 24371200
140508184 kamranm D Dec. 24, 2021, 5:27 p.m. OK Java 8 TESTS 30 1029 85094400
140504308 kamranm D Dec. 24, 2021, 4:58 p.m. OK Java 8 TESTS 30 1122 81408000
140507955 kamranm D Dec. 24, 2021, 5:25 p.m. OK Java 8 TESTS 30 1341 176128000
140513667 PavelChadnov D Dec. 24, 2021, 6:19 p.m. OK Kotlin 1.4 TESTS 30 1996 138137600
140491289 Prostoegor239 D Dec. 24, 2021, 4:12 p.m. OK MS C++ 2017 TESTS 30 1825 38195200
140512794 toam D Dec. 24, 2021, 6:10 p.m. OK PyPy 3 TESTS 30 1762 56729600
140512184 toam D Dec. 24, 2021, 6:04 p.m. OK PyPy 3 TESTS 30 1871 56934400
140513211 toam D Dec. 24, 2021, 6:14 p.m. OK PyPy 3 TESTS 30 1933 67993600
140543366 coolstreaming D Dec. 25, 2021, 5:49 a.m. OK PyPy 3-64 TESTS 30 1419 69222400
140498928 eepsilon D Dec. 24, 2021, 4:38 p.m. OK PyPy 3-64 TESTS 30 1512 100147200
140530182 sansen D Dec. 25, 2021, 12:42 a.m. OK Rust 2021 TESTS 30 124 23859200
140510089 FakestAccount D Dec. 24, 2021, 5:42 p.m. OK Rust 2021 TESTS 30 1887 101785600

remove filters

Back to search problems