Codeforces Round 800 (Div. 1)

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
1693 Codeforces Round 800 (Div. 1) FINISHED False 7200 76433099 June 16, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8555 ) B Fake Plastic Trees PROGRAMMING dfs and similar dp greedy trees 1700

B"We are given a rooted tree consisting of n vertices numbered from 1 to n . The root of the tree is the vertex 1 and the parent of the vertex v is p_v . There is a number written on each vertex, initially all numbers are equal to 0 . Let's denote the number written on the vertex v as a_v . For each v , we want a_v to be between l_v and r_v (l_v <= q a_v <= q r_v) . In a single operation we do the following: What's the minimum number of operations needed to achieve our goal? The first line contains an integer t (1 <= t <= 1000) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n (2 <= n <= 2 cdot 10^5) -- the number of the vertices in the tree. The second line of each test case contains n - 1 integers, p_2, p_3, ldots, p_n (1 <= q p_i < i) , where p_i denotes the parent of the vertex i . The i -th of the following n lines contains two integers l_i and r_i (1 <= l_i <= r_i <= 10^9) . It is guaranteed that the sum of n over all test cases doesn't exceed 2 cdot 10^5 . For each test case output the minimum number of operations needed. In the first test case, we can achieve the goal with a single operation: choose v = 2 and c = [1, 2] , resulting in a_1 = 1, a_2 = 2 . In the second test case, we can achieve the goal with two operations: first, choose v = 2 and c = [3, 3] , resulting in a_1 = 3, a_2 = 3, a_3 = 0 . Then, choose v = 3, c = [2, 7] , resulting in a_1 = 5, a_2 = 3, a_3 = 7 . "...

Tutorials

