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.
Problems
B"You are given a rooted undirected tree consisting of n vertices. Vertex 1 is the root. Let's denote a depth array of vertex x as an infinite sequence [d_{x, 0}, d_{x, 1}, d_{x, 2}, ... ] , where d_{x, i} is the number of vertices y such that both conditions hold: The dominant index of a depth array of vertex x (or, shortly, the dominant index of vertex x ) is an index j such that: For every vertex in the tree calculate its dominant index. The first line contains one integer n ( 1 <= n <= 10^6 ) -- the number of vertices in a tree. Then n - 1 lines follow, each containing two integers x and y ( 1 <= x, y <= n , x ne y ). This line denotes an edge of the tree. It is guaranteed that these edges form a tree. Output n numbers. i -th number should be equal to the dominant index of vertex i . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
40688193 |
__ShaW |
F |
July 24, 2018, 3:55 a.m. |
OK |
FPC |
TESTS |
132 |
3462 |
161280000 |
|
2300 |
40393143 |
SovietPower |
F |
July 16, 2018, 2:43 a.m. |
OK |
GNU C++ |
TESTS |
132 |
546 |
91852800 |
|
2300 |
41604347 |
luogu_bot5 |
F |
Aug. 15, 2018, 12:30 a.m. |
OK |
GNU C++ |
TESTS |
132 |
561 |
104038400 |
|
2300 |
41100152 |
zhouzhendong |
F |
Aug. 2, 2018, 12:26 a.m. |
OK |
GNU C++ |
TESTS |
132 |
607 |
108032000 |
|
2300 |
41590451 |
yybyyb |
F |
Aug. 14, 2018, 1:46 p.m. |
OK |
GNU C++ |
TESTS |
132 |
670 |
108134400 |
|
2300 |
40580513 |
hzy9819 |
F |
July 20, 2018, 2:02 p.m. |
OK |
GNU C++ |
TESTS |
132 |
748 |
126361600 |
|
2300 |
40937223 |
gyjian |
F |
July 30, 2018, 6:30 a.m. |
OK |
GNU C++ |
TESTS |
132 |
779 |
126976000 |
|
2300 |
42242046 |
luogu_bot1 |
F |
Aug. 29, 2018, 1:05 p.m. |
OK |
GNU C++ |
TESTS |
132 |
841 |
176025600 |
|
2300 |
41643869 |
fwat |
F |
Aug. 16, 2018, 7:26 a.m. |
OK |
GNU C++ |
TESTS |
132 |
872 |
103833600 |
|
2300 |
40672886 |
ququuy |
F |
July 23, 2018, 1:37 p.m. |
OK |
GNU C++ |
TESTS |
132 |
872 |
126361600 |
|
2300 |
40351165 |
jzqjzq |
F |
July 14, 2018, 5:12 p.m. |
OK |
GNU C++ |
TESTS |
132 |
889 |
464691200 |
|
2300 |
50619539 |
rainboy |
F |
Feb. 28, 2019, 10:53 p.m. |
OK |
GNU C11 |
TESTS |
132 |
3541 |
112128000 |
|
2300 |
68428926 |
910306264 |
F |
Jan. 9, 2020, 5:44 a.m. |
OK |
GNU C++11 |
TESTS |
132 |
420 |
106188800 |
|
2300 |
54827441 |
czynt |
F |
May 30, 2019, 7:16 a.m. |
OK |
GNU C++11 |
TESTS |
132 |
421 |
96051200 |
|
2300 |
54826652 |
czynt |
F |
May 30, 2019, 6:50 a.m. |
OK |
GNU C++11 |
TESTS |
132 |
436 |
96051200 |
|
2300 |
45327914 |
dtcxzyw |
F |
Nov. 5, 2018, 1:49 p.m. |
OK |
GNU C++11 |
TESTS |
132 |
436 |
116838400 |
|
2300 |
48319251 |
cxcxccx |
F |
Jan. 13, 2019, 8:19 a.m. |
OK |
GNU C++11 |
TESTS |
132 |
436 |
136089600 |
|
2300 |
48459330 |
changle_cyx |
F |
Jan. 16, 2019, 1:56 p.m. |
OK |
GNU C++11 |
TESTS |
132 |
436 |
144076800 |
|
2300 |
53034528 |
Depth_First_Search |
F |
April 20, 2019, 5:49 a.m. |
OK |
GNU C++11 |
TESTS |
132 |
451 |
120422400 |
|
2300 |
54631950 |
czynt |
F |
May 25, 2019, 2:54 p.m. |
OK |
GNU C++11 |
TESTS |
132 |
467 |
92057600 |
|
2300 |
56885808 |
LJC00118 |
F |
July 12, 2019, 12:31 p.m. |
OK |
GNU C++11 |
TESTS |
132 |
467 |
112128000 |
|
2300 |
50769113 |
hl666 |
F |
March 4, 2019, 2:29 a.m. |
OK |
GNU C++11 |
TESTS |
132 |
467 |
124108800 |
|
2300 |
42611507 |
vjudge2 |
F |
Sept. 7, 2018, 11:20 a.m. |
OK |
GNU C++14 |
TESTS |
132 |
467 |
180224000 |
|
2300 |
42611536 |
vjudge2 |
F |
Sept. 7, 2018, 11:21 a.m. |
OK |
GNU C++14 |
TESTS |
132 |
482 |
180224000 |
|
2300 |
42611564 |
vjudge5 |
F |
Sept. 7, 2018, 11:22 a.m. |
OK |
GNU C++14 |
TESTS |
132 |
514 |
180224000 |
|
2300 |
60765240 |
chenkuowen |
F |
Sept. 18, 2019, 10:42 a.m. |
OK |
GNU C++14 |
TESTS |
132 |
654 |
112025600 |
|
2300 |
40362814 |
Luck97 |
F |
July 15, 2018, 3:05 a.m. |
OK |
GNU C++14 |
TESTS |
132 |
794 |
136396800 |
|
2300 |
45204616 |
shaochengxi |
F |
Nov. 2, 2018, 12:02 p.m. |
OK |
GNU C++14 |
TESTS |
132 |
826 |
142131200 |
|
2300 |
49343429 |
Roundgod |
F |
Feb. 2, 2019, 3:02 a.m. |
OK |
GNU C++14 |
TESTS |
132 |
841 |
163328000 |
|
2300 |
49343241 |
Roundgod |
F |
Feb. 2, 2019, 2:48 a.m. |
OK |
GNU C++14 |
TESTS |
132 |
842 |
163123200 |
|
2300 |
58846044 |
Gene_Liu |
F |
Aug. 15, 2019, 5:23 a.m. |
OK |
GNU C++14 |
TESTS |
132 |
857 |
104038400 |
|
2300 |
49666114 |
FakeFaker |
F |
Feb. 9, 2019, 2:31 p.m. |
OK |
GNU C++14 |
TESTS |
132 |
873 |
87756800 |
|
2300 |
40992188 |
Yezq |
F |
July 31, 2018, 1:09 a.m. |
OK |
GNU C++17 |
TESTS |
132 |
452 |
180224000 |
|
2300 |
40992258 |
Yezq |
F |
July 31, 2018, 1:12 a.m. |
OK |
GNU C++17 |
TESTS |
132 |
467 |
92057600 |
|
2300 |
40992267 |
Yezq |
F |
July 31, 2018, 1:12 a.m. |
OK |
GNU C++17 |
TESTS |
132 |
483 |
92057600 |
|
2300 |
40401866 |
lxn |
F |
July 16, 2018, 8 a.m. |
OK |
GNU C++17 |
TESTS |
132 |
654 |
120217600 |
|
2300 |
40401979 |
lxn |
F |
July 16, 2018, 8:03 a.m. |
OK |
GNU C++17 |
TESTS |
132 |
779 |
120217600 |
|
2300 |
57018961 |
Hipo_3412 |
F |
July 14, 2019, 1:01 p.m. |
OK |
GNU C++17 |
TESTS |
132 |
841 |
104038400 |
|
2300 |
55308495 |
Xones |
F |
June 8, 2019, 4:02 p.m. |
OK |
GNU C++17 |
TESTS |
132 |
842 |
116121600 |
|
2300 |
40359831 |
Trisolaris |
F |
July 14, 2018, 11:32 p.m. |
OK |
GNU C++17 |
TESTS |
132 |
842 |
372838400 |
|
2300 |
57011594 |
Hipo_3412 |
F |
July 14, 2019, 9:33 a.m. |
OK |
GNU C++17 |
TESTS |
132 |
857 |
104038400 |
|
2300 |
58366636 |
vjudge1 |
F |
Aug. 6, 2019, 4:23 a.m. |
OK |
GNU C++17 |
TESTS |
132 |
873 |
116121600 |
|
2300 |
42015376 |
SolitaryWayfarer |
F |
Aug. 24, 2018, 5:59 a.m. |
OK |
Go |
TESTS |
132 |
2371 |
347443200 |
|
2300 |
40373017 |
xodiac |
F |
July 15, 2018, 9:14 a.m. |
OK |
Java 8 |
TESTS |
132 |
1387 |
240230400 |
|
2300 |
40488739 |
shirshbansal |
F |
July 17, 2018, 6:36 p.m. |
OK |
Java 8 |
TESTS |
132 |
1387 |
240230400 |
|
2300 |
58236511 |
Ahmad |
F |
Aug. 3, 2019, 7:54 p.m. |
OK |
Java 8 |
TESTS |
132 |
1793 |
290304000 |
|
2300 |
40358760 |
kessido |
F |
July 14, 2018, 10:06 p.m. |
OK |
Java 8 |
TESTS |
132 |
1918 |
148787200 |
|
2300 |
40566044 |
dalt |
F |
July 20, 2018, 5:30 a.m. |
OK |
Java 8 |
TESTS |
132 |
1965 |
218419200 |
|
2300 |
40562345 |
iamavalon |
F |
July 20, 2018, 1:54 a.m. |
OK |
Java 8 |
TESTS |
132 |
1996 |
234188800 |
|
2300 |
40358568 |
kessido |
F |
July 14, 2018, 9:56 p.m. |
OK |
Java 8 |
TESTS |
132 |
2043 |
190668800 |
|
2300 |
46657684 |
aman28rwt |
F |
Dec. 5, 2018, 5:15 p.m. |
OK |
Java 8 |
TESTS |
132 |
2464 |
65536000 |
|
2300 |
40707720 |
vovacomua |
F |
July 24, 2018, 2:08 p.m. |
OK |
Java 8 |
TESTS |
132 |
2464 |
331468800 |
|
2300 |
50619659 |
Dukkha |
F |
Feb. 28, 2019, 11:08 p.m. |
OK |
Java 8 |
TESTS |
132 |
3166 |
252313600 |
|
2300 |
40356259 |
elizarov |
F |
July 14, 2018, 8:09 p.m. |
OK |
Kotlin |
TESTS |
132 |
3088 |
136908800 |
|
2300 |
40520457 |
YYOne |
F |
July 18, 2018, 3:51 p.m. |
OK |
Mono C# |
TESTS |
132 |
4461 |
204083200 |
|
2300 |
40401647 |
lxn |
F |
July 16, 2018, 7:55 a.m. |
OK |
MS C++ |
TESTS |
132 |
702 |
84172800 |
|
2300 |
40401826 |
lxn |
F |
July 16, 2018, 7:59 a.m. |
OK |
MS C++ |
TESTS |
132 |
702 |
84172800 |
|
2300 |
40402052 |
lxn |
F |
July 16, 2018, 8:05 a.m. |
OK |
MS C++ |
TESTS |
132 |
717 |
84172800 |
|
2300 |
40402232 |
lxn |
F |
July 16, 2018, 8:09 a.m. |
OK |
MS C++ |
TESTS |
132 |
748 |
84172800 |
|
2300 |
58139304 |
qcwlmqy |
F |
Aug. 1, 2019, 5:25 p.m. |
OK |
MS C++ |
TESTS |
132 |
826 |
72089600 |
|
2300 |
58139387 |
vjudge1 |
F |
Aug. 1, 2019, 5:27 p.m. |
OK |
MS C++ |
TESTS |
132 |
857 |
72089600 |
|
2300 |
44369574 |
vjudge2 |
F |
Oct. 15, 2018, 6:19 p.m. |
OK |
MS C++ |
TESTS |
132 |
982 |
88064000 |
|
2300 |
69951416 |
zengxy |
F |
Feb. 1, 2020, 9:03 a.m. |
OK |
MS C++ |
TESTS |
132 |
997 |
132198400 |
|
2300 |
69951496 |
vjudge3 |
F |
Feb. 1, 2020, 9:04 a.m. |
OK |
MS C++ |
TESTS |
132 |
1013 |
132198400 |
|
2300 |
55226344 |
vjudge5 |
F |
June 7, 2019, 1:50 a.m. |
OK |
MS C++ |
TESTS |
132 |
1075 |
72089600 |
|
2300 |
65792072 |
BessieTheCow |
F |
Nov. 26, 2019, 11:47 p.m. |
OK |
MS C++ 2017 |
TESTS |
132 |
4414 |
127897600 |
|
2300 |
40381810 |
kobae964 |
F |
July 15, 2018, 2:43 p.m. |
OK |
Rust |
TESTS |
132 |
1107 |
258764800 |
|
2300 |
40397817 |
kobae964 |
F |
July 16, 2018, 6:14 a.m. |
OK |
Rust |
TESTS |
132 |
1122 |
258867200 |
|
2300 |
40397772 |
kobae964 |
F |
July 16, 2018, 6:12 a.m. |
OK |
Rust |
TESTS |
132 |
1123 |
258764800 |
|
2300 |
40382579 |
kobae964 |
F |
July 15, 2018, 3:19 p.m. |
OK |
Rust |
TESTS |
132 |
1123 |
258764800 |
|
2300 |
40381853 |
kobae964 |
F |
July 15, 2018, 2:46 p.m. |
OK |
Rust |
TESTS |
132 |
1138 |
258764800 |
|
2300 |
40381656 |
kobae964 |
F |
July 15, 2018, 2:36 p.m. |
OK |
Rust |
TESTS |
132 |
1153 |
258867200 |
|
2300 |
40381523 |
kobae964 |
F |
July 15, 2018, 2:30 p.m. |
OK |
Rust |
TESTS |
132 |
1154 |
259584000 |
|
2300 |
40397536 |
kobae964 |
F |
July 16, 2018, 6:05 a.m. |
OK |
Rust |
TESTS |
132 |
1169 |
258764800 |
|
2300 |
40397965 |
kobae964 |
F |
July 16, 2018, 6:18 a.m. |
OK |
Rust |
TESTS |
132 |
1185 |
258764800 |
|
2300 |
40378434 |
kobae964 |
F |
July 15, 2018, 12:30 p.m. |
OK |
Rust |
TESTS |
132 |
1185 |
259584000 |
|
2300 |
remove filters
Back to search problems