Educational Codeforces Round 122 (Rated for Div. 2)

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
1633 Educational Codeforces Round 122 (Rated for Div. 2) FINISHED False 7200 93540263 Jan. 31, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 325 ) F Perfect Matching PROGRAMMING data structures interactive trees

B'You are given a tree consisting of n vertices (numbered from 1 to n ) and n-1 edges (numbered from 1 to n-1 ). Initially, all vertices except vertex 1 are inactive. You have to process queries of three types: Note that you should solve the problem in online mode. It means that you can 't read the whole input at once. You can read each query only after writing the answer for the last query. Use functions fflush in C++ and BufferedWriter.flush in Java languages after each writing in your program. The first line contains one integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of vertices of the tree. Then n-1 lines follow. The i -th line contains two integers u_i and v_i ( 1 <= u_i, v_i <= n ; u_i ne v_i ) -- the endpoints of the i -th edge. These edges form a tree. Then the queries follow in the format described in the statement, one line per query. There will be at least 2 and at most n+10 queries. The last query (and only the last one) will be of type 3 . Note that you can read the i -th query only if you have already given the answer for the query i-1 (except for i = 1 ). If your answer for one of the queries is incorrect and the judging program recognizes it, instead of the next query, you may receive the integer 0 on a separate line. After receiving it, your program should terminate gracefully, and you will receive "Wrong Answer" verdict. If your program doesn 't terminate, your solution may receive some other verdict, like "Time Limit Exceeded", "Idleness Limit Exceeded", etc. Note that the fact that your solution doesn 't receive the integer 0 , it does not mean that all your answers are correct, some of them will be checked only after your program is terminated. For each query of type 1 or 2 , print the answer on a separate line as described in the statement. Don 't forget to flush the output. '...

Tutorials

99539

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
144788738 He_Ren F Feb. 1, 2022, 2:23 a.m. OK GNU C++17 TESTS 51 2495 53248000
144760627 Pyqe F Jan. 31, 2022, 5 p.m. OK GNU C++17 TESTS 51 2760 118067200
144785458 afterall F Jan. 31, 2022, 10:59 p.m. OK GNU C++17 TESTS 51 3306 99225600
144769781 sp40016 F Jan. 31, 2022, 6:08 p.m. OK GNU C++17 TESTS 51 10748 23654400
144766680 Hanasaki F Jan. 31, 2022, 5:41 p.m. OK GNU C++17 (64) TESTS 51 2355 59084800
144788800 tzc_wk F Feb. 1, 2022, 2:25 a.m. OK GNU C++17 (64) TESTS 51 2480 87859200
144790579 xay5421 F Feb. 1, 2022, 3:17 a.m. OK GNU C++17 (64) TESTS 51 3120 69427200
144788587 mango_lassi F Feb. 1, 2022, 2:17 a.m. OK GNU C++17 (64) TESTS 51 4008 95027200
144784071 oleh1421 F Jan. 31, 2022, 10:04 p.m. OK GNU C++17 (64) TESTS 51 8299 44339200
144756413 oleh1421 F Jan. 31, 2022, 4:42 p.m. OK GNU C++17 (64) TESTS 51 8688 44339200
144773832 x_angelkawaii_x F Jan. 31, 2022, 6:52 p.m. OK GNU C++17 (64) TESTS 51 8689 48332800
144784169 oleh1421 F Jan. 31, 2022, 10:07 p.m. OK GNU C++17 (64) TESTS 51 8954 44339200
144756558 oleh1421 F Jan. 31, 2022, 4:42 p.m. OK GNU C++17 (64) TESTS 51 8954 44339200
144784123 oleh1421 F Jan. 31, 2022, 10:06 p.m. OK GNU C++17 (64) TESTS 51 9624 44339200
144783793 DeadlyPillow F Jan. 31, 2022, 9:53 p.m. OK GNU C++20 (64) TESTS 51 2589 63795200
144772237 huangxiaohua F Jan. 31, 2022, 6:33 p.m. OK GNU C++20 (64) TESTS 51 7658 48230400
144772561 huangxiaohua F Jan. 31, 2022, 6:37 p.m. OK GNU C++20 (64) TESTS 51 7862 48230400
144757606 Yellow_Submarine01 F Jan. 31, 2022, 4:46 p.m. OK GNU C++20 (64) TESTS 51 8454 44441600

remove filters

Back to search problems