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 |
842
|
Codeforces Round 430 (Div. 2) |
FINISHED |
False |
7200 |
227804099 |
Aug. 29, 2017, 3:05 p.m. |
Problems
B'Ilya is very fond of graphs, especially trees. During his last trip to the forest Ilya found a very interesting tree rooted at vertex 1. There is an integer number written on each vertex of the tree; the number written on vertex i is equal to ai. Ilya believes that the beauty of the vertex x is the greatest common divisor of all numbers written on the vertices on the path from the root to x, including this vertex itself. In addition, Ilya can change the number in one arbitrary vertex to 0 or leave all vertices unchanged. Now for each vertex Ilya wants to know the maximum possible beauty it can have. For each vertex the answer must be considered independently. The beauty of the root equals to number written on it. First line contains one integer number n -- the number of vertices in tree (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xc2 xb7105). Next line contains n integer numbers ai (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xc2 xb7105). Each of next n xe2 x80 x89- xe2 x80 x891 lines contains two integer numbers x and y (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x, xe2 x80 x89y xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, x xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89y), which means that there is an edge (x, xe2 x80 x89y) in the tree. Output n numbers separated by spaces, where i-th number equals to maximum possible beauty 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 |
32368552 |
AsahiKasugano |
C |
Nov. 17, 2017, 3:07 a.m. |
OK |
FPC |
TESTS |
48 |
1029 |
14643200 |
|
2000 |
29894912 |
KagamiharaNadeshiko |
C |
Aug. 29, 2017, 4:50 p.m. |
OK |
FPC |
TESTS |
48 |
1107 |
14643200 |
|
2000 |
30935955 |
vjudge3 |
C |
Oct. 2, 2017, 7:26 a.m. |
OK |
FPC |
TESTS |
48 |
1107 |
36966400 |
|
2000 |
30937568 |
vjudge2 |
C |
Oct. 2, 2017, 8:41 a.m. |
OK |
FPC |
TESTS |
48 |
1169 |
36966400 |
|
2000 |
30945096 |
vjudge4 |
C |
Oct. 2, 2017, 2:15 p.m. |
OK |
FPC |
TESTS |
48 |
1512 |
37888000 |
|
2000 |
30945154 |
yinwuxiao |
C |
Oct. 2, 2017, 2:17 p.m. |
OK |
FPC |
TESTS |
48 |
1528 |
37888000 |
|
2000 |
29964403 |
changz |
C |
Sept. 1, 2017, 5:09 a.m. |
OK |
GNU C |
TESTS |
48 |
686 |
16793600 |
|
2000 |
40980226 |
ReaLNero1 |
C |
July 30, 2018, 5:25 p.m. |
OK |
GNU C++ |
TESTS |
48 |
77 |
15360000 |
|
2000 |
29889679 |
zyyorz |
C |
Aug. 29, 2017, 4:18 p.m. |
OK |
GNU C++ |
TESTS |
48 |
93 |
15360000 |
|
2000 |
29915680 |
bestFy |
C |
Aug. 30, 2017, 11:23 a.m. |
OK |
GNU C++ |
TESTS |
48 |
93 |
16588800 |
|
2000 |
35116532 |
vjudge4 |
C |
Feb. 10, 2018, 8:18 a.m. |
OK |
GNU C++ |
TESTS |
48 |
109 |
14028800 |
|
2000 |
29892384 |
_Cwystc_Killer_ |
C |
Aug. 29, 2017, 4:35 p.m. |
OK |
GNU C++ |
TESTS |
48 |
109 |
59289600 |
|
2000 |
29891836 |
xmhuangzhen |
C |
Aug. 29, 2017, 4:31 p.m. |
OK |
GNU C++ |
TESTS |
48 |
139 |
60006400 |
|
2000 |
29885823 |
beginend |
C |
Aug. 29, 2017, 3:58 p.m. |
OK |
GNU C++ |
TESTS |
48 |
140 |
39219200 |
|
2000 |
35119185 |
vjudge5 |
C |
Feb. 10, 2018, 9:44 a.m. |
OK |
GNU C++ |
TESTS |
48 |
156 |
15667200 |
|
2000 |
35119162 |
fyy2603 |
C |
Feb. 10, 2018, 9:44 a.m. |
OK |
GNU C++ |
TESTS |
48 |
156 |
15667200 |
|
2000 |
30219473 |
vjudge3 |
C |
Sept. 9, 2017, 7:13 a.m. |
OK |
GNU C++ |
TESTS |
48 |
156 |
16793600 |
|
2000 |
57168590 |
luogu_bot2 |
C |
July 17, 2019, 1:32 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
109 |
27238400 |
|
2000 |
63011069 |
mopemope |
C |
Oct. 20, 2019, 11:45 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
109 |
47104000 |
|
2000 |
57442466 |
vjudge4 |
C |
July 21, 2019, 7:12 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
124 |
22630400 |
|
2000 |
29895306 |
bluestocking |
C |
Aug. 29, 2017, 4:52 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
124 |
27033600 |
|
2000 |
30046859 |
Cherries |
C |
Sept. 4, 2017, 4:41 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
124 |
32051200 |
|
2000 |
54704051 |
DennyQi |
C |
May 27, 2019, 3:23 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
124 |
34508800 |
|
2000 |
54704023 |
DennyQi |
C |
May 27, 2019, 3:21 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
124 |
34508800 |
|
2000 |
57442569 |
luogu_bot2 |
C |
July 21, 2019, 7:13 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
139 |
22630400 |
|
2000 |
30002117 |
wfj_2048 |
C |
Sept. 2, 2017, 4:41 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
140 |
26624000 |
|
2000 |
57168628 |
vjudge1 |
C |
July 17, 2019, 1:34 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
140 |
27238400 |
|
2000 |
35108797 |
vjudge5 |
C |
Feb. 10, 2018, 1:22 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
187 |
18739200 |
|
2000 |
53701733 |
vjudge5 |
C |
May 3, 2019, 10:53 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
217 |
33382400 |
|
2000 |
29911590 |
wjw1340 |
C |
Aug. 30, 2017, 8:16 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
218 |
27443200 |
|
2000 |
29914948 |
Taco |
C |
Aug. 30, 2017, 10:49 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
218 |
32972800 |
|
2000 |
30271587 |
_AjReme_ |
C |
Sept. 11, 2017, 6 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
218 |
33792000 |
|
2000 |
57181783 |
vjudge1 |
C |
July 17, 2019, 7:29 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
218 |
47001600 |
|
2000 |
29919400 |
BanFcc |
C |
Aug. 30, 2017, 2 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
233 |
15257600 |
|
2000 |
58843866 |
bojverdict2 |
C |
Aug. 15, 2019, 3:52 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
233 |
32972800 |
|
2000 |
58843853 |
kwebi |
C |
Aug. 15, 2019, 3:52 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
233 |
32972800 |
|
2000 |
58811223 |
bojverdict1 |
C |
Aug. 14, 2019, 10:53 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
233 |
39424000 |
|
2000 |
41645746 |
vjudge3 |
C |
Aug. 16, 2018, 8:31 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
171 |
27443200 |
|
2000 |
57124959 |
yiqzq |
C |
July 16, 2019, 3:39 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
218 |
33792000 |
|
2000 |
46391955 |
vjudge5 |
C |
Nov. 30, 2018, 6:34 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
233 |
32256000 |
|
2000 |
52534705 |
qhqh |
C |
April 9, 2019, 3:02 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
233 |
32972800 |
|
2000 |
49942093 |
vjudge4 |
C |
Feb. 15, 2019, 10:13 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
233 |
33792000 |
|
2000 |
60447478 |
huxiaotaostasy |
C |
Sept. 12, 2019, 2:39 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
234 |
36966400 |
|
2000 |
52534832 |
vjudge5 |
C |
April 9, 2019, 3:06 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
248 |
33075200 |
|
2000 |
59117782 |
vjudge3 |
C |
Aug. 20, 2019, 2:51 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
249 |
27443200 |
|
2000 |
59118811 |
cang_qiong |
C |
Aug. 20, 2019, 3:31 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
249 |
30617600 |
|
2000 |
69023191 |
vjudge2 |
C |
Jan. 18, 2020, 6:44 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
249 |
32256000 |
|
2000 |
44638384 |
Marii |
C |
Oct. 21, 2018, 9:17 a.m. |
OK |
Go |
TESTS |
48 |
779 |
27750400 |
|
2000 |
44638532 |
Marii |
C |
Oct. 21, 2018, 9:18 a.m. |
OK |
Go |
TESTS |
48 |
795 |
27750400 |
|
2000 |
29913069 |
ValenKof |
C |
Aug. 30, 2017, 9:21 a.m. |
OK |
Go |
TESTS |
48 |
997 |
84787200 |
|
2000 |
29901272 |
Darth_Jar_Jar_Binks |
C |
Aug. 29, 2017, 7:33 p.m. |
OK |
Java 8 |
TESTS |
48 |
530 |
15974400 |
|
2000 |
30050157 |
synapse |
C |
Sept. 4, 2017, 9:31 a.m. |
OK |
Java 8 |
TESTS |
48 |
530 |
27852800 |
|
2000 |
30277928 |
mualanhlung017 |
C |
Sept. 12, 2017, 4:27 a.m. |
OK |
Java 8 |
TESTS |
48 |
545 |
31948800 |
|
2000 |
29958089 |
prashanth_rebala |
C |
Aug. 31, 2017, 7:50 p.m. |
OK |
Java 8 |
TESTS |
48 |
576 |
27852800 |
|
2000 |
63743355 |
mufaddalnaya |
C |
Oct. 29, 2019, 5:43 p.m. |
OK |
Java 8 |
TESTS |
48 |
655 |
70963200 |
|
2000 |
29923665 |
Saturnman |
C |
Aug. 30, 2017, 4:02 p.m. |
OK |
Java 8 |
TESTS |
48 |
701 |
123699200 |
|
2000 |
29919452 |
noob__coder |
C |
Aug. 30, 2017, 2:02 p.m. |
OK |
Java 8 |
TESTS |
48 |
717 |
174489600 |
|
2000 |
29915520 |
tmdautov |
C |
Aug. 30, 2017, 11:15 a.m. |
OK |
Java 8 |
TESTS |
48 |
732 |
113664000 |
|
2000 |
29947252 |
tmdautov |
C |
Aug. 31, 2017, 2:48 p.m. |
OK |
Java 8 |
TESTS |
48 |
748 |
113664000 |
|
2000 |
29902465 |
OmarRadwan |
C |
Aug. 29, 2017, 8:37 p.m. |
OK |
Java 8 |
TESTS |
48 |
748 |
126873600 |
|
2000 |
32237966 |
og.kostya |
C |
Nov. 12, 2017, 8:22 a.m. |
OK |
MS C# |
TESTS |
48 |
436 |
66764800 |
|
2000 |
29895932 |
mircea85 |
C |
Aug. 29, 2017, 4:56 p.m. |
OK |
MS C# |
TESTS |
48 |
670 |
59084800 |
|
2000 |
29899737 |
AlexanderL |
C |
Aug. 29, 2017, 6:35 p.m. |
OK |
MS C# |
TESTS |
48 |
842 |
45465600 |
|
2000 |
29911873 |
fr0st |
C |
Aug. 30, 2017, 8:29 a.m. |
OK |
MS C# |
TESTS |
48 |
1653 |
60211200 |
|
2000 |
29912010 |
fr0st |
C |
Aug. 30, 2017, 8:35 a.m. |
OK |
MS C# |
TESTS |
48 |
1668 |
59699200 |
|
2000 |
57433637 |
vjudge3 |
C |
July 21, 2019, 3:18 a.m. |
OK |
MS C++ |
TESTS |
48 |
171 |
11161600 |
|
2000 |
46714885 |
vjudge1 |
C |
Dec. 7, 2018, 10:34 a.m. |
OK |
MS C++ |
TESTS |
48 |
202 |
20889600 |
|
2000 |
57437303 |
vjudge5 |
C |
July 21, 2019, 5:30 a.m. |
OK |
MS C++ |
TESTS |
48 |
202 |
22425600 |
|
2000 |
40659078 |
vjudge4 |
C |
July 23, 2018, 6:08 a.m. |
OK |
MS C++ |
TESTS |
48 |
233 |
21708800 |
|
2000 |
54134861 |
vjudge5 |
C |
May 14, 2019, 4:29 p.m. |
OK |
MS C++ |
TESTS |
48 |
249 |
42700800 |
|
2000 |
42666822 |
vjudge1 |
C |
Sept. 8, 2018, 8:24 a.m. |
OK |
MS C++ |
TESTS |
48 |
280 |
33996800 |
|
2000 |
58983202 |
vjudge3 |
C |
Aug. 18, 2019, 5:39 a.m. |
OK |
MS C++ |
TESTS |
48 |
311 |
56115200 |
|
2000 |
42859818 |
vjudge2 |
C |
Sept. 14, 2018, 12:12 p.m. |
OK |
MS C++ |
TESTS |
48 |
312 |
21708800 |
|
2000 |
42667294 |
vjudge5 |
C |
Sept. 8, 2018, 8:46 a.m. |
OK |
MS C++ |
TESTS |
48 |
312 |
46592000 |
|
2000 |
29894517 |
omarosama96 |
C |
Aug. 29, 2017, 4:48 p.m. |
OK |
MS C++ |
TESTS |
48 |
327 |
15257600 |
|
2000 |
29929297 |
pluristiq |
C |
Aug. 30, 2017, 6:11 p.m. |
OK |
PyPy 2 |
TESTS |
48 |
1638 |
28979200 |
|
2000 |
29928185 |
pluristiq |
C |
Aug. 30, 2017, 5:53 p.m. |
OK |
PyPy 2 |
TESTS |
48 |
1653 |
28979200 |
|
2000 |
39850451 |
Ali_Pi |
C |
July 1, 2018, 8:10 p.m. |
OK |
PyPy 2 |
TESTS |
48 |
1684 |
30412800 |
|
2000 |
29929268 |
pluristiq |
C |
Aug. 30, 2017, 6:10 p.m. |
OK |
PyPy 2 |
TESTS |
48 |
1840 |
30105600 |
|
2000 |
29929251 |
pluristiq |
C |
Aug. 30, 2017, 6:09 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
1949 |
39526400 |
|
2000 |
29886447 |
xuanquang1999 |
C |
Aug. 29, 2017, 4:01 p.m. |
OK |
Ruby |
TESTS |
48 |
1716 |
111104000 |
|
2000 |
29916174 |
Key_v2 |
C |
Aug. 30, 2017, 11:46 a.m. |
OK |
Ruby |
TESTS |
48 |
1855 |
114073600 |
|
2000 |
30230962 |
Hillmouse |
C |
Sept. 9, 2017, 5:20 p.m. |
OK |
Rust |
TESTS |
48 |
577 |
142950400 |
|
2000 |
remove filters
Back to search problems