Codeforces Round 268 (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
468 Codeforces Round 268 (Div. 1) FINISHED False 7200 325961963 Sept. 20, 2014, 1 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 372 ) D Tree PROGRAMMING graph matchings 3000

B"Little X has a tree consisting of n nodes (they are numbered from 1 to n). Each edge of the tree has a positive length. Let's define the distance between two nodes v and u (we'll denote it d(v, xe2 x80 x89u)) as the sum of the lengths of edges in the shortest path between v and u. A permutation p is a sequence of n distinct integers p1, xe2 x80 x89p2, xe2 x80 x89..., xe2 x80 x89pn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). Little X wants to find a permutation p such that sum is maximal possible. If there are multiple optimal permutations, he wants to find the lexicographically smallest one. Help him with the task! The first line contains an integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Each of the next n xe2 x80 x89- xe2 x80 x891 lines contains three space separated integers ui, xe2 x80 x89 xe2 x80 x89vi, xe2 x80 x89wi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89 xe2 x80 x89ui, xe2 x80 x89 xe2 x80 x89vi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89 xe2 x80 x89n; 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89 xe2 x80 x89wi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89 xe2 x80 x89105), denoting an edge between nodes ui and vi with length equal to wi. It is guaranteed that these edges form a tree. In the first line print the maximum possible value of the described sum. In the second line print n integers, representing the lexicographically smallest permutation."...

Tutorials

