Codeforces Round 346 (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
659 Codeforces Round 346 (Div. 2) FINISHED False 9000 278171723 March 30, 2016, 4:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7539 ) E New Reform PROGRAMMING data structures dfs and similar ds graphs greedy 1600

B'Berland has n cities connected by m bidirectional roads. No road connects a city to itself, and each pair of cities is connected by no more than one road. It is not guaranteed that you can get from any city to any other one, using only the existing roads. The President of Berland decided to make changes to the road system and instructed the Ministry of Transport to make this reform. Now, each road should be unidirectional (only lead from one city to another). In order not to cause great resentment among residents, the reform needs to be conducted so that there can be as few separate cities as possible. A city is considered separate, if no road leads into it, while it is allowed to have roads leading from this city. Help the Ministry of Transport to find the minimum possible number of separate cities after the reform. The first line of the input contains two positive integers, n and m -- the number of the cities and the number of roads in Berland (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000). Next m lines contain the descriptions of the roads: the i-th road is determined by two distinct integers xi, xe2 x80 x89yi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi, xe2 x80 x89yi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xi xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89yi), where xi and yi are the numbers of the cities connected by the i-th road. It is guaranteed that there is no more than one road between each pair of cities, but it is not guaranteed that from any city you can get to any other one, using only roads. Print a single integer -- the minimum number of separated cities after the reform. In the first sample the following road orientation is allowed: , , . The second sample: , , , , . The third sample: , , , , .'...

Tutorials

