Codeforces Round 490 (Div. 3)

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
999 Codeforces Round 490 (Div. 3) FINISHED False 7200 207847487 June 21, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6828 ) E Reachability from the Capital PROGRAMMING dfs and similar graphs greedy 1900

B'There are n cities and m roads in Berland. Each road connects a pair of cities. The roads in Berland are one-way. What is the minimum number of new roads that need to be built to make all the cities reachable from the capital? New roads will also be one-way. The first line of input consists of three integers n , m and s ( 1 <= n <= 5000, 0 <= m <= 5000, 1 <= s <= n ) -- the number of cities, the number of roads and the index of the capital. Cities are indexed from 1 to n . The following m lines contain roads: road i is given as a pair of cities u_i , v_i ( 1 <= u_i, v_i <= n , u_i ne v_i ). For each pair of cities (u, v) , there can be at most one road from u to v . Roads in opposite directions between a pair of cities are allowed (i.e. from u to v and from v to u ). Print one integer -- the minimum number of extra roads needed to make all the cities reachable from city s . If all the cities are already reachable from s , print 0. The first example is illustrated by the following: For example, you can add roads ( 6, 4 ), ( 7, 9 ), ( 1, 7 ) to make all the cities reachable from s = 1 . The second example is illustrated by the following: In this example, you can add any one of the roads ( 5, 1 ), ( 5, 2 ), ( 5, 3 ), ( 5, 4 ) to make all the cities reachable from s = 5 . '...

Tutorials

