Codeforces Round 722 (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
1528 Codeforces Round 722 (Div. 1) FINISHED False 8100 115313062 May 24, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2686 ) C Trees of Tranquillity PROGRAMMING data structures dfs and similar greedy trees

B"Soroush and Keshi each have a labeled and rooted tree on n vertices. Both of their trees are rooted from vertex 1 . Soroush and Keshi used to be at war. After endless decades of fighting, they finally became allies to prepare a Codeforces round. To celebrate this fortunate event, they decided to make a memorial graph on n vertices. They add an edge between vertices u and v in the memorial graph if both of the following conditions hold: Here vertex u is considered ancestor of vertex v , if u lies on the path from 1 (the root) to the v . Popping out of nowhere, Mashtali tried to find the maximum clique in the memorial graph for no reason. He failed because the graph was too big. Help Mashtali by finding the size of the maximum clique in the memorial graph. As a reminder, clique is a subset of vertices of the graph, each two of which are connected by an edge. The first line contains an integer t (1 <= t <= 3 cdot 10^5) -- the number of test cases. The description of the test cases follows. The first line of each test case contains an integer n (2 <= n <= 3 cdot 10^5) . The second line of each test case contains n-1 integers a_2, ldots, a_n (1 <= a_i < i) , a_i being the parent of the vertex i in Soroush's tree. The third line of each test case contains n-1 integers b_2, ldots, b_n (1 <= b_i < i) , b_i being the parent of the vertex i in Keshi's tree. It is guaranteed that the given graphs are trees. It is guaranteed that the sum of n over all test cases doesn't exceed 3 cdot 10^5 . For each test case print a single integer -- the size of the maximum clique in the memorial graph. In the first and third test cases, you can pick any vertex. In the second test case, one of the maximum cliques is {2, 3, 4, 5 } . In the fourth test case, one of the maximum cliques is {3, 4, 6 } . "...

Tutorials

