Codeforces Round 429 (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
840 Codeforces Round 429 (Div. 1) FINISHED False 7200 228754499 Aug. 18, 2017, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 494 ) E In a Trap PROGRAMMING trees 3200

B"Lech got into a tree consisting of n vertices with a root in vertex number 1. At each vertex i written integer ai. He will not get out until he answers q queries of the form u v. Answer for the query is maximal value among all vertices i on path from u to v including u and v, where dist(i, xe2 x80 x89v) is number of edges on path from i to v. Also guaranteed that vertex u is ancestor of vertex v. Leha's tastes are very singular: he believes that vertex is ancestor of itself. Help Leha to get out. The expression means the bitwise exclusive OR to the numbers x and y. Note that vertex u is ancestor of vertex v if vertex u lies on the path from root to the vertex v. First line of input data contains two integers n and q (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895 xc2 xb7104, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89150 xe2 x80 x89000) -- number of vertices in the tree and number of queries respectively. Next line contains n integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- numbers on vertices. Each of next n xe2 x80 x89- xe2 x80 x891 lines contains two integers u and v (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89u, xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- description of the edges in tree. Guaranteed that given graph is a tree. Each of next q lines contains two integers u and v (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89u, xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- description of queries. Guaranteed that vertex u is ancestor of vertex v. Output q lines -- answers for a queries. "...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
29725297 __stdcall E Aug. 24, 2017, 7:55 a.m. OK GNU C++ TESTS 106 732 55296000 3200
29685511 __stdcall E Aug. 22, 2017, 2:31 p.m. OK GNU C++ TESTS 106 733 55296000 3200
41142129 JiangYutong E Aug. 3, 2018, 3:55 a.m. OK GNU C++ TESTS 106 748 57139200 3200
29725364 __stdcall E Aug. 24, 2017, 7:58 a.m. OK GNU C++ TESTS 106 763 56115200 3200
29779998 wanglichao1121 E Aug. 25, 2017, 12:54 p.m. OK GNU C++ TESTS 106 764 65126400 3200
30262775 Logic_zys E Sept. 11, 2017, 9:40 a.m. OK GNU C++ TESTS 106 795 55398400 3200
36044274 beginend E March 7, 2018, 12:38 p.m. OK GNU C++ TESTS 106 811 58368000 3200
33662650 Worldwide_D E Dec. 27, 2017, 6:54 a.m. OK GNU C++ TESTS 106 872 161587200 3200
29776562 dy0607 E Aug. 25, 2017, 10:34 a.m. OK GNU C++ TESTS 106 920 47513600 3200
29865950 MemS E Aug. 29, 2017, 12:37 p.m. OK GNU C++ TESTS 106 1014 132915200 3200
48922050 jambow E Jan. 25, 2019, 8:20 a.m. OK GNU C++11 TESTS 106 577 55500800 3200
60167036 miaokehao E Sept. 6, 2019, 11:24 a.m. OK GNU C++11 TESTS 106 607 54579200 3200
38826149 bestFy E June 1, 2018, 11:24 a.m. OK GNU C++11 TESTS 106 639 60620800 3200
57769327 py_ultron E July 25, 2019, 11:05 p.m. OK GNU C++11 TESTS 106 654 56729600 3200
38826254 bestFy E June 1, 2018, 11:29 a.m. OK GNU C++11 TESTS 106 654 59801600 3200
57873682 lopare E July 28, 2019, 3:45 a.m. OK GNU C++11 TESTS 106 655 56729600 3200
36896516 choutii E April 3, 2018, 8:28 a.m. OK GNU C++11 TESTS 106 670 59392000 3200
40980247 ReaLNero1 E July 30, 2018, 5:26 p.m. OK GNU C++11 TESTS 106 686 57139200 3200
38151400 luogu_bot3 E May 13, 2018, 3:24 a.m. OK GNU C++11 TESTS 106 701 57856000 3200
29587454 TadijaSebez E Aug. 19, 2017, 3:55 a.m. OK GNU C++11 TESTS 106 702 56729600 3200
30376924 The_Unbeatable E Sept. 16, 2017, 5:51 a.m. OK GNU C++14 TESTS 106 717 53760000 3200
54733817 newbiegcz E May 28, 2019, 3:16 a.m. OK GNU C++14 TESTS 106 717 56832000 3200
60170169 miaokehao E Sept. 6, 2019, 12:35 p.m. OK GNU C++14 TESTS 106 732 54579200 3200
36117754 spetsnaz E March 9, 2018, 1:17 p.m. OK GNU C++14 TESTS 106 732 111411200 3200
39034985 cen E June 8, 2018, 3:16 a.m. OK GNU C++14 TESTS 106 748 54476800 3200
29703536 Marco_L_T E Aug. 23, 2017, 9:59 a.m. OK GNU C++14 TESTS 106 748 55500800 3200
29593495 apiadu E Aug. 19, 2017, 8:52 a.m. OK GNU C++14 TESTS 106 764 54476800 3200
30305517 czqqqaq E Sept. 13, 2017, 11:34 a.m. OK GNU C++14 TESTS 106 779 53760000 3200
34398964 cyz666 E Jan. 21, 2018, 3:30 a.m. OK GNU C++14 TESTS 106 780 58982400 3200
29703297 Marco_L_T E Aug. 23, 2017, 9:47 a.m. OK GNU C++14 TESTS 106 795 55500800 3200
45135556 Trisolaris E Oct. 31, 2018, 12:12 p.m. OK GNU C++17 TESTS 106 639 109465600 3200
45136033 Trisolaris E Oct. 31, 2018, 12:23 p.m. OK GNU C++17 TESTS 106 654 109875200 3200
45135823 Trisolaris E Oct. 31, 2018, 12:18 p.m. OK GNU C++17 TESTS 106 655 109875200 3200
55462345 hjk1030 E June 11, 2019, 3:12 p.m. OK GNU C++17 TESTS 106 811 56832000 3200
69457329 Shayan.P E Jan. 24, 2020, 9:11 a.m. OK GNU C++17 TESTS 106 1185 58163200 3200
67063012 Jarjit_sigh E Dec. 17, 2019, 9:56 a.m. OK GNU C++17 TESTS 106 1871 255180800 3200
53126352 VEGAnn E April 22, 2019, 2:14 p.m. OK GNU C++17 TESTS 106 1981 47923200 3200
67062909 Jarjit_sigh E Dec. 17, 2019, 9:53 a.m. OK GNU C++17 TESTS 106 2121 205107200 3200
65342834 ngfam E Nov. 19, 2019, 11:35 a.m. OK GNU C++17 TESTS 106 2168 189952000 3200
65342657 Kuroni9623_orz E Nov. 19, 2019, 11:31 a.m. OK GNU C++17 TESTS 106 2214 189952000 3200
35826584 tri E March 2, 2018, 6:13 a.m. OK Java 8 TESTS 106 2137 172441600 3200
29595789 mmaxio E Aug. 19, 2017, 10:40 a.m. OK Java 8 TESTS 106 2199 91955200 3200
30310427 fetetriste E Sept. 13, 2017, 3:22 p.m. OK Java 8 TESTS 106 2854 223129600 3200
34425150 TheWayISteppedOutTheCar E Jan. 21, 2018, 9:01 p.m. OK MS C++ TESTS 106 2323 9011200 3200

remove filters

Back to search problems