13896

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
25833434 zhanglexing D March 27, 2017, 7:29 a.m. OK GNU C++ TESTS 53 78 15360000 3000
9963630 krijgertje D Feb. 22, 2015, 9:35 p.m. OK GNU C++ TESTS 53 93 13619200 3000
40987902 ReaLNero1 D July 30, 2018, 9:35 p.m. OK GNU C++ TESTS 53 108 13619200 3000
26471578 stony_oi D April 18, 2017, 8:26 a.m. OK GNU C++ TESTS 53 108 18124800 3000
8368736 Stilwell D Oct. 23, 2014, 2:40 p.m. OK GNU C++ TESTS 53 124 15360000 3000
37476054 zhhx D April 20, 2018, 2:41 a.m. OK GNU C++ TESTS 53 124 15872000 3000
29640216 vjudge1 D Aug. 21, 2017, 9:37 a.m. OK GNU C++ TESTS 53 140 13721600 3000
7912587 BSBandme D Sept. 22, 2014, 4:47 p.m. OK GNU C++ TESTS 53 140 16588800 3000
7912574 BSBandme D Sept. 22, 2014, 4:45 p.m. OK GNU C++ TESTS 53 155 16588800 3000
11008221 mohsen158 prince_Erfan D May 5, 2015, 6:33 p.m. OK GNU C++ TESTS 53 171 14233600 3000
7901588 pompon D Sept. 22, 2014, 12:21 a.m. OK GNU C++0x TESTS 53 155 15667200 3000
10039797 hogloid D Feb. 27, 2015, 4:09 a.m. OK GNU C++0x TESTS 53 171 19148800 3000
8347284 zhj D Oct. 22, 2014, 1:46 a.m. OK GNU C++0x TESTS 53 171 78336000 3000
9338982 zld3794955 D Jan. 1, 2015, 1:19 p.m. OK GNU C++0x TESTS 53 218 13824000 3000
7945924 zimpha D Sept. 25, 2014, 12:38 p.m. OK GNU C++0x TESTS 53 233 11980800 3000
7901940 Los_Angelos_Laycurse D Sept. 22, 2014, 2:14 a.m. OK GNU C++0x TESTS 53 233 30720000 3000
7927513 Plumrain D Sept. 23, 2014, 1:59 p.m. OK GNU C++0x TESTS 53 234 16179200 3000
7882883 snuke D Sept. 20, 2014, 3:27 p.m. OK GNU C++0x TESTS 53 248 17100800 3000
7902059 Nero D Sept. 22, 2014, 2:42 a.m. OK GNU C++0x TESTS 53 249 12185600 3000
7901949 Los_Angelos_Laycurse D Sept. 22, 2014, 2:16 a.m. OK GNU C++0x TESTS 53 280 30720000 3000
69509598 C20191629 D Jan. 25, 2020, 10:01 a.m. OK GNU C++11 TESTS 53 93 11571200 3000
69508650 C20191629 D Jan. 25, 2020, 9:40 a.m. OK GNU C++11 TESTS 53 109 11571200 3000
58891574 shaojianan D Aug. 16, 2019, 5:52 a.m. OK GNU C++11 TESTS 53 139 16486400 3000
53488492 Isonan D April 29, 2019, 6:37 a.m. OK GNU C++11 TESTS 53 156 17715200 3000
33381535 xc01 D Dec. 18, 2017, 1:50 p.m. OK GNU C++11 TESTS 53 171 15462400 3000
45155753 zhouyuyang D Nov. 1, 2018, 1:17 a.m. OK GNU C++11 TESTS 53 171 20480000 3000
69223689 luogu_bot3 D Jan. 21, 2020, 6:09 a.m. OK GNU C++11 TESTS 53 187 14540800 3000
69223258 luogu_bot2 D Jan. 21, 2020, 5:55 a.m. OK GNU C++11 TESTS 53 202 14643200 3000
69222668 luogu_bot5 D Jan. 21, 2020, 5:36 a.m. OK GNU C++11 TESTS 53 202 14643200 3000
58826279 asdfghjk D Aug. 14, 2019, 4 p.m. OK GNU C++11 TESTS 53 202 16076800 3000
45200892 Hamzqq9 D Nov. 2, 2018, 9:53 a.m. OK GNU C++14 TESTS 53 202 15564800 3000
37455375 CuriousCat.hzw D April 19, 2018, 8:16 a.m. OK GNU C++14 TESTS 53 218 26726400 3000
35163463 Errichto D Feb. 11, 2018, 8:43 p.m. OK GNU C++14 TESTS 53 234 12492800 3000
29546533 vjudge1 D Aug. 18, 2017, 8:39 a.m. OK GNU C++14 TESTS 53 234 13004800 3000
25761116 YOUSIKI D March 24, 2017, 1:44 a.m. OK GNU C++14 TESTS 53 249 13107200 3000
58795939 860579 D Aug. 14, 2019, 5:03 a.m. OK GNU C++14 TESTS 53 249 21708800 3000
69185756 loney_s D Jan. 20, 2020, 11:53 a.m. OK GNU C++14 TESTS 53 249 27238400 3000
45402502 KATATONIA D Nov. 7, 2018, 9:27 a.m. OK GNU C++14 TESTS 53 264 16384000 3000
67307324 smartnj D Dec. 20, 2019, 10:26 p.m. OK GNU C++14 TESTS 53 264 21299200 3000
38554805 cyz666 D May 23, 2018, 7:50 a.m. OK GNU C++14 TESTS 53 264 25907200 3000
59599867 aid D Aug. 28, 2019, 5:13 a.m. OK GNU C++17 TESTS 53 218 11776000 3000
49913560 chenyeyuan D Feb. 14, 2019, 3:22 p.m. OK GNU C++17 TESTS 53 218 26009600 3000
45980951 saketh D Nov. 19, 2018, 11:21 p.m. OK GNU C++17 TESTS 53 234 15257600 3000
60420701 ruo D Sept. 12, 2019, 5:48 a.m. OK GNU C++17 TESTS 53 249 18022400 3000
43096895 Als123 D Sept. 20, 2018, 1:05 a.m. OK GNU C++17 TESTS 53 264 15974400 3000
38531404 ddpag D May 22, 2018, 10:21 a.m. OK GNU C++17 TESTS 53 280 27238400 3000
55678582 Shayan.P D June 17, 2019, 11:51 a.m. OK GNU C++17 TESTS 53 467 15257600 3000
44475077 cxt D Oct. 18, 2018, 8:28 a.m. OK GNU C++17 TESTS 53 1170 16076800 3000
9208288 Yukii D Dec. 20, 2014, 3:52 p.m. OK Java 6 TESTS 53 1435 48537600 3000
9208281 vjudge5 D Dec. 20, 2014, 3:51 p.m. OK Java 6 TESTS 53 1497 48537600 3000
7888283 qwerty787788 D Sept. 20, 2014, 9:18 p.m. OK Java 7 TESTS 53 686 54272000 3000
8073076 Darooha D Oct. 3, 2014, 10:34 p.m. OK Ocaml TESTS 53 888 21504000 3000

remove filters

Back to search problems