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 |
---|---|---|---|---|---|---|
1702 | Codeforces Round 805 (Div. 3) | FINISHED | False | 8100 | 74359499 | July 10, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4720 ) | G2 | Passable Paths (hard version) | PROGRAMMING | bitmasks data structures dfs and similar dp sortings trees |
B'This is a hard version of the problem. The only difference between an easy and a hard version is in the number of queries. Polycarp grew a tree from n vertices. We remind you that a tree of n vertices is an undirected connected graph of n vertices and n-1 edges that does not contain cycles. He calls a set of vertices passable if there is such a path in the tree that passes through each vertex of this set without passing through any edge twice. The path can visit other vertices (not from this set). In other words, a set of vertices is called passable if there is a simple path that passes through all the vertices of this set (and possibly some other). For example, for a tree below sets {3, 2, 5 } , {1, 5, 4 } , {1, 4 } are passable, and {1, 3, 5 } , {1, 2, 3, 4, 5 } are not. Polycarp asks you to answer q queries. Each query is a set of vertices. For each query, you need to determine whether the corresponding set of vertices is passable. The first line of input contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- number of vertices. Following n - 1 lines a description of the tree.. Each line contains two integers u and v ( 1 <= u, v <= n , u ne v ) -- indices of vertices connected by an edge. Following line contains single integer q ( 1 <= q <= 10^5 ) -- number of queries. The following 2 cdot q lines contain descriptions of sets. The first line of the description contains an integer k ( 1 <= k <= n ) -- the size of the set. The second line of the description contains k of distinct integers p_1, p_2, ... , p_k ( 1 <= p_i <= n ) -- indices of the vertices of the set. It is guaranteed that the sum of k values for all queries does not exceed 2 cdot 10^5 . Output q lines, each of which contains the answer to the corresponding query. As an answer, output "YES" if the set is passable, '... |
104763 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
163584857 | meyi | G2 | July 10, 2022, 5:22 p.m. | OK | GNU C++14 | TESTS | 97 | 62 | 19353600 | ||
163609598 | Qing_LKYi | G2 | July 11, 2022, 1:22 a.m. | OK | GNU C++14 | TESTS | 97 | 186 | 17305600 | ||
163618970 | Sand_Tripper | G2 | July 11, 2022, 3:50 a.m. | OK | GNU C++14 | TESTS | 97 | 217 | 22835200 | ||
163584021 | meyi | G2 | July 10, 2022, 5:15 p.m. | OK | GNU C++14 | TESTS | 97 | 233 | 54681600 | ||
163601235 | Bedo_Sayed | G2 | July 10, 2022, 9:23 p.m. | OK | GNU C++14 | TESTS | 97 | 264 | 50483200 | ||
163599390 | Bedo_Sayed | G2 | July 10, 2022, 8:40 p.m. | OK | GNU C++14 | TESTS | 97 | 280 | 50483200 | ||
163603156 | stan23456 | G2 | July 10, 2022, 10:15 p.m. | OK | GNU C++14 | TESTS | 97 | 295 | 39321600 | ||
163609582 | PolarAid | G2 | July 11, 2022, 1:22 a.m. | OK | GNU C++14 | TESTS | 97 | 296 | 30924800 | ||
163597981 | caan_do | G2 | July 10, 2022, 8:13 p.m. | OK | GNU C++14 | TESTS | 97 | 296 | 42598400 | ||
163585328 | 287029 | G2 | July 10, 2022, 5:26 p.m. | OK | GNU C++14 | TESTS | 97 | 311 | 35635200 | ||
163595778 | Bobocan | G2 | July 10, 2022, 7:34 p.m. | OK | GNU C++17 | TESTS | 97 | 78 | 76902400 | ||
163587531 | Bobocan | G2 | July 10, 2022, 5:46 p.m. | OK | GNU C++17 | TESTS | 97 | 124 | 28876800 | ||
163584840 | evresed | G2 | July 10, 2022, 5:22 p.m. | OK | GNU C++17 | TESTS | 97 | 202 | 45158400 | ||
163584290 | evresed | G2 | July 10, 2022, 5:17 p.m. | OK | GNU C++17 | TESTS | 97 | 202 | 45977600 | ||
163611682 | Bucketsmith | G2 | July 11, 2022, 2 a.m. | OK | GNU C++17 | TESTS | 97 | 217 | 22016000 | ||
163618717 | icey_z | G2 | July 11, 2022, 3:47 a.m. | OK | GNU C++17 | TESTS | 97 | 218 | 23552000 | ||
163622965 | lessthanleast | G2 | July 11, 2022, 4:52 a.m. | OK | GNU C++17 | TESTS | 97 | 249 | 31129600 | ||
163583527 | Hoang1264589 | G2 | July 10, 2022, 5:12 p.m. | OK | GNU C++17 | TESTS | 97 | 249 | 48640000 | ||
163603690 | danieli | G2 | July 10, 2022, 10:30 p.m. | OK | GNU C++17 | TESTS | 97 | 264 | 45670400 | ||
163608937 | Sorry_Messywind | G2 | July 11, 2022, 1:09 a.m. | OK | GNU C++17 | TESTS | 97 | 265 | 46694400 | ||
163624453 | gqf123 | G2 | July 11, 2022, 5:12 a.m. | OK | GNU C++17 (64) | TESTS | 97 | 202 | 26521600 | ||
163609159 | Sorry_Messywind | G2 | July 11, 2022, 1:14 a.m. | OK | GNU C++17 (64) | TESTS | 97 | 217 | 56320000 | ||
163611679 | Messywind | G2 | July 11, 2022, 2 a.m. | OK | GNU C++17 (64) | TESTS | 97 | 233 | 53760000 | ||
163609543 | Sorry_Messywind | G2 | July 11, 2022, 1:21 a.m. | OK | GNU C++17 (64) | TESTS | 97 | 233 | 53760000 | ||
163584727 | MuhammadHassan | G2 | July 10, 2022, 5:21 p.m. | OK | GNU C++17 (64) | TESTS | 97 | 248 | 42496000 | ||
163628495 | NooB_NO_1 | G2 | July 11, 2022, 5:59 a.m. | OK | GNU C++17 (64) | TESTS | 97 | 249 | 43212800 | ||
163628394 | bashkort | G2 | July 11, 2022, 5:58 a.m. | OK | GNU C++17 (64) | TESTS | 97 | 264 | 46080000 | ||
163623893 | alwyn | G2 | July 11, 2022, 5:04 a.m. | OK | GNU C++17 (64) | TESTS | 97 | 264 | 59904000 | ||
163623530 | alwyn | G2 | July 11, 2022, 4:59 a.m. | OK | GNU C++17 (64) | TESTS | 97 | 264 | 60723200 | ||
163609531 | vegetable_king | G2 | July 11, 2022, 1:21 a.m. | OK | GNU C++17 (64) | TESTS | 97 | 280 | 39219200 | ||
163613078 | A_king | G2 | July 11, 2022, 2:25 a.m. | OK | GNU C++20 (64) | TESTS | 97 | 140 | 36966400 | ||
163627598 | Wqk_Love_Lfy | G2 | July 11, 2022, 5:49 a.m. | OK | GNU C++20 (64) | TESTS | 97 | 171 | 30310400 | ||
163623487 | ingingin | G2 | July 11, 2022, 4:58 a.m. | OK | GNU C++20 (64) | TESTS | 97 | 171 | 39014400 | ||
163628094 | grapo_Oranges | G2 | July 11, 2022, 5:55 a.m. | OK | GNU C++20 (64) | TESTS | 97 | 186 | 34816000 | ||
163618406 | nullccxsysiyi | G2 | July 11, 2022, 3:42 a.m. | OK | GNU C++20 (64) | TESTS | 97 | 186 | 35942400 | ||
163585333 | HK_G11 | G2 | July 10, 2022, 5:26 p.m. | OK | GNU C++20 (64) | TESTS | 97 | 187 | 27238400 | ||
163605526 | Ivan_len | G2 | July 10, 2022, 11:30 p.m. | OK | GNU C++20 (64) | TESTS | 97 | 187 | 46489600 | ||
163593725 | _Stefan_ | G2 | July 10, 2022, 7:02 p.m. | OK | GNU C++20 (64) | TESTS | 97 | 202 | 25907200 | ||
163593840 | despair_101 | G2 | July 10, 2022, 7:04 p.m. | OK | GNU C++20 (64) | TESTS | 97 | 202 | 28876800 | ||
163627891 | Leokkk17 | G2 | July 11, 2022, 5:52 a.m. | OK | GNU C++20 (64) | TESTS | 97 | 202 | 30310400 | ||
163593044 | dzhi | G2 | July 10, 2022, 6:52 p.m. | OK | Java 11 | TESTS | 97 | 997 | 118681600 | ||
163592518 | dzhi | G2 | July 10, 2022, 6:45 p.m. | OK | Java 11 | TESTS | 97 | 1075 | 118681600 | ||
163621044 | jack.t.y.wu | G2 | July 11, 2022, 4:24 a.m. | OK | Java 11 | TESTS | 97 | 1076 | 118988800 | ||
163624988 | merlin_ | G2 | July 11, 2022, 5:19 a.m. | OK | Java 17 | TESTS | 97 | 1044 | 112332800 | ||
163595551 | O_E | G2 | July 10, 2022, 7:30 p.m. | OK | Java 8 | TESTS | 97 | 1029 | 85811200 | ||
163589290 | UniversalAdmin | G2 | July 10, 2022, 6:05 p.m. | OK | Java 8 | TESTS | 97 | 1279 | 261836800 |
Back to search problems