Codeforces Round 237 (Div. 2)

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
404 Codeforces Round 237 (Div. 2) FINISHED False 7200 342196187 March 19, 2014, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5308 ) C Restore Graph PROGRAMMING dfs and similar graphs sortings 1800

B"Valera had an undirected connected graph without self-loops and multiple edges consisting of n vertices. The graph had an interesting property: there were at most k edges adjacent to each of its vertices. For convenience, we will assume that the graph vertices were indexed by integers from 1 to n. One day Valera counted the shortest distances from one of the graph vertices to all other ones and wrote them out in array d. Thus, element d[i] of the array shows the shortest distance from the vertex Valera chose to vertex number i. Then something irreparable terrible happened. Valera lost the initial graph. However, he still has the array d. Help him restore the lost graph. The first line contains two space-separated integers n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89< xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Number n shows the number of vertices in the original graph. Number k shows that at most k edges were adjacent to each vertex in the original graph. The second line contains space-separated integers d[1], xe2 x80 x89d[2], xe2 x80 x89..., xe2 x80 x89d[n] (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89d[i] xe2 x80 x89< xe2 x80 x89n). Number d[i] shows the shortest distance from the vertex Valera chose to the vertex number i. If Valera made a mistake in his notes and the required graph doesn't exist, print in the first line number -1. Otherwise, in the first line print integer m (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- the number of edges in the found graph. In each of the next m lines print two space-separated integers ai and bi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai, xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n; ai xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89bi), denoting the edge that connects vertices with numbers ai and bi. The graph shouldn't contain self-loops and multiple edges. If there are multiple possible answers, print any of them."...

Tutorials