60138

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
63757552 rr_ E Oct. 30, 2019, 12:55 a.m. OK D TESTS 80 46 4505600 1900
52305079 ia7ck E April 4, 2019, 11:39 a.m. OK D TESTS 80 514 52838400 1900
39861204 C1ariS E July 2, 2018, 8:03 a.m. OK GNU C TESTS 80 31 2662400 1900
39959123 appleeated E July 4, 2018, 2:55 p.m. OK GNU C TESTS 80 31 100659200 1900
40081582 tanass E July 8, 2018, 10:08 a.m. OK GNU C TESTS 80 78 409600 1900
40081403 tanass E July 8, 2018, 9:59 a.m. OK GNU C TESTS 80 93 409600 1900
39965301 falcon_9 E July 4, 2018, 7:18 p.m. OK GNU C TESTS 80 686 100454400 1900
39965121 falcon_9 E July 4, 2018, 7:10 p.m. OK GNU C TESTS 80 702 100454400 1900
39598237 newbie2015 E June 24, 2018, 10:11 a.m. OK GNU C++ TESTS 80 30 409600 1900
41076549 yyhslfw E Aug. 1, 2018, 8:40 a.m. OK GNU C++ TESTS 80 30 614400 1900
41290718 vjudge2 E Aug. 7, 2018, 2:43 a.m. OK GNU C++ TESTS 80 31 204800 1900
39871913 sunny070309 E July 2, 2018, 3 p.m. OK GNU C++ TESTS 80 31 307200 1900
41557033 ___new2zy___ E Aug. 13, 2018, 11:58 a.m. OK GNU C++ TESTS 80 31 307200 1900
40670332 vjudge5 E July 23, 2018, 12:15 p.m. OK GNU C++ TESTS 80 31 307200 1900
40505911 fxt E July 18, 2018, 8:22 a.m. OK GNU C++ TESTS 80 31 307200 1900
39652970 luogu_bot4 E June 25, 2018, 2:56 p.m. OK GNU C++ TESTS 80 31 307200 1900
40916902 vjudge3 E July 29, 2018, 12:17 p.m. OK GNU C++ TESTS 80 31 409600 1900
40912734 Sanada-Masayuki E July 29, 2018, 9:49 a.m. OK GNU C++ TESTS 80 31 409600 1900
64146582 rubber_duckieOwOwO E Nov. 3, 2019, 10:05 a.m. OK GNU C11 TESTS 80 1248 307200 1900
39687508 pakili E June 26, 2018, 11:22 p.m. OK GNU C11 TESTS 80 1824 121241600 1900
44444540 Captain_Paul E Oct. 17, 2018, 1:25 p.m. OK GNU C++11 TESTS 80 30 204800 1900
39522397 Kalam E June 22, 2018, 4:38 p.m. OK GNU C++11 TESTS 80 30 512000 1900
39659515 w0nsh E June 25, 2018, 8:19 p.m. OK GNU C++11 TESTS 80 30 1024000 1900
55718599 Frame233 E June 18, 2019, 2:02 p.m. OK GNU C++11 TESTS 80 31 102400 1900
61901632 juzixiong E Oct. 5, 2019, 8:43 a.m. OK GNU C++11 TESTS 80 31 204800 1900
68229784 FCBM71 E Jan. 5, 2020, 8:45 a.m. OK GNU C++11 TESTS 80 31 204800 1900
64184239 luogu_bot2 E Nov. 4, 2019, 3:41 a.m. OK GNU C++11 TESTS 80 31 204800 1900
63430956 luogu_bot3 E Oct. 26, 2019, 9:07 a.m. OK GNU C++11 TESTS 80 31 204800 1900
47896151 luogu_bot4 E Jan. 4, 2019, 10:37 a.m. OK GNU C++11 TESTS 80 31 204800 1900
43904653 weng_233 E Oct. 6, 2018, 1:39 p.m. OK GNU C++11 TESTS 80 31 204800 1900
39528920 raghav.blacklist1 E June 22, 2018, 10:44 p.m. OK GNU C++14 TESTS 80 15 1228800 1900
39702158 raffleberry E June 27, 2018, 1:01 p.m. OK GNU C++14 TESTS 80 30 512000 1900
39601686 jarakcyc E June 24, 2018, 12:18 p.m. OK GNU C++14 TESTS 80 30 512000 1900
39600794 Zayed E June 24, 2018, 11:43 a.m. OK GNU C++14 TESTS 80 30 512000 1900
39514031 vivek_shah E June 22, 2018, 10:55 a.m. OK GNU C++14 TESTS 80 30 512000 1900
56733718 Gintoki E July 9, 2019, 3:31 a.m. OK GNU C++14 TESTS 80 30 512000 1900
68768281 vjudge2 E Jan. 14, 2020, 10:48 a.m. OK GNU C++14 TESTS 80 30 512000 1900
39681321 avwl017 E June 26, 2018, 4:45 p.m. OK GNU C++14 TESTS 80 30 614400 1900
39587387 davidberard E June 24, 2018, 2:56 a.m. OK GNU C++14 TESTS 80 30 716800 1900
39732680 kawazaki E June 28, 2018, 4:54 a.m. OK GNU C++14 TESTS 80 30 819200 1900
39544776 CrafterKolyan E June 23, 2018, 3:18 p.m. OK GNU C++17 TESTS 80 30 409600 1900
39528189 ShJ E June 22, 2018, 9:25 p.m. OK GNU C++17 TESTS 80 30 512000 1900
61117106 msporyshev E Sept. 23, 2019, 1:13 p.m. OK GNU C++17 TESTS 80 30 614400 1900
52242630 Varun_Shah E April 2, 2019, 5:03 p.m. OK GNU C++17 TESTS 80 30 614400 1900
39587215 lu925871076 E June 24, 2018, 2:46 a.m. OK GNU C++17 TESTS 80 30 716800 1900
49387584 vjudge3 E Feb. 3, 2019, 7:52 a.m. OK GNU C++17 TESTS 80 30 921600 1900
39514965 lisifu E June 22, 2018, 11:32 a.m. OK GNU C++17 TESTS 80 30 1024000 1900
39540033 divyanshshukla13 E June 23, 2018, 11:33 a.m. OK GNU C++17 TESTS 80 30 1331200 1900
39734274 Silly_Bee E June 28, 2018, 6:23 a.m. OK GNU C++17 TESTS 80 30 4198400 1900
66527207 A_root_A E Dec. 9, 2019, 5:41 a.m. OK GNU C++17 TESTS 80 31 307200 1900
39536663 Hemnath_D E June 23, 2018, 9 a.m. OK GNU C++17 Diagnostics TESTS 80 1559 2560000 1900
68979482 synapse E Jan. 17, 2020, 10:09 a.m. OK Go TESTS 80 46 0 1900
67207625 vjudge3 E Dec. 19, 2019, 12:59 p.m. OK Go TESTS 80 46 0 1900
67207062 WangJialei E Dec. 19, 2019, 12:48 p.m. OK Go TESTS 80 46 0 1900
42728956 Marii E Sept. 10, 2018, 10:04 a.m. OK Go TESTS 80 109 204800 1900
68997759 GiantTornado E Jan. 17, 2020, 6:07 p.m. OK Java 11 TESTS 80 202 0 1900
66997849 zhanyi_xiaolu E Dec. 16, 2019, 3:32 a.m. OK Java 11 TESTS 80 358 0 1900
68394047 manish_98 E Jan. 8, 2020, 10:07 a.m. OK Java 8 TESTS 80 124 0 1900
51462933 mikkk E March 18, 2019, 9:15 p.m. OK Java 8 TESTS 80 124 0 1900
69595021 luchy0120 E Jan. 27, 2020, 3:59 a.m. OK Java 8 TESTS 80 124 0 1900
39515924 yatin E June 22, 2018, 12:09 p.m. OK Java 8 TESTS 80 124 0 1900
39544489 Darshan_Darji E June 23, 2018, 3:04 p.m. OK Java 8 TESTS 80 139 0 1900
39743046 kessido E June 28, 2018, 12:40 p.m. OK Java 8 TESTS 80 140 0 1900
63015105 acceptedfreak E Oct. 20, 2019, 12:42 p.m. OK Java 8 TESTS 80 140 0 1900
60930636 LAKOUAM_IMAD E Sept. 20, 2019, 1:38 p.m. OK Java 8 TESTS 80 140 0 1900
39664611 DeadPigCreateDaNiuBright E June 26, 2018, 3:49 a.m. OK Java 8 TESTS 80 140 0 1900
39646504 kanak893 E June 25, 2018, 10:33 a.m. OK Java 8 TESTS 80 140 0 1900
40606194 Anastasiya_Andreevna E July 21, 2018, 11:33 a.m. OK Mono C# TESTS 80 140 7270400 1900
40606054 Anastasiya_Andreevna E July 21, 2018, 11:27 a.m. OK Mono C# TESTS 80 140 7270400 1900
41435356 scorpiowf E Aug. 10, 2018, 2:47 p.m. OK MS C++ TESTS 80 31 204800 1900
58061187 vjudge3 E July 31, 2019, 7:29 a.m. OK MS C++ TESTS 80 31 307200 1900
40954815 CrashMaster E July 30, 2018, 9:10 a.m. OK MS C++ TESTS 80 31 307200 1900
40698806 vjudge1 E July 24, 2018, 9:25 a.m. OK MS C++ TESTS 80 31 409600 1900
56718971 vjudge5 E July 8, 2019, 3:50 p.m. OK MS C++ TESTS 80 31 409600 1900
53186077 kz20182726kz E April 23, 2019, 10:25 a.m. OK MS C++ TESTS 80 31 409600 1900
42697442 1330786175 E Sept. 9, 2018, 8:15 a.m. OK MS C++ TESTS 80 31 512000 1900
42877888 vjudge1 E Sept. 15, 2018, 3:36 a.m. OK MS C++ TESTS 80 31 512000 1900
63967643 vjudge1 E Nov. 1, 2019, 7:51 a.m. OK MS C++ TESTS 80 31 614400 1900
42697453 vjudge2 E Sept. 9, 2018, 8:16 a.m. OK MS C++ TESTS 80 31 614400 1900
50673254 work_hard. E March 2, 2019, 8:06 a.m. OK MS C++ 2017 TESTS 80 31 512000 1900
56937154 CtrlAlt E July 12, 2019, 4:52 p.m. OK MS C++ 2017 TESTS 80 46 1638400 1900
62769994 AleksanderBalobanov E Oct. 17, 2019, 9:56 a.m. OK MS C++ 2017 TESTS 80 46 7168000 1900
50679979 work_hard. E March 2, 2019, 11:02 a.m. OK MS C++ 2017 TESTS 80 78 307200 1900
58430013 TianZuiXing E Aug. 7, 2019, 11:27 a.m. OK MS C++ 2017 TESTS 80 78 100556800 1900
50679525 work_hard. E March 2, 2019, 10:52 a.m. OK MS C++ 2017 TESTS 80 93 307200 1900
57461022 Still_Theory E July 21, 2019, 1:39 p.m. OK MS C++ 2017 TESTS 80 202 512000 1900
51909211 c1729 E March 27, 2019, 5:12 p.m. OK PyPy 2 TESTS 80 171 2457600 1900
51910276 c1729 E March 27, 2019, 5:47 p.m. OK PyPy 2 TESTS 80 171 2662400 1900
40899565 Onesh0t E July 29, 2018, 12:21 a.m. OK PyPy 2 TESTS 80 935 11059200 1900
51909560 c1729 E March 27, 2019, 5:22 p.m. OK PyPy 3 TESTS 80 171 2048000 1900
39679461 Ali_Pi E June 26, 2018, 3:21 p.m. OK Python 2 TESTS 80 124 3788800 1900
40030036 Teichmuller E July 6, 2018, 12:27 p.m. OK Python 2 TESTS 80 202 3788800 1900
39544368 orailly E June 23, 2018, 2:58 p.m. OK Python 3 TESTS 80 108 3481600 1900
39605917 pazabol E June 24, 2018, 2:49 p.m. OK Python 3 TESTS 80 124 3481600 1900
39653464 MaxHo E June 25, 2018, 3:19 p.m. OK Python 3 TESTS 80 124 3788800 1900
39541820 OYMiss E June 23, 2018, 12:49 p.m. OK Python 3 TESTS 80 124 4096000 1900
39541617 OYMiss E June 23, 2018, 12:40 p.m. OK Python 3 TESTS 80 124 4096000 1900
53705005 yfo E May 3, 2019, 12:46 p.m. OK Python 3 TESTS 80 139 4096000 1900
52311716 aleonov E April 4, 2019, 2:57 p.m. OK Python 3 TESTS 80 139 4096000 1900
62615106 deadguy E Oct. 15, 2019, 11:12 a.m. OK Python 3 TESTS 80 155 4300800 1900
39532694 ldt116 E June 23, 2018, 5:24 a.m. OK Python 3 TESTS 80 155 4608000 1900
57801290 radoslav11 E July 26, 2019, 1:23 p.m. OK Python 3 TESTS 80 155 5017600 1900
39758518 ditsing E June 29, 2018, 5 a.m. OK Rust TESTS 80 218 26316800 1900

remove filters

Back to search problems