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 |
70
|
Codeforces Beta Round 64 |
FINISHED |
False |
7200 |
437061561 |
March 26, 2011, 4 p.m. |
Problems
B"Thought it is already the XXI century, the Mass Media isn't very popular in Walrusland. The cities get news from messengers who can only travel along roads. The network of roads in Walrusland is built so that it is possible to get to any city from any other one in exactly one way, and the roads' lengths are equal. The North Pole governor decided to carry out an information reform. Several cities were decided to be chosen and made regional centers. Maintaining a region center takes k fishlars (which is a local currency) per year. It is assumed that a regional center always has information on the latest news. For every city which is not a regional center, it was decided to appoint a regional center which will be responsible for keeping this city informed. In that case the maintenance costs will be equal to dlen fishlars per year, where len is the distance from a city to the corresponding regional center, measured in the number of roads along which one needs to go. Your task is to minimize the costs to carry out the reform. The first line contains two given numbers n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89180, xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The second line contains n xe2 x80 x89- xe2 x80 x891 integers di, numbered starting with 1 (di xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89di xe2 x80 x89+ xe2 x80 x891, xe2 x80 x890 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89di xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Next n xe2 x80 x89- xe2 x80 x891 lines contain the pairs of cities connected by a road. On the first line print the minimum number of fishlars needed for a year's maintenance. On the second line print n numbers, where the i-th number will represent the number of the regional center, appointed to the i-th city. If the i-th city is a regional center itself, then you should print number i. If there are several solutions to that problem, print any of them."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
1183550 |
zanoes |
E |
Feb. 16, 2012, 7:08 a.m. |
OK |
Delphi |
TESTS |
70 |
60 |
34099200 |
|
2700 |
391891 |
ljnanest |
E |
April 15, 2011, 4:28 p.m. |
OK |
FPC |
TESTS |
70 |
30 |
1331200 |
|
2700 |
388127 |
ljnanest |
E |
April 14, 2011, 4:32 p.m. |
OK |
FPC |
TESTS |
70 |
30 |
1331200 |
|
2700 |
388107 |
ljnanest |
E |
April 14, 2011, 4:19 p.m. |
OK |
FPC |
TESTS |
70 |
30 |
1536000 |
|
2700 |
4131778 |
sjtu |
E |
July 22, 2013, 1:52 a.m. |
OK |
FPC |
TESTS |
70 |
31 |
409600 |
|
2700 |
2655766 |
lydrainbowcat |
E |
Nov. 26, 2012, 3:38 a.m. |
OK |
FPC |
TESTS |
70 |
31 |
32870400 |
|
2700 |
1848276 |
jtc172 |
E |
July 2, 2012, 2:24 a.m. |
OK |
FPC |
TESTS |
70 |
50 |
4096000 |
|
2700 |
475664 |
vlad107 |
E |
June 4, 2011, 1:45 p.m. |
OK |
FPC |
TESTS |
70 |
50 |
9830400 |
|
2700 |
13183150 |
vjudge3 |
E |
Sept. 23, 2015, 11:14 a.m. |
OK |
FPC |
TESTS |
70 |
62 |
102400 |
|
2700 |
10300286 |
vjudge3 |
E |
March 16, 2015, 1:17 p.m. |
OK |
FPC |
TESTS |
70 |
62 |
512000 |
|
2700 |
1509003 |
sillycross |
E |
April 10, 2012, 3:49 p.m. |
OK |
FPC |
TESTS |
70 |
90 |
1638400 |
|
2700 |
2805338 |
shmily552255 |
E |
Dec. 22, 2012, 4:53 a.m. |
OK |
GNU C++ |
TESTS |
70 |
15 |
307200 |
|
2700 |
2875411 |
shyoshyohw1 |
E |
Jan. 5, 2013, 3:05 p.m. |
OK |
GNU C++ |
TESTS |
70 |
15 |
409600 |
|
2700 |
4045020 |
ufo_go |
E |
July 10, 2013, 5:30 a.m. |
OK |
GNU C++ |
TESTS |
70 |
15 |
512000 |
|
2700 |
2898714 |
ChuckLin2014 |
E |
Jan. 9, 2013, 9:06 a.m. |
OK |
GNU C++ |
TESTS |
70 |
15 |
512000 |
|
2700 |
2898606 |
yjc9696 |
E |
Jan. 9, 2013, 8:42 a.m. |
OK |
GNU C++ |
TESTS |
70 |
15 |
3072000 |
|
2700 |
22921292 |
Jin_Haonan |
E |
Dec. 13, 2016, 7:20 a.m. |
OK |
GNU C++ |
TESTS |
70 |
30 |
102400 |
|
2700 |
13829431 |
130705009 |
E |
Oct. 24, 2015, 6:25 p.m. |
OK |
GNU C++ |
TESTS |
70 |
30 |
102400 |
|
2700 |
12271016 |
vjudge5 |
E |
July 30, 2015, 3:14 a.m. |
OK |
GNU C++ |
TESTS |
70 |
30 |
102400 |
|
2700 |
5546440 |
zhj |
E |
Dec. 29, 2013, 8:05 a.m. |
OK |
GNU C++ |
TESTS |
70 |
30 |
307200 |
|
2700 |
5540322 |
wakaka |
E |
Dec. 28, 2013, 1:23 p.m. |
OK |
GNU C++ |
TESTS |
70 |
30 |
307200 |
|
2700 |
2794267 |
dc. |
E |
Dec. 19, 2012, 11 a.m. |
OK |
GNU C++0x |
TESTS |
70 |
15 |
2969600 |
|
2700 |
5526276 |
Zuza |
E |
Dec. 26, 2013, 5:25 p.m. |
OK |
GNU C++0x |
TESTS |
70 |
30 |
819200 |
|
2700 |
2789225 |
apia |
E |
Dec. 18, 2012, 2:26 a.m. |
OK |
GNU C++0x |
TESTS |
70 |
31 |
409600 |
|
2700 |
2789152 |
llj_bash |
E |
Dec. 18, 2012, 1:42 a.m. |
OK |
GNU C++0x |
TESTS |
70 |
31 |
409600 |
|
2700 |
33514515 |
EmanuelNrx |
E |
Dec. 22, 2017, 4:36 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
30 |
2355200 |
|
2700 |
24363870 |
amsen |
E |
Feb. 2, 2017, 12:21 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
30 |
2764800 |
|
2700 |
24292170 |
i_love_sarah |
E |
Jan. 31, 2017, 2:11 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
30 |
2764800 |
|
2700 |
16703465 |
Roms |
E |
March 13, 2016, 7:34 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
30 |
4403200 |
|
2700 |
34213071 |
FlappyFish |
E |
Jan. 16, 2018, 5:25 a.m. |
OK |
GNU C++11 |
TESTS |
70 |
60 |
2457600 |
|
2700 |
57905874 |
lopare |
E |
July 28, 2019, 5:35 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
62 |
204800 |
|
2700 |
51058721 |
Siyuan |
E |
March 9, 2019, 1:19 a.m. |
OK |
GNU C++11 |
TESTS |
70 |
62 |
204800 |
|
2700 |
57126519 |
shenmadongdong |
E |
July 16, 2019, 4:48 a.m. |
OK |
GNU C++11 |
TESTS |
70 |
62 |
307200 |
|
2700 |
61217311 |
Liah |
E |
Sept. 24, 2019, 1:03 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
62 |
307200 |
|
2700 |
60601743 |
CMZ |
E |
Sept. 15, 2019, 8:05 a.m. |
OK |
GNU C++11 |
TESTS |
70 |
62 |
307200 |
|
2700 |
33917862 |
-wawawa8 |
E |
Jan. 5, 2018, 8:21 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
2457600 |
|
2700 |
57305455 |
vjudge2 |
E |
July 19, 2019, 3:23 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
62 |
307200 |
|
2700 |
57305438 |
vjudge5 |
E |
July 19, 2019, 3:22 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
62 |
307200 |
|
2700 |
56016522 |
sorry_im_smurfing |
E |
June 24, 2019, 9:42 p.m. |
OK |
GNU C++14 |
TESTS |
70 |
62 |
307200 |
|
2700 |
51071746 |
GJC_xj |
E |
March 9, 2019, 7:56 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
62 |
307200 |
|
2700 |
51070390 |
Amorphophallus |
E |
March 9, 2019, 7:27 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
62 |
307200 |
|
2700 |
45263542 |
little_waxberry |
E |
Nov. 4, 2018, 4:12 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
62 |
307200 |
|
2700 |
45262966 |
FelixChen |
E |
Nov. 4, 2018, 3:41 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
62 |
307200 |
|
2700 |
43571088 |
vjudge5 |
E |
Sept. 29, 2018, 1 p.m. |
OK |
GNU C++14 |
TESTS |
70 |
62 |
307200 |
|
2700 |
22193188 |
2016 |
E |
Nov. 13, 2016, 12:57 p.m. |
OK |
GNU C++14 |
TESTS |
70 |
62 |
307200 |
|
2700 |
56744246 |
Shayan.P |
E |
July 9, 2019, 8:57 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
307200 |
|
2700 |
39009847 |
ruo |
E |
June 7, 2018, 5:53 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
307200 |
|
2700 |
64511915 |
hjk1030 |
E |
Nov. 8, 2019, 9:07 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
409600 |
|
2700 |
64456532 |
charlieyan |
E |
Nov. 7, 2019, 8:54 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
409600 |
|
2700 |
63763331 |
Patti |
E |
Oct. 30, 2019, 5:08 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
409600 |
|
2700 |
39668442 |
BaCl2 |
E |
June 26, 2018, 7:25 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
409600 |
|
2700 |
45761645 |
Liwj |
E |
Nov. 15, 2018, 9:26 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
512000 |
|
2700 |
45310466 |
lqs2015 |
E |
Nov. 5, 2018, 3:29 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
512000 |
|
2700 |
63984248 |
wangyc |
E |
Nov. 1, 2019, 11:15 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
614400 |
|
2700 |
51221147 |
qinyuyang |
E |
March 12, 2019, 12:30 p.m. |
OK |
GNU C++17 |
TESTS |
70 |
62 |
716800 |
|
2700 |
358190 |
Petr |
E |
March 26, 2011, 5:25 p.m. |
OK |
Java 6 |
TESTS |
70 |
730 |
190464000 |
|
2700 |
370555 |
Hadi_Asiaie |
E |
April 5, 2011, 6:19 p.m. |
OK |
Java 6 |
TESTS |
70 |
810 |
98918400 |
|
2700 |
360989 |
Dumbear |
E |
March 28, 2011, 2:24 p.m. |
OK |
Mono C# |
TESTS |
70 |
130 |
6246400 |
|
2700 |
358743 |
e-maxx |
E |
March 26, 2011, 5:53 p.m. |
OK |
MS C++ |
TESTS |
70 |
50 |
3174400 |
|
2700 |
57317525 |
vjudge5 |
E |
July 19, 2019, 8:45 a.m. |
OK |
MS C++ |
TESTS |
70 |
92 |
307200 |
|
2700 |
57317566 |
vjudge4 |
E |
July 19, 2019, 8:46 a.m. |
OK |
MS C++ |
TESTS |
70 |
92 |
307200 |
|
2700 |
57450240 |
vjudge1 |
E |
July 21, 2019, 9:29 a.m. |
OK |
MS C++ |
TESTS |
70 |
92 |
409600 |
|
2700 |
57450194 |
vjudge1 |
E |
July 21, 2019, 9:28 a.m. |
OK |
MS C++ |
TESTS |
70 |
92 |
409600 |
|
2700 |
57283970 |
vjudge1 |
E |
July 18, 2019, 1:49 p.m. |
OK |
MS C++ |
TESTS |
70 |
92 |
512000 |
|
2700 |
57283946 |
vjudge2 |
E |
July 18, 2019, 1:49 p.m. |
OK |
MS C++ |
TESTS |
70 |
92 |
512000 |
|
2700 |
51107618 |
vjudge2 |
E |
March 10, 2019, 1:01 a.m. |
OK |
MS C++ |
TESTS |
70 |
92 |
614400 |
|
2700 |
43564554 |
vjudge2 |
E |
Sept. 29, 2018, 10:35 a.m. |
OK |
MS C++ |
TESTS |
70 |
92 |
716800 |
|
2700 |
57318570 |
vjudge2 |
E |
July 19, 2019, 9:05 a.m. |
OK |
MS C++ |
TESTS |
70 |
92 |
1536000 |
|
2700 |
remove filters
Back to search problems