Editorial for Codeforces Round #346 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
19961268 Gray_58 E Aug. 19, 2016, 9:36 a.m. OK FPC TESTS 41 31 3584000 1600
29837060 KagamiharaNadeshiko E Aug. 28, 2017, 1:42 a.m. OK FPC TESTS 41 46 3379200 1600
17511452 dohonghuan E April 25, 2016, 3:32 p.m. OK FPC TESTS 41 46 4096000 1600
20170774 luckystars E Aug. 26, 2016, 8:10 a.m. OK FPC TESTS 41 46 4096000 1600
18146815 myx12345 E May 29, 2016, 12:32 p.m. OK FPC TESTS 41 46 5529600 1600
19727026 Hokplex E Aug. 8, 2016, 11:40 a.m. OK FPC TESTS 41 46 5632000 1600
42272964 chaorenhaha E Aug. 30, 2018, 9:31 a.m. OK FPC TESTS 41 46 13414400 1600
18063475 vjudge2 E May 24, 2016, 7:43 p.m. OK FPC TESTS 41 46 47206400 1600
18063223 congthanh123 E May 24, 2016, 7:12 p.m. OK FPC TESTS 41 46 47206400 1600
18063031 congthanh123 E May 24, 2016, 6:52 p.m. OK FPC TESTS 41 46 47206400 1600
40054569 vjudge5 E July 7, 2018, 7:53 a.m. OK GNU C TESTS 41 46 819200 1600
40054118 vjudge3 E July 7, 2018, 7:34 a.m. OK GNU C TESTS 41 46 819200 1600
40053104 vjudge4 E July 7, 2018, 6:43 a.m. OK GNU C TESTS 41 46 819200 1600
40025830 vjudge4 E July 6, 2018, 9:37 a.m. OK GNU C TESTS 41 46 1126400 1600
40048634 vjudge5 E July 7, 2018, 2:14 a.m. OK GNU C TESTS 41 46 1638400 1600
40022157 vjudge4 E July 6, 2018, 7:24 a.m. OK GNU C TESTS 41 46 1945600 1600
28182698 vjudge1 E July 1, 2017, 2:35 a.m. OK GNU C TESTS 41 46 2662400 1600
22630874 flying_turtle E Nov. 30, 2016, 7:58 p.m. OK GNU C TESTS 41 46 5836800 1600
40171303 vjudge1 E July 10, 2018, 12:36 p.m. OK GNU C TESTS 41 61 819200 1600
40053062 vjudge5 E July 7, 2018, 6:41 a.m. OK GNU C TESTS 41 61 7987200 1600
17315172 WindzLord E April 14, 2016, 1:48 p.m. OK GNU C++ TESTS 41 15 0 1600
35887921 ______M______ E March 3, 2018, 2:13 p.m. OK GNU C++ TESTS 41 15 2150400 1600
17517112 The_Hope_ E April 26, 2016, 4:41 a.m. OK GNU C++ TESTS 41 15 2252800 1600
36132634 wzlwzl E March 9, 2018, 11:33 p.m. OK GNU C++ TESTS 41 15 2560000 1600
36132625 wzlwzl E March 9, 2018, 11:32 p.m. OK GNU C++ TESTS 41 15 2560000 1600
18911319 AkaneSasu E July 6, 2016, 4:16 a.m. OK GNU C++ TESTS 41 15 2969600 1600
40249253 luogu_bot1 E July 13, 2018, 4:43 a.m. OK GNU C++ TESTS 41 31 614400 1600
41327653 luogu_bot5 E Aug. 8, 2018, 6:43 a.m. OK GNU C++ TESTS 41 31 819200 1600
20458899 whczss E Sept. 8, 2016, 1:07 p.m. OK GNU C++ TESTS 41 31 1024000 1600
40160755 zheng_lw E July 10, 2018, 7 a.m. OK GNU C++ TESTS 41 31 1126400 1600
56858557 rainboy E July 11, 2019, 8:06 p.m. OK GNU C11 TESTS 41 46 2252800 1600
19906946 UoA_ZQC E Aug. 16, 2016, 12:24 p.m. OK GNU C++11 TESTS 41 15 2560000 1600
20490409 Aby_Lightman1205 E Sept. 10, 2016, 5:26 a.m. OK GNU C++11 TESTS 41 15 4198400 1600
57815546 py_ultron E July 26, 2019, 7:28 p.m. OK GNU C++11 TESTS 41 31 0 1600
47499970 jaaguptamme E Dec. 25, 2018, 5:16 p.m. OK GNU C++11 TESTS 41 31 0 1600
57881271 lopare E July 28, 2019, 7:53 a.m. OK GNU C++11 TESTS 41 31 0 1600
59080827 luogu_bot4 E Aug. 19, 2019, 9:02 a.m. OK GNU C++11 TESTS 41 31 307200 1600
56810261 Alike E July 10, 2019, 3:44 p.m. OK GNU C++11 TESTS 41 31 307200 1600
40109578 Raj2020 E July 9, 2018, 10:51 a.m. OK GNU C++11 TESTS 41 31 307200 1600
59080876 luogu_bot1 E Aug. 19, 2019, 9:03 a.m. OK GNU C++11 TESTS 41 31 307200 1600
17289909 LeeHolmes E April 12, 2016, 12:54 p.m. OK GNU C++11 TESTS 41 31 512000 1600
47500097 CNH_OneDay E Dec. 25, 2018, 5:20 p.m. OK GNU C++14 TESTS 41 31 0 1600
22098270 after E Nov. 7, 2016, 4:30 p.m. OK GNU C++14 TESTS 41 46 819200 1600
27117132 vjudge1 E May 15, 2017, 7:32 a.m. OK GNU C++14 TESTS 41 46 1638400 1600
26904293 Gucci2007 E May 6, 2017, 3:09 p.m. OK GNU C++14 TESTS 41 46 1638400 1600
27118577 square1001 E May 15, 2017, 9:29 a.m. OK GNU C++14 TESTS 41 46 1638400 1600
32775020 NiroBC E Nov. 29, 2017, 8:21 a.m. OK GNU C++14 TESTS 41 46 2764800 1600
30567691 gaurav15 E Sept. 21, 2017, 5:44 a.m. OK GNU C++14 TESTS 41 46 2867200 1600
23534923 ngfam E Jan. 4, 2017, 12:09 p.m. OK GNU C++14 TESTS 41 46 2867200 1600
31495725 nhtrnm E Oct. 19, 2017, 1:19 a.m. OK GNU C++14 TESTS 41 46 2867200 1600
28276125 vjudge2 E July 4, 2017, 9:01 a.m. OK GNU C++14 TESTS 41 46 2969600 1600
56875386 vjudge2 E July 12, 2019, 8:05 a.m. OK GNU C++17 TESTS 41 46 819200 1600
47189524 17310320232 E Dec. 18, 2018, 11:29 a.m. OK GNU C++17 TESTS 41 46 1024000 1600
54342460 llt123456 E May 18, 2019, 10:58 a.m. OK GNU C++17 TESTS 41 46 1228800 1600
46644962 jiachou E Dec. 5, 2018, 11:37 a.m. OK GNU C++17 TESTS 41 46 1536000 1600
54334609 vjudge2 E May 18, 2019, 7:31 a.m. OK GNU C++17 TESTS 41 46 3174400 1600
54334651 BambooCertain E May 18, 2019, 7:32 a.m. OK GNU C++17 TESTS 41 46 3174400 1600
54332846 hznu_kk E May 18, 2019, 6:46 a.m. OK GNU C++17 TESTS 41 61 819200 1600
69558920 vjudge1 E Jan. 26, 2020, 9:52 a.m. OK GNU C++17 TESTS 41 61 819200 1600
58893970 hxw123 E Aug. 16, 2019, 6:49 a.m. OK GNU C++17 TESTS 41 61 819200 1600
40722340 vjudge5 E July 25, 2018, 2:10 a.m. OK GNU C++17 TESTS 41 61 819200 1600
19949294 pavel.rosputko E Aug. 18, 2016, 4:07 p.m. OK Haskell TESTS 41 249 74649600 1600
67649631 CodAR E Dec. 26, 2019, 11:36 a.m. OK Java 11 TESTS 41 638 18124800 1600
17501144 LocknKey E April 25, 2016, 1:36 a.m. OK Java 7 TESTS 41 155 39321600 1600
18233538 frktry E June 3, 2016, 3:35 p.m. OK Java 7 TESTS 41 295 56217600 1600
17382616 nguyenmanhphuc E April 19, 2016, 2:03 a.m. OK Java 7 TESTS 41 311 57036800 1600
17282801 Genericcoder E April 11, 2016, 7:30 p.m. OK Java 7 TESTS 41 327 15872000 1600
17282903 Genericcoder E April 11, 2016, 7:40 p.m. OK Java 7 TESTS 41 358 15872000 1600
17514876 mIchanic E April 25, 2016, 9:22 p.m. OK Java 7 TESTS 41 389 56115200 1600
17321345 Chadi_Helwe E April 15, 2016, 1:22 a.m. OK Java 7 TESTS 41 794 18432000 1600
59866239 Shady51 E Sept. 1, 2019, 5:18 p.m. OK Java 8 TESTS 41 124 0 1600
59866434 Shady51 E Sept. 1, 2019, 5:22 p.m. OK Java 8 TESTS 41 139 0 1600
45572006 ShowStopper728 E Nov. 11, 2018, 6:37 p.m. OK Java 8 TESTS 41 140 0 1600
67427268 mayankarora21 E Dec. 22, 2019, 1:54 p.m. OK Java 8 TESTS 41 155 0 1600
48652825 SpargelTarzan E Jan. 20, 2019, 11:45 p.m. OK Java 8 TESTS 41 155 0 1600
28386539 demonKing E July 9, 2017, 11:32 a.m. OK Java 8 TESTS 41 155 20582400 1600
19733693 kocko E Aug. 8, 2016, 5:30 p.m. OK Java 8 TESTS 41 156 20480000 1600
20371669 Corvus E Sept. 3, 2016, 10:29 p.m. OK Java 8 TESTS 41 171 0 1600
48275063 RasMalai E Jan. 12, 2019, 5:13 a.m. OK Java 8 TESTS 41 171 6348800 1600
28539661 homoeconomicus E July 14, 2017, 6:30 a.m. OK Java 8 TESTS 41 171 20582400 1600
32182559 equi E Nov. 9, 2017, 10:31 p.m. OK Kotlin TESTS 41 686 14336000 1600
31869606 equi E Oct. 29, 2017, 2:35 p.m. OK Kotlin TESTS 41 701 16384000 1600
24270735 pomjuice E Jan. 30, 2017, 3:24 p.m. OK MS C# TESTS 41 311 36659200 1600
17274102 AcInfinity E April 11, 2016, 6:19 a.m. OK MS C++ TESTS 41 31 2048000 1600
18941739 vjudge3 E July 7, 2016, 3:04 a.m. OK MS C++ TESTS 41 46 512000 1600
18921615 vjudge1 E July 6, 2016, 4:23 p.m. OK MS C++ TESTS 41 46 819200 1600
18913308 vjudge5 E July 6, 2016, 7:02 a.m. OK MS C++ TESTS 41 46 1228800 1600
18940007 vjudge3 E July 7, 2016, 12:38 a.m. OK MS C++ TESTS 41 46 2457600 1600
18919545 vjudge4 E July 6, 2016, 1:30 p.m. OK MS C++ TESTS 41 46 2457600 1600
17560277 vjudge3 E April 29, 2016, 2:43 a.m. OK MS C++ TESTS 41 46 2662400 1600
18915025 vjudge4 E July 6, 2016, 8:43 a.m. OK MS C++ TESTS 41 46 2969600 1600
53046227 vjudge2 E April 20, 2019, 12:18 p.m. OK MS C++ TESTS 41 46 3072000 1600
28203665 vjudge4 E July 2, 2017, 5:28 a.m. OK MS C++ TESTS 41 46 3276800 1600
57582034 vjudge4 E July 23, 2019, 9:11 a.m. OK MS C++ 2017 TESTS 41 93 3788800 1600
48411041 syzymon E Jan. 15, 2019, 7:43 a.m. OK Ocaml TESTS 41 46 1638400 1600
40611650 YESMAths E July 21, 2018, 2:50 p.m. OK PyPy 2 TESTS 41 405 16588800 1600
23385034 ragingbull E Dec. 28, 2016, 6:59 p.m. OK PyPy 2 TESTS 41 592 45977600 1600
54810615 pajenegod E May 29, 2019, 4:37 p.m. OK PyPy 3 TESTS 41 233 12185600 1600
54810380 pajenegod E May 29, 2019, 4:30 p.m. OK PyPy 3 TESTS 41 311 13619200 1600
54813069 pajenegod E May 29, 2019, 6:02 p.m. OK PyPy 3 TESTS 41 561 13516800 1600
18338426 krystallize E June 9, 2016, 9:08 a.m. OK Python 2 TESTS 41 452 16588800 1600
31105944 dthung1602 E Oct. 7, 2017, 8:28 a.m. OK Python 2 TESTS 41 467 2560000 1600
27605950 mithi100 E June 6, 2017, 5:51 a.m. OK Python 2 TESTS 41 499 11776000 1600
17311045 masonsbro E April 14, 2016, 7:19 a.m. OK Python 2 TESTS 41 514 12595200 1600
18226483 cocofsu E June 3, 2016, 5:58 a.m. OK Python 2 TESTS 41 514 22323200 1600
17923743 artyom.fedosov E May 15, 2016, 6:35 p.m. OK Python 2 TESTS 41 530 31641600 1600
41569949 Onesh0t E Aug. 13, 2018, 8:30 p.m. OK Python 2 TESTS 41 920 31129600 1600
54811667 pajenegod E May 29, 2019, 5:14 p.m. OK Python 3 TESTS 41 405 11264000 1600
54811784 pajenegod E May 29, 2019, 5:18 p.m. OK Python 3 TESTS 41 420 11264000 1600
69799972 amit_dwivedi E Jan. 29, 2020, 9:52 p.m. OK Python 3 TESTS 41 436 12492800 1600
54810363 pajenegod E May 29, 2019, 4:29 p.m. OK Python 3 TESTS 41 436 14438400 1600
69836400 Mohammed_Almasry E Jan. 30, 2020, 11:56 a.m. OK Python 3 TESTS 41 483 12800000 1600
69829494 Mohammed_Almasry E Jan. 30, 2020, 10:03 a.m. OK Python 3 TESTS 41 498 11980800 1600
69828051 Mohammed_Almasry E Jan. 30, 2020, 9:41 a.m. OK Python 3 TESTS 41 498 11980800 1600
21130964 orailly E Oct. 3, 2016, 7:57 a.m. OK Python 3 TESTS 41 530 14131200 1600
21131435 orailly E Oct. 3, 2016, 8:25 a.m. OK Python 3 TESTS 41 545 15667200 1600
21131316 orailly E Oct. 3, 2016, 8:19 a.m. OK Python 3 TESTS 41 561 15564800 1600

remove filters

Back to search problems