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"Monocarp has a tree, consisting of n vertices. He is going to select some vertex r and perform the following operations on each vertex v from 1 to n : A nice coloring satisfies two conditions: Note that Monocarp can choose any amount of different colors he wants to use. For each used color, he then counts the number of vertices of this color. The cost of the tree is the minimum of these numbers. What can be the maximum cost of the tree? The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The first line of each testcase contains a single integer n ( 3 <= n <= 2 cdot 10^5 ) -- the number of vertices in the tree. Each of the next n-1 lines contains two integers v and u ( 1 <= v, u <= n ) -- the description of an edge. The given edges form a tree. The sum of n over all testcases doesn't exceed 2 cdot 10^5 . For each testcase print a single integer -- the maximum possible cost of the tree. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
195366573 |
rainboy |
E |
Feb. 28, 2023, 6:07 p.m. |
OK |
GNU C11 |
TESTS |
23 |
186 |
31436800 |
|
|
195348697 |
LinRui |
E |
Feb. 28, 2023, 4:27 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
202 |
48230400 |
|
|
195394551 |
Cxny |
E |
March 1, 2023, 1:15 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
374 |
20172800 |
|
|
195357455 |
sysulby |
E |
Feb. 28, 2023, 5 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
374 |
45875200 |
|
|
195398265 |
my_name_is_handsome |
E |
March 1, 2023, 2:51 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
483 |
63488000 |
|
|
195397130 |
AppleFicial |
E |
March 1, 2023, 2:26 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
499 |
14643200 |
|
|
195403330 |
AppleFicial |
E |
March 1, 2023, 4:40 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
529 |
14540800 |
|
|
195353531 |
schrodingerstom |
E |
Feb. 28, 2023, 4:40 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
763 |
22630400 |
|
|
195364828 |
Seast |
E |
Feb. 28, 2023, 5:53 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
841 |
113971200 |
|
|
195364703 |
Seast |
E |
Feb. 28, 2023, 5:52 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
873 |
113971200 |
|
|
195395793 |
Liuxizai |
E |
March 1, 2023, 1:50 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
919 |
29900800 |
|
|
195397189 |
klu_2000031762 |
E |
March 1, 2023, 2:27 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
202 |
48230400 |
|
|
195387911 |
amirhoseinfar1385 |
E |
Feb. 28, 2023, 10:20 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
343 |
155955200 |
|
|
195368146 |
liympanda |
E |
Feb. 28, 2023, 6:21 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
421 |
11571200 |
|
|
195407857 |
BadalArya |
E |
March 1, 2023, 5:49 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
468 |
44236800 |
|
|
195366980 |
liympanda |
E |
Feb. 28, 2023, 6:10 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
483 |
11571200 |
|
|
195400993 |
LeticiaFCS |
E |
March 1, 2023, 3:53 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
608 |
53145600 |
|
|
195368259 |
magga |
E |
Feb. 28, 2023, 6:22 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
701 |
34611200 |
|
|
195368663 |
magga |
E |
Feb. 28, 2023, 6:25 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
701 |
34611200 |
|
|
195401367 |
LeticiaFCS |
E |
March 1, 2023, 4:01 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
701 |
56320000 |
|
|
195361441 |
avi0000 |
E |
Feb. 28, 2023, 5:26 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
732 |
36249600 |
|
|
195366381 |
Lucina |
E |
Feb. 28, 2023, 6:05 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
170 |
64102400 |
|
|
195371128 |
Lucina |
E |
Feb. 28, 2023, 6:49 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
171 |
47308800 |
|
|
195370645 |
Lucina |
E |
Feb. 28, 2023, 6:44 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
171 |
51712000 |
|
|
195371008 |
Lucina |
E |
Feb. 28, 2023, 6:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
171 |
51712000 |
|
|
195370434 |
Lucina |
E |
Feb. 28, 2023, 6:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
171 |
51712000 |
|
|
195369199 |
Lucina |
E |
Feb. 28, 2023, 6:30 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
171 |
57651200 |
|
|
195366534 |
Lucina |
E |
Feb. 28, 2023, 6:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
171 |
64102400 |
|
|
195394396 |
FredYourMind |
E |
March 1, 2023, 1:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
171 |
70553600 |
|
|
195368996 |
Lucina |
E |
Feb. 28, 2023, 6:28 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
186 |
57651200 |
|
|
195368386 |
Lucina |
E |
Feb. 28, 2023, 6:23 p.m. |
OK |
GNU C++17 (64) |
TESTS |
23 |
186 |
64102400 |
|
|
195381252 |
cabbit |
E |
Feb. 28, 2023, 8:38 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
187 |
60928000 |
|
|
195379542 |
kaiboy |
E |
Feb. 28, 2023, 8:18 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
202 |
38502400 |
|
|
195347911 |
Dremix10 |
E |
Feb. 28, 2023, 4:26 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
218 |
50483200 |
|
|
195368343 |
surgutti |
E |
Feb. 28, 2023, 6:23 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
233 |
67379200 |
|
|
195350907 |
tdzl2003 |
E |
Feb. 28, 2023, 4:32 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
233 |
75468800 |
|
|
195349269 |
LeDiable |
E |
Feb. 28, 2023, 4:29 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
249 |
43315200 |
|
|
195361376 |
BERNARB.01 |
E |
Feb. 28, 2023, 5:26 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
312 |
105881600 |
|
|
195394858 |
emaneru |
E |
March 1, 2023, 1:23 a.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
343 |
63283200 |
|
|
195355030 |
yfuka86 |
E |
Feb. 28, 2023, 4:47 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
343 |
139571200 |
|
|
195359929 |
SOCIOPATE |
E |
Feb. 28, 2023, 5:16 p.m. |
OK |
GNU C++20 (64) |
TESTS |
23 |
373 |
80281600 |
|
|
195378561 |
Dukkha |
E |
Feb. 28, 2023, 8:07 p.m. |
OK |
Java 17 |
TESTS |
23 |
919 |
41062400 |
|
|
195384064 |
DylanSmith |
E |
Feb. 28, 2023, 9:15 p.m. |
OK |
Java 8 |
TESTS |
23 |
1014 |
23142400 |
|
|
195383784 |
DylanSmith |
E |
Feb. 28, 2023, 9:11 p.m. |
OK |
Java 8 |
TESTS |
23 |
1232 |
28057600 |
|
|
195361847 |
misorin |
E |
Feb. 28, 2023, 5:30 p.m. |
OK |
PyPy 3 |
TESTS |
23 |
732 |
31539200 |
|
|
195361327 |
misorin |
E |
Feb. 28, 2023, 5:26 p.m. |
OK |
PyPy 3 |
TESTS |
23 |
998 |
44851200 |
|
|
195398398 |
mkawa2 |
E |
March 1, 2023, 2:54 a.m. |
OK |
PyPy 3-64 |
TESTS |
23 |
951 |
74035200 |
|
|
remove filters
Back to search problems