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 |
---|---|---|---|---|---|---|
1626 | Educational Codeforces Round 121 (Rated for Div. 2) | FINISHED | False | 7200 | 94836263 | Jan. 16, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1625 ) | E | Black and White Tree | PROGRAMMING | dp greedy trees |
B"You are given a tree consisting of n vertices. Some of the vertices (at least two) are black, all the other vertices are white. You place a chip on one of the vertices of the tree, and then perform the following operations: You are not allowed to choose the same black vertex y in two operations in a row (i. xe2 x80 x89e., for every two consecutive operations, the chosen black vertex should be different). You end your operations when the chip moves to the black vertex (if it is initially placed in a black vertex, you don't perform the operations at all), or when the number of performed operations exceeds 100^{500} . For every vertex i , you have to determine if there exists a (possibly empty) sequence of operations that moves the chip to some black vertex, if the chip is initially placed on the vertex i . The first line contains one integer n ( 3 <= n <= 3 cdot 10^5 ) -- the number of vertices in the tree. The second line contains n integers c_1, c_2, ... , c_n ( 0 <= c_i <= 1 ), where c_i = 0 means that the i -th vertex is white, and c_i = 1 means that the i -th vertex is black. At least two values of c_i are equal to 1 . Then n-1 lines follow, each of them contains two integers u_i and v_i ( 1 <= u_i, v_i <= n ; u_i ne v_i ) -- the endpoints of some edge. These edges form a tree. Print n integers. The i -th integer should be equal to 1 if there exists a (possibly empty) sequence of operations that moves the chip to some black vertex if it is placed on the vertex i , and 0 if no such sequence of operations exists. "... |
99136 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
143033267 | spsicio | E | Jan. 16, 2022, 6:06 p.m. | OK | GNU C++14 | TESTS | 63 | 296 | 14336000 | ||
143063720 | Serval | E | Jan. 17, 2022, 5:38 a.m. | OK | GNU C++14 | TESTS | 63 | 312 | 21913600 | ||
143047683 | Monster__Qi | E | Jan. 17, 2022, 2:12 a.m. | OK | GNU C++14 | TESTS | 63 | 343 | 16486400 | ||
143052133 | applese | E | Jan. 17, 2022, 3:29 a.m. | OK | GNU C++14 | TESTS | 63 | 373 | 14745600 | ||
143028760 | THE__BUG | E | Jan. 16, 2022, 5:27 p.m. | OK | GNU C++14 | TESTS | 63 | 373 | 17203200 | ||
143043784 | _Golem_ | E | Jan. 17, 2022, midnight | OK | GNU C++14 | TESTS | 63 | 373 | 23449600 | ||
143044341 | ZH_comld | E | Jan. 17, 2022, 12:27 a.m. | OK | GNU C++14 | TESTS | 63 | 374 | 19353600 | ||
143047738 | tiinthp | E | Jan. 17, 2022, 2:14 a.m. | OK | GNU C++14 | TESTS | 63 | 374 | 22016000 | ||
143044796 | _Diu_ | E | Jan. 17, 2022, 12:45 a.m. | OK | GNU C++14 | TESTS | 63 | 390 | 17203200 | ||
143043867 | pasa3232 | E | Jan. 17, 2022, 12:05 a.m. | OK | GNU C++14 | TESTS | 63 | 390 | 17203200 | ||
143021335 | fallleaves01 | E | Jan. 16, 2022, 4:58 p.m. | OK | GNU C++17 | TESTS | 63 | 233 | 20889600 | ||
143045718 | cjy2003 | E | Jan. 17, 2022, 1:20 a.m. | OK | GNU C++17 | TESTS | 63 | 249 | 23040000 | ||
143059053 | xyl1234 | E | Jan. 17, 2022, 4:52 a.m. | OK | GNU C++17 | TESTS | 63 | 265 | 38297600 | ||
143018698 | Dmitri_Shostakovich | E | Jan. 16, 2022, 3:42 p.m. | OK | GNU C++17 | TESTS | 63 | 343 | 18841600 | ||
143045385 | OMG_link | E | Jan. 17, 2022, 1:08 a.m. | OK | GNU C++17 | TESTS | 63 | 343 | 20377600 | ||
143054350 | acwing_meow | E | Jan. 17, 2022, 4 a.m. | OK | GNU C++17 | TESTS | 63 | 343 | 23756800 | ||
143019743 | potato167 | E | Jan. 16, 2022, 3:44 p.m. | OK | GNU C++17 | TESTS | 63 | 374 | 18841600 | ||
143047920 | HelloImTuan | E | Jan. 17, 2022, 2:17 a.m. | OK | GNU C++17 | TESTS | 63 | 389 | 17203200 | ||
143046929 | annotshy | E | Jan. 17, 2022, 1:53 a.m. | OK | GNU C++17 | TESTS | 63 | 389 | 17510400 | ||
143025569 | HarryPottersLuck | E | Jan. 16, 2022, 5:09 p.m. | OK | GNU C++17 | TESTS | 63 | 389 | 17817600 | ||
143044885 | Fysty | E | Jan. 17, 2022, 12:50 a.m. | OK | GNU C++17 (64) | TESTS | 63 | 265 | 34099200 | ||
143034415 | Temmie | E | Jan. 16, 2022, 6:18 p.m. | OK | GNU C++17 (64) | TESTS | 63 | 311 | 28467200 | ||
143028695 | insurgentes | E | Jan. 16, 2022, 5:27 p.m. | OK | GNU C++17 (64) | TESTS | 63 | 342 | 29900800 | ||
143049598 | 93wilsonlu | E | Jan. 17, 2022, 2:50 a.m. | OK | GNU C++17 (64) | TESTS | 63 | 358 | 27545600 | ||
143052867 | nhphucqt | E | Jan. 17, 2022, 3:39 a.m. | OK | GNU C++17 (64) | TESTS | 63 | 358 | 31539200 | ||
143042245 | huangxiaohua | E | Jan. 16, 2022, 10:45 p.m. | OK | GNU C++17 (64) | TESTS | 63 | 358 | 32768000 | ||
143020832 | Sofapuden | E | Jan. 16, 2022, 4:58 p.m. | OK | GNU C++17 (64) | TESTS | 63 | 358 | 32972800 | ||
143031206 | _Enigma__ | E | Jan. 16, 2022, 5:47 p.m. | OK | GNU C++17 (64) | TESTS | 63 | 373 | 23654400 | ||
143039467 | moo. | E | Jan. 16, 2022, 8:50 p.m. | OK | GNU C++17 (64) | TESTS | 63 | 373 | 27545600 | ||
143043281 | samcpp | E | Jan. 16, 2022, 11:37 p.m. | OK | GNU C++17 (64) | TESTS | 63 | 374 | 40857600 | ||
143058659 | Lavine | E | Jan. 17, 2022, 4:48 a.m. | OK | GNU C++20 (64) | TESTS | 63 | 296 | 30924800 | ||
143055569 | nxhieu | E | Jan. 17, 2022, 4:15 a.m. | OK | GNU C++20 (64) | TESTS | 63 | 311 | 30617600 | ||
143042511 | guperman | E | Jan. 16, 2022, 10:58 p.m. | OK | GNU C++20 (64) | TESTS | 63 | 311 | 34918400 | ||
143026855 | windazz | E | Jan. 16, 2022, 5:15 p.m. | OK | GNU C++20 (64) | TESTS | 63 | 312 | 27238400 | ||
143029077 | xdO_o | E | Jan. 16, 2022, 5:30 p.m. | OK | GNU C++20 (64) | TESTS | 63 | 327 | 24371200 | ||
143058396 | arwaeystoamneg | E | Jan. 17, 2022, 4:46 a.m. | OK | GNU C++20 (64) | TESTS | 63 | 327 | 30617600 | ||
143063181 | WA_King | E | Jan. 17, 2022, 5:33 a.m. | OK | GNU C++20 (64) | TESTS | 63 | 327 | 48128000 | ||
143045213 | generic_placeholder_name | E | Jan. 17, 2022, 1:02 a.m. | OK | GNU C++20 (64) | TESTS | 63 | 342 | 16793600 | ||
143024275 | Nea1 | E | Jan. 16, 2022, 5:05 p.m. | OK | GNU C++20 (64) | TESTS | 63 | 342 | 30208000 | ||
143038583 | JocalAreaNetwork | E | Jan. 16, 2022, 8:21 p.m. | OK | GNU C++20 (64) | TESTS | 63 | 342 | 31641600 | ||
143039711 | meooow | E | Jan. 16, 2022, 8:59 p.m. | OK | Haskell | TESTS | 63 | 2215 | 254259200 | ||
143025213 | saptarshi1729 | E | Jan. 16, 2022, 5:08 p.m. | OK | Java 11 | TESTS | 63 | 1075 | 198246400 | ||
143026818 | Mathematiker | E | Jan. 16, 2022, 5:15 p.m. | OK | Java 11 | TESTS | 63 | 1918 | 71168000 | ||
143044250 | dzhi | E | Jan. 17, 2022, 12:23 a.m. | OK | Java 11 | TESTS | 63 | 2059 | 84275200 | ||
143026313 | AndreySiunov | E | Jan. 16, 2022, 5:13 p.m. | OK | Java 8 | TESTS | 63 | 1014 | 74752000 | ||
143025844 | AC_sahER | E | Jan. 16, 2022, 5:11 p.m. | OK | MS C++ 2017 | TESTS | 63 | 1060 | 49152000 | ||
143022940 | AC_sahER | E | Jan. 16, 2022, 5:01 p.m. | OK | MS C++ 2017 | TESTS | 63 | 1076 | 48640000 | ||
143043681 | Prostoegor239 | E | Jan. 16, 2022, 11:55 p.m. | OK | MS C++ 2017 | TESTS | 63 | 1387 | 43417600 | ||
143043490 | OLOGY | E | Jan. 16, 2022, 11:47 p.m. | OK | PyPy 2 | TESTS | 63 | 841 | 73113600 | ||
143038597 | hxu10 | E | Jan. 16, 2022, 8:22 p.m. | OK | PyPy 3 | TESTS | 63 | 1575 | 113664000 | ||
143033261 | DBabichev | E | Jan. 16, 2022, 6:06 p.m. | OK | PyPy 3-64 | TESTS | 63 | 1762 | 138956800 | ||
143038737 | hxu10 | E | Jan. 16, 2022, 8:26 p.m. | OK | PyPy 3-64 | TESTS | 63 | 1762 | 211660800 | ||
143032092 | DBabichev | E | Jan. 16, 2022, 5:54 p.m. | OK | PyPy 3-64 | TESTS | 63 | 3790 | 139366400 | ||
143043503 | OLOGY | E | Jan. 16, 2022, 11:47 p.m. | OK | Python 2 | TESTS | 63 | 2620 | 64000000 | ||
143047641 | sansen | E | Jan. 17, 2022, 2:11 a.m. | OK | Rust 2021 | TESTS | 63 | 343 | 58163200 |
Back to search problems