Codeforces Round 302 (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
543 Codeforces Round 302 (Div. 1) FINISHED False 7200 306422987 May 7, 2015, 4:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4192 ) B Destroying Roads PROGRAMMING constructive algorithms graphs shortest paths 2300

B'In some country there are exactly n cities and m bidirectional roads connecting the cities. Cities are numbered with integers from 1 to n. If cities a and b are connected by a road, then in an hour you can go along this road either from city a to city b, or from city b to city a. The road network is such that from any city you can get to any other one by moving along the roads. You want to destroy the largest possible number of roads in the country so that the remaining roads would allow you to get from city s1 to city t1 in at most l1 hours and get from city s2 to city t2 in at most l2 hours. Determine what maximum number of roads you need to destroy in order to meet the condition of your plan. If it is impossible to reach the desired result, print -1. The first line contains two integers n, m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x893000, ) -- the number of cities and roads in the country, respectively. Next m lines contain the descriptions of the roads as pairs of integers ai, 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). It is guaranteed that the roads that are given in the description can transport you from any city to any other one. It is guaranteed that each pair of cities has at most one road between them. The last two lines contains three integers each, s1, t1, l1 and s2, t2, l2, respectively (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89si, xe2 x80 x89ti xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89li xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). Print a single number -- the answer to the problem. If the it is impossible to meet the conditions, print -1.'...

Tutorials