Codeforces Round #722 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
117279030 priority C May 25, 2021, 3:33 a.m. OK GNU C++11 TESTS 41 156 32153600
117219643 Mr_Eight C May 24, 2021, 3:26 p.m. OK GNU C++11 TESTS 35 187 13312000
117281747 stoorz C May 25, 2021, 4:27 a.m. OK GNU C++11 TESTS 41 187 19251200
117247292 TQX C May 24, 2021, 4:35 p.m. OK GNU C++11 TESTS 35 187 25395200
117275576 2114992323 C May 25, 2021, 2:16 a.m. OK GNU C++11 TESTS 41 187 33484800
117279317 priority C May 25, 2021, 3:39 a.m. OK GNU C++11 TESTS 41 202 32153600
117276451 fishcathu. C May 25, 2021, 2:39 a.m. OK GNU C++11 TESTS 41 218 36966400
117276287 fishcathu. C May 25, 2021, 2:35 a.m. OK GNU C++11 TESTS 41 218 36966400
117221277 Yukikaze_ C May 24, 2021, 3:29 p.m. OK GNU C++11 TESTS 35 233 17408000
117241141 xin_chen C May 24, 2021, 4:16 p.m. OK GNU C++11 TESTS 35 234 25702400
117270999 SuperJ6 C May 24, 2021, 10:59 p.m. OK GNU C++14 TESTS 41 264 29798400
117278177 189X1A05B3 C May 25, 2021, 3:15 a.m. OK GNU C++14 TESTS 41 264 29798400
117236186 clyring C May 24, 2021, 4:02 p.m. OK GNU C++14 TESTS 35 280 17510400
117283502 playf C May 25, 2021, 4:55 a.m. OK GNU C++14 TESTS 41 296 29286400
117263492 Graphter C May 24, 2021, 7:14 p.m. OK GNU C++14 TESTS 40 296 40652800
117221294 DmitryGrigorev C May 24, 2021, 3:29 p.m. OK GNU C++14 TESTS 35 311 16384000
117254029 ajj C May 24, 2021, 5:19 p.m. OK GNU C++14 TESTS 35 311 16384000
117277108 shirakami_fbk C May 25, 2021, 2:53 a.m. OK GNU C++14 TESTS 41 311 30208000
117242592 awoo C May 24, 2021, 4:20 p.m. OK GNU C++14 TESTS 35 327 16384000
117241509 uux C May 24, 2021, 4:17 p.m. OK GNU C++14 TESTS 35 327 16384000
117221707 Sutaner C May 24, 2021, 3:30 p.m. OK GNU C++17 TESTS 35 202 45568000
117279533 Elo C May 25, 2021, 3:43 a.m. OK GNU C++17 TESTS 41 217 34816000
117279288 Elo C May 25, 2021, 3:38 a.m. OK GNU C++17 TESTS 41 234 32768000
117258903 Nanored C May 24, 2021, 6:04 p.m. OK GNU C++17 TESTS 40 264 29798400
117266904 jeroenodb C May 24, 2021, 8:30 p.m. OK GNU C++17 TESTS 41 265 19456000
117255258 vioalbert C May 24, 2021, 5:27 p.m. OK GNU C++17 TESTS 36 280 18841600
117284670 elManco C May 25, 2021, 5:11 a.m. OK GNU C++17 TESTS 41 280 31334400
117263462 bonopo C May 24, 2021, 7:14 p.m. OK GNU C++17 TESTS 40 280 33484800
117245868 sam.rei C May 24, 2021, 4:30 p.m. OK GNU C++17 TESTS 35 296 23552000
117265071 JustasZ C May 24, 2021, 7:48 p.m. OK GNU C++17 TESTS 40 296 31129600
117206081 yhx-12243 C May 24, 2021, 3:03 p.m. OK GNU C++17 (64) TESTS 35 187 10956800
117201851 jiangly C May 24, 2021, 2:56 p.m. OK GNU C++17 (64) TESTS 35 280 18841600
117283419 Wyxrg C May 25, 2021, 4:54 a.m. OK GNU C++17 (64) TESTS 41 280 51097600
117203007 Maripium C May 24, 2021, 2:58 p.m. OK GNU C++17 (64) TESTS 35 295 17612800
117228772 Bakry_ C May 24, 2021, 3:45 p.m. OK GNU C++17 (64) TESTS 35 295 25190400
117276134 Turkey C May 25, 2021, 2:31 a.m. OK GNU C++17 (64) TESTS 41 295 48947200
117272563 HolyK C May 25, 2021, 12:19 a.m. OK GNU C++17 (64) TESTS 41 295 57036800
117257782 congthanh123 C May 24, 2021, 5:51 p.m. OK GNU C++17 (64) TESTS 40 296 52633600
117234408 dnshgyl21 C May 24, 2021, 3:58 p.m. OK GNU C++17 (64) TESTS 35 311 23961600
117231785 fastfurioustransform C May 24, 2021, 3:51 p.m. OK GNU C++17 (64) TESTS 35 311 24166400
117222226 uwi C May 24, 2021, 3:31 p.m. OK Java 11 TESTS 35 904 95334400
117264525 bobib C May 24, 2021, 7:35 p.m. OK Java 11 TESTS 40 1138 232038400
117268612 martins C May 24, 2021, 9:19 p.m. OK Java 11 TESTS 41 1247 207769600
117263603 LNB C May 24, 2021, 7:17 p.m. OK Java 11 TESTS 40 1340 268390400
117271543 asamanta C May 24, 2021, 11:30 p.m. OK Java 11 TESTS 41 1996 268390400
117269187 Discombobulated C May 24, 2021, 9:37 p.m. OK Java 11 TESTS 41 2371 78540800
117279573 hu_tao C May 25, 2021, 3:44 a.m. OK Java 8 TESTS 41 483 54476800
117219577 dalt C May 24, 2021, 3:25 p.m. OK Java 8 TESTS 35 857 77516800
117248875 YahiaSherif C May 24, 2021, 4:40 p.m. OK Java 8 TESTS 35 1014 114278400
117220840 Tlatoani C May 24, 2021, 3:28 p.m. OK Kotlin TESTS 35 982 91545600
117244687 Hakiobo C May 24, 2021, 4:27 p.m. OK Kotlin TESTS 35 1091 85094400
117271750 tarattata1 C May 24, 2021, 11:41 p.m. OK MS C++ 2017 TESTS 41 732 68915200
117248889 azukun C May 24, 2021, 4:40 p.m. OK .NET Core C# TESTS 35 1106 101376000
117280311 codicon C May 25, 2021, 4 a.m. OK PyPy 3 TESTS 41 967 70860800
117257587 Tet C May 24, 2021, 5:49 p.m. OK PyPy 3 TESTS 40 998 67481600
117259422 shuyefan C May 24, 2021, 6:11 p.m. OK PyPy 3 TESTS 40 1341 108134400
117240843 sansen C May 24, 2021, 4:15 p.m. OK Rust TESTS 35 280 33280000
117255035 toomer C May 24, 2021, 5:26 p.m. OK Rust TESTS 35 452 26112000
117233712 cottoncotton C May 24, 2021, 3:56 p.m. OK Rust TESTS 35 1528 12083200

remove filters

Back to search problems