Codeforces Round #237 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
6099562 AHTuTTuTyX C March 21, 2014, 3:45 p.m. OK Delphi TESTS 43 62 3276800 1800
6081160 I_love_PMK C March 19, 2014, 5:55 p.m. OK Delphi TESTS 43 62 10035200 1800
6128944 Ramp C March 24, 2014, 6:35 a.m. OK Delphi TESTS 43 77 80179200 1800
6082493 aandrukhovich C March 19, 2014, 6:31 p.m. OK Delphi TESTS 43 92 2048000 1800
6091416 artem1416 C March 20, 2014, 1:40 p.m. OK Delphi TESTS 43 93 6041600 1800
6090826 ruban C March 20, 2014, 12:26 p.m. OK Delphi TESTS 43 93 46694400 1800
6090762 ruban C March 20, 2014, 12:17 p.m. OK Delphi TESTS 43 139 50892800 1800
6291441 BlueHya C April 7, 2014, 3:53 a.m. OK FPC TESTS 43 187 1228800 1800
14436050 Gray_58 C Nov. 24, 2015, 7:18 a.m. OK FPC TESTS 43 187 11161600 1800
10166079 HelenaBond C March 5, 2015, 3:31 p.m. OK FPC TESTS 43 202 1638400 1800
6091653 AllCatsAreBeautiful C March 20, 2014, 2:02 p.m. OK FPC TESTS 43 202 2048000 1800
11049010 Astreb C May 8, 2015, 6:43 p.m. OK FPC TESTS 43 202 3276800 1800
6167947 I_Love_EEvilCatt C March 28, 2014, 3:16 p.m. OK FPC TESTS 43 202 9625600 1800
6099381 xurenzhe C March 21, 2014, 3:02 p.m. OK FPC TESTS 43 202 40140800 1800
6194549 pqhuy98 C March 31, 2014, 2:48 a.m. OK FPC TESTS 43 217 2457600 1800
12252752 Felix_Mate C July 28, 2015, 1:43 p.m. OK FPC TESTS 43 217 3993600 1800
6604255 Gnouc C May 12, 2014, 2:30 p.m. OK FPC TESTS 43 217 9625600 1800
6130037 Blesthee C March 24, 2014, 10:09 a.m. OK GNU C TESTS 43 62 1228800 1800
6097277 sdlzx C March 21, 2014, 9:01 a.m. OK GNU C TESTS 43 62 1228800 1800
6085779 Kevinrobot34 C March 20, 2014, 3:45 a.m. OK GNU C TESTS 43 62 2048000 1800
6140080 BUPT_birdstorm C March 25, 2014, 3:24 p.m. OK GNU C TESTS 43 77 1228800 1800
11837677 sanketM C June 29, 2015, 2:19 p.m. OK GNU C TESTS 43 77 4403200 1800
6083827 zeosutt C March 19, 2014, 8:39 p.m. OK GNU C TESTS 43 77 8294400 1800
6129986 Blesthee C March 24, 2014, 9:59 a.m. OK GNU C TESTS 43 78 1228800 1800
6083833 zeosutt C March 19, 2014, 8:40 p.m. OK GNU C TESTS 43 78 8294400 1800
27739792 srijansingh C June 12, 2017, 2:39 p.m. OK GNU C TESTS 43 78 9625600 1800
20327043 rainboy C Sept. 1, 2016, 5:04 p.m. OK GNU C TESTS 43 93 1228800 1800
8237507 changwow C Oct. 15, 2014, 1:27 p.m. OK GNU C++ TESTS 43 46 2969600 1800
6084014 kojak_ C March 19, 2014, 9:11 p.m. OK GNU C++ TESTS 43 46 3379200 1800
34790688 fyy2603 C Feb. 1, 2018, 5:48 a.m. OK GNU C++ TESTS 43 46 22630400 1800
7477880 MaicoLeberle C Aug. 16, 2014, 12:02 a.m. OK GNU C++ TESTS 43 61 2969600 1800
7477854 IMartin C Aug. 15, 2014, 11:54 p.m. OK GNU C++ TESTS 43 61 2969600 1800
34893054 juruo_sten C Feb. 3, 2018, 11:28 a.m. OK GNU C++ TESTS 43 61 4710400 1800
6098906 nealzane C March 21, 2014, 1:44 p.m. OK GNU C++ TESTS 43 61 5529600 1800
8235042 catfish C Oct. 15, 2014, 8:29 a.m. OK GNU C++ TESTS 43 61 5939200 1800
6085887 phamvanhanhgoldIOI2015 C March 20, 2014, 4:08 a.m. OK GNU C++ TESTS 43 61 6348800 1800
6086735 Rex-myFriendForever C March 20, 2014, 5:59 a.m. OK GNU C++ TESTS 43 61 7065600 1800
6162394 ranasaha C March 27, 2014, 3:06 p.m. OK GNU C++0x TESTS 43 46 6246400 1800
6162361 ranasaha C March 27, 2014, 3:02 p.m. OK GNU C++0x TESTS 43 46 6246400 1800
6088532 alex_world C March 20, 2014, 6:54 a.m. OK GNU C++0x TESTS 43 61 5017600 1800
6080741 numa C March 19, 2014, 5:49 p.m. OK GNU C++0x TESTS 43 61 6144000 1800
6133336 rockytheprogrammer C March 24, 2014, 7:28 p.m. OK GNU C++0x TESTS 43 62 2969600 1800
6092112 niyaznigmatul C March 20, 2014, 2:57 p.m. OK GNU C++0x TESTS 43 62 2969600 1800
6091650 Flandre_Scarlet C March 20, 2014, 2:02 p.m. OK GNU C++0x TESTS 43 62 3072000 1800
6134039 danielfleischman C March 24, 2014, 11:43 p.m. OK GNU C++0x TESTS 43 62 3379200 1800
8030830 jc881203 C Sept. 29, 2014, 11:13 p.m. OK GNU C++0x TESTS 43 62 4096000 1800
6086492 tubo28 C March 20, 2014, 5:23 a.m. OK GNU C++0x TESTS 43 62 5017600 1800
43573584 dhruv1998 C Sept. 29, 2018, 1:56 p.m. OK GNU C++11 TESTS 43 31 4403200 1800
34957122 luogu_bot1 C Feb. 5, 2018, 11:23 p.m. OK GNU C++11 TESTS 43 61 5222400 1800
34790271 cly_none C Feb. 1, 2018, 5:32 a.m. OK GNU C++11 TESTS 43 61 6041600 1800
30737749 vjudge4 C Sept. 26, 2017, 1:28 a.m. OK GNU C++11 TESTS 43 62 1638400 1800
10627347 lxw C April 8, 2015, 5:23 a.m. OK GNU C++11 TESTS 43 62 2457600 1800
16688141 Svafaiet C March 13, 2016, 8:34 a.m. OK GNU C++11 TESTS 43 62 2764800 1800
14191352 2125659 C Nov. 11, 2015, 1:27 a.m. OK GNU C++11 TESTS 43 62 2764800 1800
29613288 homoeconomicus C Aug. 20, 2017, 5:19 a.m. OK GNU C++11 TESTS 43 62 3174400 1800
14036120 vivekkumar15 C Nov. 3, 2015, 2:37 a.m. OK GNU C++11 TESTS 43 62 3174400 1800
12988635 mowji C Sept. 13, 2015, 6:14 p.m. OK GNU C++11 TESTS 43 62 3174400 1800
45948203 Apale C Nov. 19, 2018, 3:15 a.m. OK GNU C++14 TESTS 43 62 2764800 1800
27723140 yassin_ C June 11, 2017, 3:15 p.m. OK GNU C++14 TESTS 43 62 3481600 1800
30181398 xsc C Sept. 7, 2017, 12:44 p.m. OK GNU C++14 TESTS 43 62 3686400 1800
41565968 Ezekieldor C Aug. 13, 2018, 5:27 p.m. OK GNU C++14 TESTS 43 62 4505600 1800
32232013 dionysios C Nov. 11, 2017, 11:12 p.m. OK GNU C++14 TESTS 43 62 4505600 1800
25807573 Klift C March 25, 2017, 10:25 p.m. OK GNU C++14 TESTS 43 62 4812800 1800
57123251 bnmd C July 16, 2019, 2:39 a.m. OK GNU C++14 TESTS 43 62 4915200 1800
50327822 iShibly C Feb. 22, 2019, 5:17 p.m. OK GNU C++14 TESTS 43 62 4915200 1800
31855685 murugappan_s C Oct. 29, 2017, 4:34 a.m. OK GNU C++14 TESTS 43 62 4915200 1800
30182897 xsc C Sept. 7, 2017, 1:52 p.m. OK GNU C++14 TESTS 43 62 5017600 1800
56560362 010000000010 C July 5, 2019, 2:36 p.m. OK GNU C++17 TESTS 43 62 2969600 1800
69647313 galen_colin C Jan. 28, 2020, 2:31 a.m. OK GNU C++17 TESTS 43 62 3379200 1800
52448792 Skr008 C April 7, 2019, 8:54 a.m. OK GNU C++17 TESTS 43 62 4505600 1800
57958238 MohamedKhaled C July 29, 2019, 8:04 p.m. OK GNU C++17 TESTS 43 62 4608000 1800
56416466 Fallen_Glory C July 2, 2019, 4:57 a.m. OK GNU C++17 TESTS 43 62 4915200 1800
55832685 mlyean C June 20, 2019, 1:54 p.m. OK GNU C++17 TESTS 43 62 4915200 1800
35094918 erove C Feb. 9, 2018, 3:05 p.m. OK GNU C++17 TESTS 43 62 6451200 1800
55207625 zpr C June 6, 2019, 1:14 p.m. OK GNU C++17 TESTS 43 77 1228800 1800
53017076 purple_rAin C April 19, 2019, 2:39 p.m. OK GNU C++17 TESTS 43 77 2457600 1800
69655804 thtsshz_bgwrswh C Jan. 28, 2020, 7:23 a.m. OK GNU C++17 TESTS 43 77 2764800 1800
6096849 autotaker C March 21, 2014, 7:18 a.m. OK Haskell TESTS 43 280 18022400 1800
6080915 cojna C March 19, 2014, 5:51 p.m. OK Haskell TESTS 43 296 26419200 1800
6141556 alvelcom C March 25, 2014, 8:31 p.m. OK Haskell TESTS 43 561 15974400 1800
6141461 alvelcom C March 25, 2014, 8:12 p.m. OK Haskell TESTS 43 561 15974400 1800
6141478 alvelcom C March 25, 2014, 8:16 p.m. OK Haskell TESTS 43 576 15974400 1800
9432032 marcose18 C Jan. 14, 2015, 8:58 p.m. OK Java 6 TESTS 43 155 8294400 1800
6255475 hiukim C April 4, 2014, 3:50 a.m. OK Java 6 TESTS 43 156 307200 1800
6085499 I_love_Malika C March 20, 2014, 2:48 a.m. OK Java 6 TESTS 43 170 307200 1800
9328997 xiaowuc1 C Dec. 31, 2014, 1:53 a.m. OK Java 6 TESTS 43 171 204800 1800
6100879 Jedi_knight C March 21, 2014, 9:17 p.m. OK Java 6 TESTS 43 171 2457600 1800
6084530 joker23 C March 19, 2014, 10:53 p.m. OK Java 6 TESTS 43 171 11980800 1800
6085633 alibaba C March 20, 2014, 3:13 a.m. OK Java 6 TESTS 43 187 11980800 1800
6097268 mashinist C March 21, 2014, 8:59 a.m. OK Java 6 TESTS 43 202 409600 1800
6100012 GR1n C March 21, 2014, 5:41 p.m. OK Java 6 TESTS 43 249 16076800 1800
6163969 mkirsche C March 27, 2014, 9:34 p.m. OK Java 6 TESTS 43 296 409600 1800
6090513 Parikh C March 20, 2014, 11:44 a.m. OK Java 7 TESTS 43 109 2355200 1800
11770564 ankitstone C June 26, 2015, 9:25 a.m. OK Java 7 TESTS 43 140 0 1800
6172864 spandey128 C March 29, 2014, 10:13 a.m. OK Java 7 TESTS 43 140 0 1800
6472364 Alex_by C April 25, 2014, 11:29 a.m. OK Java 7 TESTS 43 140 102400 1800
6086110 KNIGHT0X300 C March 20, 2014, 4:39 a.m. OK Java 7 TESTS 43 155 0 1800
6500824 wadissimo C April 28, 2014, 2:54 p.m. OK Java 7 TESTS 43 155 2048000 1800
6082381 alexey.kasatkin C March 19, 2014, 6:26 p.m. OK Java 7 TESTS 43 155 9625600 1800
6082757 goldenfz C March 19, 2014, 6:44 p.m. OK Java 7 TESTS 43 155 10342400 1800
6097904 0p9o8i C March 21, 2014, 11:06 a.m. OK Java 7 TESTS 43 156 11980800 1800
6084568 1q2w3e4r C March 19, 2014, 11:04 p.m. OK Java 7 TESTS 43 156 11980800 1800
59701670 amolpratap007 C Aug. 30, 2019, 10:56 a.m. OK Java 8 TESTS 43 171 0 1800
68677395 -f00- C Jan. 12, 2020, 7:21 p.m. OK Java 8 TESTS 43 186 0 1800
59268106 prakhar897 C Aug. 22, 2019, 11:38 a.m. OK Java 8 TESTS 43 187 0 1800
49392769 Anonymous C Feb. 3, 2019, 10:54 a.m. OK Java 8 TESTS 43 187 3993600 1800
57822989 Java C July 27, 2019, 1:03 a.m. OK Java 8 TESTS 43 187 16281600 1800
41130321 prashantpiyush C Aug. 2, 2018, 4:55 p.m. OK Java 8 TESTS 43 202 0 1800
11927414 ak56 C July 4, 2015, 10:04 p.m. OK Java 8 TESTS 43 202 0 1800
9730045 hiro116s C Feb. 5, 2015, 5:19 p.m. OK Java 8 TESTS 43 202 0 1800
67569719 adarsh000321 C Dec. 24, 2019, 9:13 p.m. OK Java 8 TESTS 43 202 10444800 1800
69071066 sunnycarlos C Jan. 18, 2020, 9:55 p.m. OK Java 8 TESTS 43 202 10547200 1800
6619130 Eeyore C May 15, 2014, 7:35 a.m. OK JavaScript TESTS 43 139 36044800 1800
15322217 og.kostya C Jan. 12, 2016, 7:27 p.m. OK MS C# TESTS 43 93 6246400 1800
10648928 camypaper C April 10, 2015, 1:34 p.m. OK MS C# TESTS 43 124 17715200 1800
6457246 antofik C April 23, 2014, 9:12 p.m. OK MS C# TESTS 43 187 27033600 1800
6094611 azukun C March 20, 2014, 6:47 p.m. OK MS C# TESTS 43 404 19251200 1800
6094607 azukun C March 20, 2014, 6:46 p.m. OK MS C# TESTS 43 404 19251200 1800
17830924 Mem C May 10, 2016, 11:49 a.m. OK MS C# TESTS 43 420 35737600 1800
23024464 pomjuice C Dec. 16, 2016, 7:56 a.m. OK MS C# TESTS 43 920 26112000 1800
13412401 nicky_ua C Oct. 5, 2015, 8:22 a.m. OK MS C++ TESTS 43 62 1638400 1800
6159372 vjudge5 C March 27, 2014, 8:23 a.m. OK MS C++ TESTS 43 62 1843200 1800
6665269 sneltyn C May 21, 2014, 5:06 a.m. OK MS C++ TESTS 43 62 2867200 1800
6122425 TonySnark C March 23, 2014, 5:49 a.m. OK MS C++ TESTS 43 62 3276800 1800
6352850 cvm C April 14, 2014, 6:50 a.m. OK MS C++ TESTS 43 62 3481600 1800
6086471 pseudo C March 20, 2014, 5:20 a.m. OK MS C++ TESTS 43 62 4403200 1800
6105085 Koblyk C March 22, 2014, 12:32 p.m. OK MS C++ TESTS 43 62 4505600 1800
6092402 Scorpy C March 20, 2014, 3:35 p.m. OK MS C++ TESTS 43 62 4812800 1800
6458576 Valentin_E C April 24, 2014, 6:36 a.m. OK MS C++ TESTS 43 62 8806400 1800
6089952 Perforator C March 20, 2014, 10:25 a.m. OK MS C++ TESTS 43 77 3481600 1800
64531654 CtrlAlt C Nov. 8, 2019, 3:37 p.m. OK MS C++ 2017 TESTS 43 233 7782400 1800
6191407 Simon C March 30, 2014, 2:09 p.m. OK Ocaml TESTS 43 343 9728000 1800
6128880 vnct0311 C March 24, 2014, 6:16 a.m. OK PHP TESTS 43 982 39424000 1800
16190538 zetilovn C Feb. 19, 2016, 2:26 a.m. OK PyPy 2 TESTS 43 171 17612800 1800
34078056 burakbugrul C Jan. 10, 2018, 10:17 p.m. OK PyPy 3 TESTS 43 343 42393600 1800
57917592 romil797 C July 29, 2019, 2:31 a.m. OK PyPy 3 TESTS 43 389 19968000 1800
56256315 Mr.Inconsistent C June 29, 2019, 6:16 a.m. OK PyPy 3 TESTS 43 623 24678400 1800
33903236 qiliux C Jan. 4, 2018, 12:43 p.m. OK PyPy 3 TESTS 43 779 56627200 1800
19283186 SyntexError C July 20, 2016, 2:58 p.m. OK Python 2 TESTS 43 311 16076800 1800
7302029 hokun C July 31, 2014, 7:17 p.m. OK Python 2 TESTS 43 342 16281600 1800
9770851 Lei_Xufei C Feb. 8, 2015, 11:55 a.m. OK Python 2 TESTS 43 374 17510400 1800
11101402 brodo C May 14, 2015, 6:26 p.m. OK Python 2 TESTS 43 420 26624000 1800
6084624 Danstahr C March 19, 2014, 11:22 p.m. OK Python 2 TESTS 43 436 15872000 1800
6157785 NewSophia C March 26, 2014, 10:57 p.m. OK Python 2 TESTS 43 436 22732800 1800
6079565 dolphinQ C March 19, 2014, 5:19 p.m. OK Python 2 TESTS 43 436 27750400 1800
6079568 papepipupo C March 19, 2014, 5:19 p.m. OK Python 2 TESTS 43 545 25497600 1800
6085404 mzhang C March 20, 2014, 2:32 a.m. OK Python 2 TESTS 43 576 22425600 1800
6080333 fredy10 C March 19, 2014, 5:27 p.m. OK Python 3 TESTS 43 312 16384000 1800
6480047 yugle7 C April 26, 2014, 4:33 p.m. OK Python 3 TESTS 43 451 22323200 1800
36754001 vjudge4 C March 30, 2018, 4:50 p.m. OK Python 3 TESTS 43 452 27955200 1800
7059777 Shiz0 C July 10, 2014, 4 p.m. OK Python 3 TESTS 43 499 26726400 1800
60304068 Vendetta. C Sept. 9, 2019, 1:13 p.m. OK Python 3 TESTS 43 701 16179200 1800
52373569 vinodreddyg28 C April 6, 2019, 7:19 a.m. OK Python 3 TESTS 43 717 12697600 1800
58919410 Vendetta. C Aug. 16, 2019, 4:23 p.m. OK Python 3 TESTS 43 717 21811200 1800
7929996 WARenie C Sept. 23, 2014, 6:04 p.m. OK Python 3 TESTS 43 951 11878400 1800
6099690 citrux C March 21, 2014, 4:16 p.m. OK Python 3 TESTS 43 967 11878400 1800
35870194 ______u______ C March 3, 2018, 6:22 a.m. OK Python 3 TESTS 43 967 17510400 1800
6092932 UnkelTao C March 20, 2014, 4:59 p.m. OK Ruby TESTS 43 998 32563200 1800

remove filters

Back to search problems