Editorial Codeforces Round #302

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
11025930 Alex_2oo8 B May 7, 2015, 5:03 p.m. OK FPC TESTS 63 265 36352000 2300
11035628 RomanDerkach B May 7, 2015, 8:14 p.m. OK FPC TESTS 63 265 36352000 2300
11085883 Djeneral B May 13, 2015, 6:46 a.m. OK FPC TESTS 63 280 36454400 2300
11051371 vjudge1 B May 9, 2015, 3:26 a.m. OK FPC TESTS 63 295 36454400 2300
11310933 vjudge3 B May 27, 2015, 12:43 a.m. OK FPC TESTS 63 296 36249600 2300
11271200 Amr_Hassan B May 25, 2015, 10:12 p.m. OK FPC TESTS 63 296 36454400 2300
11139939 ez_cjb B May 19, 2015, 2:43 a.m. OK FPC TESTS 63 296 108236800 2300
11256338 vjudge3 B May 24, 2015, 3:54 p.m. OK FPC TESTS 63 312 36147200 2300
11346487 jiangyx B May 29, 2015, 1:54 p.m. OK FPC TESTS 63 327 36249600 2300
11034240 AbstractKangaroo B May 7, 2015, 7 p.m. OK FPC TESTS 63 343 37990400 2300
22364067 vjudge5 B Nov. 20, 2016, 1:09 p.m. OK GNU C++ TESTS 63 46 204800 2300
11179950 henyumen B May 20, 2015, 4:07 p.m. OK GNU C++ TESTS 63 46 145305600 2300
12473061 MeoXumi B Aug. 12, 2015, 3:08 a.m. OK GNU C++ TESTS 63 93 72806400 2300
11043221 randomstr B May 8, 2015, 12:25 p.m. OK GNU C++ TESTS 63 140 204800 2300
11027374 netman B May 7, 2015, 5:18 p.m. OK GNU C++ TESTS 63 140 204800 2300
25954529 vjudge5 B March 30, 2017, 1:51 p.m. OK GNU C++ TESTS 63 140 2252800 2300
11173970 yutaka1999 B May 20, 2015, 7:10 a.m. OK GNU C++ TESTS 63 156 204800 2300
30931978 vjudge3 B Oct. 2, 2017, 3:07 a.m. OK GNU C++ TESTS 63 156 204800 2300
11072781 M_W B May 11, 2015, 6:30 p.m. OK GNU C++ TESTS 63 156 204800 2300
11401754 vjudge3 B June 3, 2015, 12:49 p.m. OK GNU C++ TESTS 63 156 307200 2300
60446413 rainboy B Sept. 12, 2019, 2:18 p.m. OK GNU C11 TESTS 63 187 36147200 2300
40986657 ReaLNero1 B July 30, 2018, 8:40 p.m. OK GNU C++11 TESTS 63 31 204800 2300
24256183 xsc B Jan. 29, 2017, 9:25 p.m. OK GNU C++11 TESTS 63 31 2355200 2300
11126922 keambar B May 17, 2015, 1:34 p.m. OK GNU C++11 TESTS 63 46 145305600 2300
43514432 Ulises0998 B Sept. 28, 2018, 3:19 a.m. OK GNU C++11 TESTS 63 46 145305600 2300
43503488 edherrey B Sept. 27, 2018, 6:11 p.m. OK GNU C++11 TESTS 63 62 145305600 2300
11055792 FizzyDavid B May 9, 2015, 2:53 p.m. OK GNU C++11 TESTS 63 77 204800 2300
11080626 harhrayr B May 12, 2015, 5:26 p.m. OK GNU C++11 TESTS 63 124 204800 2300
11032120 Umqra B May 7, 2015, 6:16 p.m. OK GNU C++11 TESTS 63 124 204800 2300
14288778 cristi.dospra B Nov. 15, 2015, 7:53 p.m. OK GNU C++11 TESTS 63 124 204800 2300
11052707 FizzyDavid B May 9, 2015, 7:54 a.m. OK GNU C++11 TESTS 63 139 204800 2300
33002952 vjudge1 B Dec. 7, 2017, 2:11 p.m. OK GNU C++14 TESTS 63 124 40140800 2300
25954501 YanHan22 B March 30, 2017, 1:50 p.m. OK GNU C++14 TESTS 63 139 2252800 2300
30808206 jtnydv25 B Sept. 28, 2017, 2:47 p.m. OK GNU C++14 TESTS 63 139 36454400 2300
53644995 Yuki726 B May 1, 2019, 6:24 p.m. OK GNU C++14 TESTS 63 140 307200 2300
53645078 Yuki726 B May 1, 2019, 6:27 p.m. OK GNU C++14 TESTS 63 140 307200 2300
49058310 NiKS001 B Jan. 27, 2019, 2:16 p.m. OK GNU C++14 TESTS 63 140 36352000 2300
33138292 4l5n3 B Dec. 11, 2017, 8:18 p.m. OK GNU C++14 TESTS 63 140 38297600 2300
59392927 Scut82 B Aug. 24, 2019, 9:15 a.m. OK GNU C++14 TESTS 63 155 36556800 2300
66883060 amirmohammad-nezami B Dec. 14, 2019, 5:14 p.m. OK GNU C++14 TESTS 63 155 38809600 2300
27550359 Antoine B June 3, 2017, 6:31 p.m. OK GNU C++14 TESTS 63 156 36352000 2300
58570335 EL_3AQ-Why_not B Aug. 11, 2019, 9:52 a.m. OK GNU C++17 TESTS 63 155 36454400 2300
65023073 newbie1103 B Nov. 15, 2019, 6:17 a.m. OK GNU C++17 TESTS 63 155 36454400 2300
50097715 Vahm B Feb. 18, 2019, 1:30 p.m. OK GNU C++17 TESTS 63 156 36556800 2300
67002346 rohamizadidoost B Dec. 16, 2019, 6:23 a.m. OK GNU C++17 TESTS 63 171 36454400 2300
52782061 kimoyami B April 15, 2019, 2:53 p.m. OK GNU C++17 TESTS 63 171 36556800 2300
47973056 2ooWeak2ooSlow2ooDumb B Jan. 5, 2019, 4:02 p.m. OK GNU C++17 TESTS 63 171 36761600 2300
45555617 iura B Nov. 11, 2018, 8:22 a.m. OK GNU C++17 TESTS 63 171 36864000 2300
67795320 super_aiderton B Dec. 28, 2019, 4:23 p.m. OK GNU C++17 TESTS 63 186 36454400 2300
55732006 solaimanope B June 18, 2019, 10:29 p.m. OK GNU C++17 TESTS 63 186 36556800 2300
60727215 hackcyborg B Sept. 17, 2019, 2:20 p.m. OK GNU C++17 TESTS 63 187 409600 2300
11057880 mipt.vi002 B May 9, 2015, 8:40 p.m. OK Haskell TESTS 63 1248 65331200 2300
11057950 mipt.vi002 B May 9, 2015, 8:57 p.m. OK Haskell TESTS 63 1279 68505600 2300
11032797 dusty.and.rusty B May 7, 2015, 6:25 p.m. OK Java 7 TESTS 63 311 0 2300
11023829 pashka B May 7, 2015, 4:46 p.m. OK Java 7 TESTS 63 451 50585600 2300
11028855 Sergey.Bankevich B May 7, 2015, 5:35 p.m. OK Java 7 TESTS 63 467 45056000 2300
12529388 ACLhj B Aug. 14, 2015, 11:58 a.m. OK Java 7 TESTS 63 483 74137600 2300
11037884 uwi B May 8, 2015, 4:12 a.m. OK Java 7 TESTS 63 670 70041600 2300
11094064 AlwaysNewbie B May 14, 2015, 1:11 a.m. OK Java 7 TESTS 63 686 118579200 2300
12679207 vjudge2 B Aug. 24, 2015, 3:10 a.m. OK Java 7 TESTS 63 701 54374400 2300
12679214 WonderMouse B Aug. 24, 2015, 3:11 a.m. OK Java 7 TESTS 63 702 54374400 2300
12679202 WonderMouse B Aug. 24, 2015, 3:09 a.m. OK Java 7 TESTS 63 716 54169600 2300
11026971 PlayLikeNeverB4 B May 7, 2015, 5:13 p.m. OK Java 7 TESTS 63 748 49152000 2300
11382512 MVesterli B June 1, 2015, 6:50 p.m. OK Java 8 TESTS 63 327 0 2300
42438123 aman28rwt B Sept. 3, 2018, 6:34 p.m. OK Java 8 TESTS 63 374 34304000 2300
60446412 Dukkha B Sept. 12, 2019, 2:18 p.m. OK Java 8 TESTS 63 421 41881600 2300
11071826 hama-du B May 11, 2015, 4:08 p.m. OK Java 8 TESTS 63 436 46796800 2300
30279690 josif.tepegjozov B Sept. 12, 2017, 7:08 a.m. OK Java 8 TESTS 63 483 36147200 2300
11023920 Petr B May 7, 2015, 4:47 p.m. OK Java 8 TESTS 63 498 41267200 2300
11033885 AlexFetisov B May 7, 2015, 6:53 p.m. OK Java 8 TESTS 63 514 45465600 2300
11056543 yermak0v B May 9, 2015, 4:46 p.m. OK Java 8 TESTS 63 561 0 2300
11027740 dened B May 7, 2015, 5:21 p.m. OK Java 8 TESTS 63 561 0 2300
12320493 bubble000000 B Aug. 3, 2015, 3:33 a.m. OK Java 8 TESTS 63 576 47923200 2300
11048403 og.kostya B May 8, 2015, 5:36 p.m. OK MS C# TESTS 63 421 6860800 2300
11048323 og.kostya B May 8, 2015, 5:29 p.m. OK MS C# TESTS 63 436 6963200 2300
11029468 azukun B May 7, 2015, 5:41 p.m. OK MS C# TESTS 63 451 49868800 2300
16725761 pacificus B March 15, 2016, 10:40 a.m. OK MS C# TESTS 63 577 8908800 2300
11032249 iakolzin B May 7, 2015, 6:18 p.m. OK MS C++ TESTS 63 93 40652800 2300
11031832 dotorya B May 7, 2015, 6:12 p.m. OK MS C++ TESTS 63 187 37376000 2300
11043417 Taube B May 8, 2015, 12:48 p.m. OK MS C++ TESTS 63 202 204800 2300
11238609 Anarivu B May 23, 2015, 1:05 p.m. OK MS C++ TESTS 63 202 36352000 2300
11033402 InDaBag B May 7, 2015, 6:45 p.m. OK MS C++ TESTS 63 202 36352000 2300
11201781 Chromefish B May 22, 2015, 1:24 p.m. OK MS C++ TESTS 63 202 36454400 2300
11104211 Carups B May 15, 2015, 6:23 a.m. OK MS C++ TESTS 63 202 36659200 2300
11037569 kingofnumbers B May 8, 2015, 3:03 a.m. OK MS C++ TESTS 63 218 44646400 2300
11029376 Caesar B May 7, 2015, 5:40 p.m. OK MS C++ TESTS 63 218 44646400 2300
11030988 conglingdanpai B May 7, 2015, 6:01 p.m. OK MS C++ TESTS 63 233 36352000 2300
57486265 DDLiu B July 22, 2019, 5:27 a.m. OK MS C++ 2017 TESTS 63 436 69222400 2300
11055449 hsnprsd B May 9, 2015, 1:52 p.m. OK PyPy 2 TESTS 63 1060 46182400 2300
28652544 Ostkaka B July 18, 2017, 2:21 a.m. OK PyPy 2 TESTS 63 1185 68710400 2300
12219262 poikniok B July 24, 2015, 9:45 p.m. OK PyPy 2 TESTS 63 1840 64614400 2300
12219651 poikniok B July 24, 2015, 11:12 p.m. OK PyPy 2 TESTS 63 1934 64512000 2300
16500678 Nekrolm B March 3, 2016, 7:17 p.m. OK PyPy 3 TESTS 63 1153 49254400 2300

remove filters

Back to search problems