Codeforces Round #800 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
160851608 mban259 B June 16, 2022, 3:16 p.m. OK C# 10 TESTS 30 187 35942400 1700
160845027 Gassa B June 16, 2022, 3:03 p.m. OK D TESTS 30 187 24268800 1700
160859798 hos.lyric B June 16, 2022, 3:34 p.m. OK D TESTS 30 249 24371200 1700
160845635 Tyyyyyy B June 16, 2022, 3:05 p.m. OK GNU C++14 TESTS 30 46 9318400 1700
160855748 Sol3 B June 16, 2022, 3:25 p.m. OK GNU C++14 TESTS 30 46 12492800 1700
160857917 jiangbowen B June 16, 2022, 3:29 p.m. OK GNU C++14 TESTS 30 46 13209600 1700
160841097 cunzai_zsy0531 B June 16, 2022, 2:57 p.m. OK GNU C++14 TESTS 30 77 11264000 1700
160922837 kkkqqk B June 17, 2022, 5:31 a.m. OK GNU C++14 TESTS 30 124 6348800 1700
160840507 liqingyang B June 16, 2022, 2:56 p.m. OK GNU C++14 TESTS 30 124 7065600 1700
160838527 FutureGadgetLaboratory B June 16, 2022, 2:53 p.m. OK GNU C++14 TESTS 30 124 7372800 1700
160839048 Crabby_Maskiv B June 16, 2022, 2:54 p.m. OK GNU C++14 TESTS 30 124 7884800 1700
160864658 feecIe6418 B June 16, 2022, 3:45 p.m. OK GNU C++14 TESTS 30 139 3993600 1700
160837871 happyguy656 B June 16, 2022, 2:52 p.m. OK GNU C++14 TESTS 30 139 5120000 1700
160841355 cxy004 B June 16, 2022, 2:57 p.m. OK GNU C++17 TESTS 30 124 3993600 1700
160843979 acwing_meow B June 16, 2022, 3:02 p.m. OK GNU C++17 TESTS 30 124 6348800 1700
160847826 lddlinan B June 16, 2022, 3:09 p.m. OK GNU C++17 TESTS 30 124 6451200 1700
160841132 KroosTheKeenGlint B June 16, 2022, 2:57 p.m. OK GNU C++17 TESTS 30 139 6451200 1700
160915629 strwbrry B June 17, 2022, 3:07 a.m. OK GNU C++17 TESTS 30 139 7884800 1700
160853095 IsaacMoris B June 16, 2022, 3:19 p.m. OK GNU C++17 TESTS 30 139 7884800 1700
160853809 rabbitcxk B June 16, 2022, 3:21 p.m. OK GNU C++17 TESTS 30 140 4812800 1700
160908651 Hiphop21 B June 16, 2022, 10:28 p.m. OK GNU C++17 TESTS 30 140 6348800 1700
160899102 riddler_org B June 16, 2022, 6:49 p.m. OK GNU C++17 TESTS 30 140 6348800 1700
160892148 anibitte B June 16, 2022, 5:30 p.m. OK GNU C++17 TESTS 30 140 6348800 1700
160842581 BreezeMYqwq B June 16, 2022, 2:59 p.m. OK GNU C++17 (64) TESTS 30 62 28467200 1700
160836721 QAQAutoMaton B June 16, 2022, 2:50 p.m. OK GNU C++17 (64) TESTS 30 78 21299200 1700
160844174 Kude B June 16, 2022, 3:02 p.m. OK GNU C++17 (64) TESTS 30 93 3993600 1700
160910507 ympc2005 B June 17, 2022, 12:08 a.m. OK GNU C++17 (64) TESTS 30 93 5632000 1700
160836884 kal013 B June 16, 2022, 2:50 p.m. OK GNU C++17 (64) TESTS 30 93 5632000 1700
160915498 Lucina B June 17, 2022, 3:03 a.m. OK GNU C++17 (64) TESTS 30 93 8396800 1700
160841240 dfcmd B June 16, 2022, 2:57 p.m. OK GNU C++17 (64) TESTS 30 108 3993600 1700
160840495 stevenkplus B June 16, 2022, 2:56 p.m. OK GNU C++17 (64) TESTS 30 108 3993600 1700
160837777 Xellos B June 16, 2022, 2:52 p.m. OK GNU C++17 (64) TESTS 30 108 5632000 1700
160853731 353cerega B June 16, 2022, 3:21 p.m. OK GNU C++17 (64) TESTS 30 108 6451200 1700
160831746 MagicSpark B June 16, 2022, 2:44 p.m. OK GNU C++20 (64) TESTS 30 61 10547200 1700
160841843 rsy B June 16, 2022, 2:58 p.m. OK GNU C++20 (64) TESTS 30 61 15360000 1700
160849134 liouzhou_101 B June 16, 2022, 3:11 p.m. OK GNU C++20 (64) TESTS 30 62 13209600 1700
160839057 MohammadParsaElahimanesh B June 16, 2022, 2:54 p.m. OK GNU C++20 (64) TESTS 30 77 6451200 1700
160915514 arbalest1 B June 17, 2022, 3:04 a.m. OK GNU C++20 (64) TESTS 30 77 11366400 1700
160904435 Mangooste B June 16, 2022, 8:22 p.m. OK GNU C++20 (64) TESTS 30 78 3993600 1700
160864825 sheercold B June 16, 2022, 3:45 p.m. OK GNU C++20 (64) TESTS 30 78 3993600 1700
160837878 rgnerdplayer B June 16, 2022, 2:52 p.m. OK GNU C++20 (64) TESTS 30 78 3993600 1700
160899275 Arthas B June 16, 2022, 6:51 p.m. OK GNU C++20 (64) TESTS 30 78 5632000 1700
160858572 hir35 B June 16, 2022, 3:31 p.m. OK GNU C++20 (64) TESTS 30 78 5632000 1700
160917414 qw_freshman B June 17, 2022, 3:48 a.m. OK Go TESTS 30 420 15667200 1700
160912467 xxafhixx B June 17, 2022, 1:34 a.m. OK Java 11 TESTS 30 389 16691200 1700
160896440 v0s7er B June 16, 2022, 6:13 p.m. OK Java 11 TESTS 30 499 40550400 1700
160852254 MagentaCobra B June 16, 2022, 3:17 p.m. OK Java 8 TESTS 30 155 4812800 1700
160865197 reborn.chris B June 16, 2022, 3:46 p.m. OK Java 8 TESTS 30 326 15872000 1700
160916535 moyan_01 B June 17, 2022, 3:28 a.m. OK Java 8 TESTS 30 373 38400000 1700
160842133 SecondThread B June 16, 2022, 2:58 p.m. OK Java 8 TESTS 30 374 79769600 1700
160844690 golions B June 16, 2022, 3:03 p.m. OK Java 8 TESTS 30 498 44851200 1700
160839355 DylanSmith B June 16, 2022, 2:54 p.m. OK Java 8 TESTS 30 577 42496000 1700
160850467 cc4414 B June 16, 2022, 3:14 p.m. OK Java 8 TESTS 30 717 47718400 1700
160846793 Hakiobo B June 16, 2022, 3:07 p.m. OK Kotlin 1.4 TESTS 30 249 0 1700
160843724 Tlatoani B June 16, 2022, 3:01 p.m. OK Kotlin 1.6 TESTS 30 638 24883200 1700
160853492 elizarov B June 16, 2022, 3:20 p.m. OK Kotlin 1.6 TESTS 30 686 32665600 1700
160840203 Madball B June 16, 2022, 2:55 p.m. OK MS C++ 2017 TESTS 30 156 3174400 1700
160854302 tarattata1 B June 16, 2022, 3:22 p.m. OK MS C++ 2017 TESTS 30 202 8192000 1700
160838254 machine_solution B June 16, 2022, 2:52 p.m. OK MS C++ 2017 TESTS 30 530 11776000 1700
160846575 misorin B June 16, 2022, 3:06 p.m. OK PyPy 3 TESTS 30 327 32256000 1700
160856858 hxu10 B June 16, 2022, 3:27 p.m. OK PyPy 3 TESTS 30 374 32460800 1700
160849870 eepsilon B June 16, 2022, 3:13 p.m. OK PyPy 3 TESTS 30 702 24166400 1700
160841748 titia B June 16, 2022, 2:58 p.m. OK PyPy 3 TESTS 30 717 24985600 1700
160909912 siganai B June 16, 2022, 11:37 p.m. OK PyPy 3-64 TESTS 30 358 51507200 1700
160831609 asdsasd B June 16, 2022, 2:44 p.m. OK PyPy 3-64 TESTS 30 452 68710400 1700
160842677 siganai B June 16, 2022, 2:59 p.m. OK PyPy 3-64 TESTS 30 498 67481600 1700
160855866 Mukundan314 B June 16, 2022, 3:25 p.m. OK PyPy 3-64 TESTS 30 546 56115200 1700
160845848 chinerist B June 16, 2022, 3:05 p.m. OK PyPy 3-64 TESTS 30 607 65228800 1700
160853118 Igrmi B June 16, 2022, 3:19 p.m. OK PyPy 3-64 TESTS 30 623 44646400 1700
160883625 sluki B June 16, 2022, 4:30 p.m. OK PyPy 3-64 TESTS 30 701 38604800 1700
160839905 SPD_9X2 B June 16, 2022, 2:55 p.m. OK PyPy 3-64 TESTS 30 748 58880000 1700
160916060 shiviDON B June 17, 2022, 3:17 a.m. OK PyPy 3-64 TESTS 30 810 64102400 1700
160844035 huikang B June 16, 2022, 3:02 p.m. OK PyPy 3-64 TESTS 30 982 108441600 1700
160839544 Jimanbanashi B June 16, 2022, 2:54 p.m. OK Python 2 TESTS 30 436 19865600 1700
160849006 tcltk B June 16, 2022, 3:11 p.m. OK Python 3 TESTS 30 857 28057600 1700
160877875 CodingJellyfish B June 16, 2022, 4:16 p.m. OK Rust 2021 TESTS 30 31 9625600 1700
160858547 cottoncotton B June 16, 2022, 3:31 p.m. OK Rust 2021 TESTS 30 46 71270400 1700
160832074 Egor B June 16, 2022, 2:45 p.m. OK Rust 2021 TESTS 30 61 13619200 1700
160834846 sansen B June 16, 2022, 2:48 p.m. OK Rust 2021 TESTS 30 61 19558400 1700
160903881 Thallium54 B June 16, 2022, 8:10 p.m. OK Rust 2021 TESTS 30 62 21196800 1700
160835602 qwerty787788 B June 16, 2022, 2:49 p.m. OK Rust 2021 TESTS 30 109 6451200 1700
160844529 apilat B June 16, 2022, 3:03 p.m. OK Rust 2021 TESTS 30 124 23347200 1700

remove filters

Back to search problems