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 |
---|---|---|---|---|---|---|
1795 | Educational Codeforces Round 143 (Rated for Div. 2) | FINISHED | False | 7200 | 60708263 | Feb. 16, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1146 ) | F | Blocking Chips | PROGRAMMING | binary search dfs and similar dp greedy |
B"You are given a tree, consisting of n vertices. There are k chips, placed in vertices a_1, a_2, ... , a_k . All a_i are distinct. Vertices a_1, a_2, ... , a_k are colored black initially. The remaining vertices are white. You are going to play a game where you perform some moves (possibly, zero). On the i -th move ( 1 -indexed) you are going to move the ((i - 1) bmod k + 1) -st chip from its current vertex to an adjacent white vertex and color that vertex black. So, if k=3 , you move chip 1 on move 1 , chip 2 on move 2 , chip 3 on move 3 , chip 1 on move 4 , chip 2 on move 5 and so on. If there is no adjacent white vertex, then the game ends. What's the maximum number of moves you can perform? The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The first line of each testcase contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of vertices of the tree. Each of the next n - 1 lines contains two integers v and u ( 1 <= v, u <= n ) -- the descriptions of the edges. The given edges form a tree. The next line contains a single integer k ( 1 <= k <= n ) -- the number of chips. The next line contains k integers a_1, a_2, ... , a_k ( 1 <= a_i <= n ) -- the vertices with the chips. All a_i are distinct. The sum of n over all testcases doesn't exceed 2 cdot 10^5 . For each testcase, print a single integer -- the maximum number of moves you can perform. "... |
112963 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
193955175 | Fufu_ | F | Feb. 17, 2023, 5:35 a.m. | OK | GNU C++14 | TESTS | 50 | 218 | 10444800 | ||
193945322 | JoesSR | F | Feb. 17, 2023, 2:14 a.m. | OK | GNU C++14 | TESTS | 50 | 468 | 16793600 | ||
193918089 | Valters07 | F | Feb. 16, 2023, 6:03 p.m. | OK | GNU C++14 | TESTS | 50 | 623 | 18022400 | ||
193948814 | __stick | F | Feb. 17, 2023, 3:42 a.m. | OK | GNU C++14 | TESTS | 50 | 655 | 19865600 | ||
193937697 | SergiiGolovko | F | Feb. 16, 2023, 10:39 p.m. | OK | GNU C++14 | TESTS | 50 | 686 | 26521600 | ||
193914344 | mod998244353 | F | Feb. 16, 2023, 5:29 p.m. | OK | GNU C++14 | TESTS | 50 | 717 | 20377600 | ||
193898444 | Violet_Holmes | F | Feb. 16, 2023, 4:18 p.m. | OK | GNU C++14 | TESTS | 50 | 748 | 17612800 | ||
193905293 | Raiden_Ei_ | F | Feb. 16, 2023, 4:34 p.m. | OK | GNU C++14 | TESTS | 50 | 748 | 25395200 | ||
193943124 | Oscaryang | F | Feb. 17, 2023, 1:13 a.m. | OK | GNU C++14 | TESTS | 50 | 779 | 12492800 | ||
193898988 | peop1e_ | F | Feb. 16, 2023, 4:19 p.m. | OK | GNU C++14 | TESTS | 50 | 795 | 30003200 | ||
193924807 | sashwat_482002 | F | Feb. 16, 2023, 7:18 p.m. | OK | GNU C++17 | TESTS | 50 | 202 | 10649600 | ||
193956741 | TwelveThread | F | Feb. 17, 2023, 5:59 a.m. | OK | GNU C++17 | TESTS | 50 | 218 | 10649600 | ||
193923577 | ash_98 | F | Feb. 16, 2023, 7:04 p.m. | OK | GNU C++17 | TESTS | 50 | 218 | 11161600 | ||
193896772 | liympanda | F | Feb. 16, 2023, 4:13 p.m. | OK | GNU C++17 | TESTS | 50 | 343 | 11673600 | ||
193912453 | marinareda | F | Feb. 16, 2023, 5:13 p.m. | OK | GNU C++17 | TESTS | 50 | 592 | 18022400 | ||
193937672 | arthur.nascimento | F | Feb. 16, 2023, 10:39 p.m. | OK | GNU C++17 | TESTS | 50 | 608 | 18636800 | ||
193911916 | orangecalculator | F | Feb. 16, 2023, 5:09 p.m. | OK | GNU C++17 | TESTS | 50 | 624 | 10854400 | ||
193925154 | lotusblume | F | Feb. 16, 2023, 7:22 p.m. | OK | GNU C++17 | TESTS | 50 | 639 | 19660800 | ||
193955963 | 287029 | F | Feb. 17, 2023, 5:48 a.m. | OK | GNU C++17 | TESTS | 50 | 639 | 20684800 | ||
193938382 | Julian | F | Feb. 16, 2023, 10:56 p.m. | OK | GNU C++17 | TESTS | 50 | 670 | 15769600 | ||
193942805 | enslaved | F | Feb. 17, 2023, 1:04 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 311 | 33177600 | ||
193897826 | chennengkuan | F | Feb. 16, 2023, 4:16 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 436 | 120524800 | ||
193923601 | FatihSolak | F | Feb. 16, 2023, 7:04 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 468 | 29900800 | ||
193896780 | ikefumy | F | Feb. 16, 2023, 4:13 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 670 | 28160000 | ||
193914538 | xyl1234 | F | Feb. 16, 2023, 5:30 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 701 | 84992000 | ||
193920942 | lukameladze1 | F | Feb. 16, 2023, 6:33 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 717 | 34713600 | ||
193948738 | Giga_Cronos | F | Feb. 17, 2023, 3:40 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 748 | 29696000 | ||
193920910 | lukameladze1 | F | Feb. 16, 2023, 6:32 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 763 | 34713600 | ||
193912994 | SA01 | F | Feb. 16, 2023, 5:17 p.m. | OK | GNU C++17 (64) | TESTS | 50 | 763 | 35737600 | ||
193943297 | Pointy | F | Feb. 17, 2023, 1:19 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 764 | 43520000 | ||
193915805 | GusFring | F | Feb. 16, 2023, 5:42 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 171 | 13414400 | ||
193946645 | bkifhr6 | F | Feb. 17, 2023, 2:48 a.m. | OK | GNU C++20 (64) | TESTS | 50 | 186 | 22016000 | ||
193946505 | sorry_thebighead | F | Feb. 17, 2023, 2:45 a.m. | OK | GNU C++20 (64) | TESTS | 50 | 202 | 22016000 | ||
193914123 | abc864197532 | F | Feb. 16, 2023, 5:27 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 202 | 39116800 | ||
193946644 | vjudge4 | F | Feb. 17, 2023, 2:48 a.m. | OK | GNU C++20 (64) | TESTS | 50 | 217 | 22016000 | ||
193908625 | Fly_elephant | F | Feb. 16, 2023, 4:49 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 265 | 112947200 | ||
193953086 | Tobo | F | Feb. 17, 2023, 5:03 a.m. | OK | GNU C++20 (64) | TESTS | 50 | 373 | 27648000 | ||
193905033 | AbdelmagedNour | F | Feb. 16, 2023, 4:33 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 390 | 26726400 | ||
193911341 | AbdelmagedNour | F | Feb. 16, 2023, 5:05 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 405 | 18636800 | ||
193938300 | danx | F | Feb. 16, 2023, 10:54 p.m. | OK | GNU C++20 (64) | TESTS | 50 | 468 | 20889600 | ||
193898335 | misorin | F | Feb. 16, 2023, 4:17 p.m. | OK | PyPy 3 | TESTS | 50 | 436 | 31948800 | ||
193899891 | Heltion | F | Feb. 16, 2023, 4:21 p.m. | OK | PyPy 3 | TESTS | 50 | 1871 | 38400000 | ||
193948625 | SoleProprietor | F | Feb. 17, 2023, 3:38 a.m. | OK | PyPy 3-64 | TESTS | 50 | 716 | 73113600 | ||
193955409 | Little_Sheep_Yawn | F | Feb. 17, 2023, 5:39 a.m. | OK | PyPy 3-64 | TESTS | 50 | 1825 | 129536000 |
Back to search problems