Codeforces Round 805 (Div. 3)

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 79716263 July 10, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5593 ) G1 Passable Paths (easy version) PROGRAMMING data structures dfs and similar sortings trees

B'This is an easy 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 <= 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, an'...

Tutorials

104763

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
163612814 1093789167 G1 July 11, 2022, 2:21 a.m. OK Clang++20 Diagnostics TESTS 57 1107 30515200
163620913 AIM-9M G1 July 11, 2022, 4:21 a.m. OK GNU C++14 TESTS 57 155 19558400
163611289 momomodalao G1 July 11, 2022, 1:54 a.m. OK GNU C++14 TESTS 57 156 12800000
163618860 rohitt28 G1 July 11, 2022, 3:49 a.m. OK GNU C++14 TESTS 57 186 11878400
163599372 Bedo_Sayed G1 July 10, 2022, 8:40 p.m. OK GNU C++14 TESTS 57 186 19763200
163603015 Ismail_Alrefai G1 July 10, 2022, 10:11 p.m. OK GNU C++14 TESTS 57 202 12288000
163621790 bla_bla_blu_blu G1 July 11, 2022, 4:35 a.m. OK GNU C++14 TESTS 57 202 18636800
163592088 hk_shenoy G1 July 10, 2022, 6:39 p.m. OK GNU C++14 TESTS 52 202 26624000
163591926 ipsit01 G1 July 10, 2022, 6:37 p.m. OK GNU C++14 TESTS 52 233 29900800
163584424 Syf2020 G1 July 10, 2022, 5:18 p.m. OK GNU C++14 TESTS 52 264 25088000
163585926 wsalkri G1 July 10, 2022, 5:31 p.m. OK GNU C++14 TESTS 52 280 23347200
163587557 Bobocan G1 July 10, 2022, 5:47 p.m. OK GNU C++17 TESTS 52 93 28876800
163596415 Bobocan G1 July 10, 2022, 7:44 p.m. OK GNU C++17 TESTS 52 93 76902400
163618083 Miaky G1 July 11, 2022, 3:38 a.m. OK GNU C++17 TESTS 57 171 15257600
163627755 bqmnhat0510 G1 July 11, 2022, 5:51 a.m. OK GNU C++17 TESTS 57 171 20172800
163626381 AJIT_KUMAR_ G1 July 11, 2022, 5:36 a.m. OK GNU C++17 TESTS 57 171 23449600
163583849 evresed G1 July 10, 2022, 5:14 p.m. OK GNU C++17 TESTS 52 171 45260800
163610387 ggghj G1 July 11, 2022, 1:37 a.m. OK GNU C++17 TESTS 57 186 14643200
163603957 emailam G1 July 10, 2022, 10:38 p.m. OK GNU C++17 TESTS 57 186 15462400
163583691 Yana_Bg G1 July 10, 2022, 5:13 p.m. OK GNU C++17 TESTS 52 186 21811200
163599077 __mineenim__ G1 July 10, 2022, 8:34 p.m. OK GNU C++17 TESTS 52 187 10240000
163596245 shubhamgrg1000 G1 July 10, 2022, 7:41 p.m. OK GNU C++17 (64) TESTS 52 187 34611200
163612760 zycac G1 July 11, 2022, 2:20 a.m. OK GNU C++17 (64) TESTS 57 202 28876800
163619032 Chan_shang G1 July 11, 2022, 3:51 a.m. OK GNU C++17 (64) TESTS 57 217 35430400
163621504 Cantor. G1 July 11, 2022, 4:31 a.m. OK GNU C++17 (64) TESTS 57 217 43827200
163611670 Messywind G1 July 11, 2022, 2 a.m. OK GNU C++17 (64) TESTS 57 217 53760000
163609558 Sorry_Messywind G1 July 11, 2022, 1:21 a.m. OK GNU C++17 (64) TESTS 57 217 53760000
163623515 alwyn G1 July 11, 2022, 4:59 a.m. OK GNU C++17 (64) TESTS 57 217 60723200
163628522 NooB_NO_1 G1 July 11, 2022, 6 a.m. OK GNU C++17 (64) TESTS 57 233 43212800
163584553 Golden G1 July 10, 2022, 5:19 p.m. OK GNU C++17 (64) TESTS 52 234 30515200
163609527 vegetable_king G1 July 11, 2022, 1:21 a.m. OK GNU C++17 (64) TESTS 57 264 39219200
163583550 LZVSDY G1 July 10, 2022, 5:12 p.m. OK GNU C++20 (64) TESTS 52 108 26316800
163604040 Salah2Eddin G1 July 10, 2022, 10:40 p.m. OK GNU C++20 (64) TESTS 57 124 27443200
163613090 A_king G1 July 11, 2022, 2:26 a.m. OK GNU C++20 (64) TESTS 57 140 36966400
163600291 javad_asadi G1 July 10, 2022, 8:59 p.m. OK GNU C++20 (64) TESTS 57 155 27955200
163584247 Kaushal_26 G1 July 10, 2022, 5:17 p.m. OK GNU C++20 (64) TESTS 52 155 37580800
163598153 JaberSH1 G1 July 10, 2022, 8:16 p.m. OK GNU C++20 (64) TESTS 52 156 14438400
163597218 litchi_juice69 G1 July 10, 2022, 7:59 p.m. OK GNU C++20 (64) TESTS 52 156 42496000
163606105 Tansho G1 July 10, 2022, 11:51 p.m. OK GNU C++20 (64) TESTS 57 171 13209600
163607084 ArijitGD G1 July 11, 2022, 12:23 a.m. OK GNU C++20 (64) TESTS 57 171 33484800
163584586 Swapnil06 G1 July 10, 2022, 5:20 p.m. OK GNU C++20 (64) TESTS 52 186 21094400
163589888 Spidey2182 G1 July 10, 2022, 6:12 p.m. OK Java 11 TESTS 52 452 49049600
163601709 wat2 G1 July 10, 2022, 9:35 p.m. OK Java 11 TESTS 57 826 65024000
163588432 dzhi G1 July 10, 2022, 5:56 p.m. OK Java 11 TESTS 52 1060 88883200
163612650 WrongAnswerOnTestCase2 G1 July 11, 2022, 2:18 a.m. OK Java 8 TESTS 57 701 68198400
163595536 O_E G1 July 10, 2022, 7:30 p.m. OK Java 8 TESTS 52 935 85811200
163589391 UniversalAdmin G1 July 10, 2022, 6:06 p.m. OK Java 8 TESTS 52 1372 261836800
163583242 fatant G1 July 10, 2022, 5:10 p.m. OK MS C++ 2017 TESTS 52 732 28672000
163593747 SophieHatter G1 July 10, 2022, 7:02 p.m. OK PyPy 3-64 TESTS 52 920 135475200
163602803 Aksnov G1 July 10, 2022, 10:05 p.m. OK PyPy 3-64 TESTS 57 920 206950400
163600973 unknownSolver G1 July 10, 2022, 9:15 p.m. OK PyPy 3-64 TESTS 57 1154 86118400
163604093 Avanta G1 July 10, 2022, 10:43 p.m. OK Rust 2021 TESTS 57 109 36864000
163604152 Avanta G1 July 10, 2022, 10:45 p.m. OK Rust 2021 TESTS 57 124 36966400
163604105 Avanta G1 July 10, 2022, 10:43 p.m. OK Rust 2021 TESTS 57 139 36864000

remove filters

Back to search problems