Codeforces Round 407 (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
788 Codeforces Round 407 (Div. 1) FINISHED False 7200 246635687 March 29, 2017, 4:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2626 ) B Weird journey PROGRAMMING combinatorics constructive algorithms dfs and similar ds graphs 2200

B'Little boy Igor wants to become a traveller. At first, he decided to visit all the cities of his motherland -- Uzhlyandia. It is widely known that Uzhlyandia has n cities connected with m bidirectional roads. Also, there are no two roads in the country that connect the same pair of cities, but roads starting and ending in the same city can exist. Igor wants to plan his journey beforehand. Boy thinks a path is good if the path goes over m xe2 x80 x89- xe2 x80 x892 roads twice, and over the other 2 exactly once. The good path can start and finish in any city of Uzhlyandia. Now he wants to know how many different good paths are in Uzhlyandia. Two paths are considered different if the sets of roads the paths goes over exactly once differ. Help Igor -- calculate the number of good paths. The first line contains two integers n, m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- the number of cities and roads in Uzhlyandia, respectively. Each of the next m lines contains two integers u and v (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89u, xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) that mean that there is road between cities u and v. It is guaranteed that no road will be given in the input twice. That also means that for every city there is no more than one road that connects the city to itself. Print out the only integer -- the number of good paths in Uzhlyandia. In first sample test case the good paths are: There are good paths that are same with displayed above, because the sets of roads they pass over once are same: Thus, the answer is 6. In the second test case, Igor simply can not walk by all the roads. In the third case, Igor walks once over every road. '...

Tutorials

Codeforces Round #407(Div.1 + Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
25908404 Gassa B March 29, 2017, 4:41 p.m. OK D TESTS 66 795 32870400 2200
26111137 bzh B April 4, 2017, 1:52 a.m. OK FPC TESTS 66 732 49049600 2200
26114168 jkxjkx1031 B April 4, 2017, 6:08 a.m. OK GNU C TESTS 66 421 43212800 2200
25944753 flower B March 30, 2017, 8:01 a.m. OK GNU C++ TESTS 66 202 44441600 2200
26186873 sunyuqi148 B April 7, 2017, 8:08 a.m. OK GNU C++ TESTS 66 202 110489600 2200
26779895 cbhcbh B May 1, 2017, 6:15 a.m. OK GNU C++ TESTS 66 217 55398400 2200
40981970 ReaLNero1 B July 30, 2018, 6:13 p.m. OK GNU C++ TESTS 66 233 20684800 2200
25939301 fgvfgfg1 B March 30, 2017, 3:11 a.m. OK GNU C++ TESTS 66 249 26828800 2200
26817421 zhan8855 B May 3, 2017, 11:18 a.m. OK GNU C++ TESTS 66 265 107724800 2200
28981262 _rqy B July 30, 2017, 2:52 a.m. OK GNU C++ TESTS 66 296 40243200 2200
27337444 AkaneSasu B May 25, 2017, 1:17 p.m. OK GNU C++ TESTS 66 312 41267200 2200
26090162 czllgzmzl B April 3, 2017, 4:04 a.m. OK GNU C++ TESTS 66 327 14131200 2200
25938690 dwjshift B March 30, 2017, 2:26 a.m. OK GNU C++ TESTS 66 327 40140800 2200
59542768 rainboy B Aug. 26, 2019, 7:45 p.m. OK GNU C11 TESTS 66 404 9011200 2200
47334134 Minamoto B Dec. 21, 2018, 2:19 p.m. OK GNU C++11 TESTS 66 171 51507200 2200
25946450 ditoly B March 30, 2017, 9:08 a.m. OK GNU C++11 TESTS 66 186 110387200 2200
50081411 vjudge2 B Feb. 18, 2019, 4:23 a.m. OK GNU C++11 TESTS 66 202 27750400 2200
59924931 ByHa B Sept. 3, 2019, 3:07 a.m. OK GNU C++11 TESTS 66 202 41267200 2200
25965643 rxdoi B March 31, 2017, 12:16 a.m. OK GNU C++11 TESTS 66 202 43417600 2200
26105473 fanache99 B April 3, 2017, 5:25 p.m. OK GNU C++11 TESTS 66 218 15052800 2200
25923613 blutrex B March 29, 2017, 5:43 p.m. OK GNU C++11 TESTS 66 218 25600000 2200
25917124 eddy1021 B March 29, 2017, 5:14 p.m. OK GNU C++11 TESTS 66 249 27955200 2200
26505933 FizzyDavid B April 20, 2017, 12:48 a.m. OK GNU C++11 TESTS 66 249 40448000 2200
25921091 flatline B March 29, 2017, 5:31 p.m. OK GNU C++11 TESTS 66 264 19148800 2200
25904161 OnionPringles B March 29, 2017, 4:25 p.m. OK GNU C++14 TESTS 66 405 13926400 2200
25907017 natsugiri B March 29, 2017, 4:36 p.m. OK GNU C++14 TESTS 66 421 21913600 2200
25915789 alex9801 B March 29, 2017, 5:09 p.m. OK GNU C++14 TESTS 66 436 18944000 2200
25904277 sugim48 B March 29, 2017, 4:26 p.m. OK GNU C++14 TESTS 66 467 17920000 2200
25908358 .o. B March 29, 2017, 4:41 p.m. OK GNU C++14 TESTS 66 467 44236800 2200
53979160 zstu_MingSD B May 11, 2019, 6:11 a.m. OK GNU C++14 TESTS 66 467 45363200 2200
25919743 GeKa B March 29, 2017, 5:25 p.m. OK GNU C++14 TESTS 66 499 49971200 2200
25920994 molamola. B March 29, 2017, 5:31 p.m. OK GNU C++14 TESTS 66 514 43212800 2200
25916695 OMG_wc B March 29, 2017, 5:12 p.m. OK GNU C++14 TESTS 66 514 47206400 2200
25933063 lyoz B March 29, 2017, 8:07 p.m. OK GNU C++14 TESTS 66 529 18329600 2200
59216354 menxin B Aug. 21, 2019, 10:26 a.m. OK GNU C++17 TESTS 66 530 35328000 2200
55944996 vjudge4 B June 22, 2019, 7:05 p.m. OK GNU C++17 TESTS 66 607 35328000 2200
38462730 here B May 20, 2018, 2:40 p.m. OK GNU C++17 TESTS 66 623 31129600 2200
61594307 sdibt2 B Oct. 1, 2019, 8:12 a.m. OK GNU C++17 TESTS 66 639 53350400 2200
50079306 qinyuyang B Feb. 18, 2019, 2:16 a.m. OK GNU C++17 TESTS 66 639 110387200 2200
59898118 TelmaZzzz B Sept. 2, 2019, 12:48 p.m. OK GNU C++17 TESTS 66 670 46489600 2200
46373800 fsshakkhor B Nov. 29, 2018, 5:22 p.m. OK GNU C++17 TESTS 66 764 41369600 2200
50080193 lx_zjk B Feb. 18, 2019, 3:11 a.m. OK GNU C++17 TESTS 66 779 25702400 2200
50080216 luogu_bot3 B Feb. 18, 2019, 3:12 a.m. OK GNU C++17 TESTS 66 780 25702400 2200
51996061 KevinWan B March 30, 2019, 2:08 a.m. OK GNU C++17 TESTS 66 810 44032000 2200
59542856 Dukkha B Aug. 26, 2019, 7:48 p.m. OK Java 8 TESTS 66 264 4300800 2200
26881187 hama-du B May 5, 2017, 1:08 p.m. OK Java 8 TESTS 66 389 14336000 2200
26086902 beroul B April 2, 2017, 9:21 p.m. OK Java 8 TESTS 66 405 44953600 2200
40935139 wflms20110333 m1sch3f B July 30, 2018, 4:21 a.m. OK Java 8 TESTS 66 592 16179200 2200
25922400 fnch B March 29, 2017, 5:37 p.m. OK Java 8 TESTS 66 608 37068800 2200
25909418 uwi B March 29, 2017, 4:45 p.m. OK Java 8 TESTS 66 624 61337600 2200
25903917 mmaxio B March 29, 2017, 4:24 p.m. OK Java 8 TESTS 66 639 28876800 2200
26325047 Kammola B April 12, 2017, 7:50 p.m. OK Java 8 TESTS 66 639 41164800 2200
25923108 DarLam B March 29, 2017, 5:41 p.m. OK Java 8 TESTS 66 639 53452800 2200
40447524 Nesrin B July 16, 2018, 5:03 p.m. OK Java 8 TESTS 66 686 6246400 2200
26233801 mbrc B April 9, 2017, 9:30 a.m. OK Kotlin TESTS 66 1434 118272000 2200
26233570 mbrc B April 9, 2017, 9:15 a.m. OK Kotlin TESTS 66 1481 107417600 2200
26233535 mbrc B April 9, 2017, 9:13 a.m. OK Kotlin TESTS 66 1497 107315200 2200
26233462 mbrc B April 9, 2017, 9:08 a.m. OK Kotlin TESTS 66 1777 108851200 2200
26233402 mbrc B April 9, 2017, 9:04 a.m. OK Kotlin TESTS 66 1778 103731200 2200
26044648 camypaper B April 1, 2017, 6:25 a.m. OK MS C# TESTS 66 374 37888000 2200
25924062 AnatolyTolstobrov B March 29, 2017, 5:45 p.m. OK MS C# TESTS 66 1388 93286400 2200
25939266 moyin B March 30, 2017, 3:09 a.m. OK MS C++ TESTS 66 810 54476800 2200
25938572 xcdxcdxcd B March 30, 2017, 2:16 a.m. OK MS C++ TESTS 66 858 41676800 2200
28206626 ze177482 B July 2, 2017, 8:41 a.m. OK MS C++ TESTS 66 888 48640000 2200
25928191 Auster B March 29, 2017, 6:02 p.m. OK MS C++ TESTS 66 889 49254400 2200
25929697 amethyst3 B March 29, 2017, 7 p.m. OK MS C++ TESTS 66 889 71065600 2200
25956372 Yurik B March 30, 2017, 2:58 p.m. OK MS C++ TESTS 66 904 54067200 2200
27530504 rndmztn B June 2, 2017, 7:15 p.m. OK MS C++ TESTS 66 920 64204800 2200
25947636 RCG B March 30, 2017, 9:53 a.m. OK MS C++ TESTS 66 1091 61337600 2200
26537409 Ancient_mage B April 21, 2017, 12:36 p.m. OK MS C++ TESTS 66 1325 83353600 2200
25959360 Andrrruha B March 30, 2017, 5:05 p.m. OK MS C++ TESTS 66 1871 54374400 2200
65935461 pajenegod B Nov. 29, 2019, 1:33 a.m. OK PyPy 2 TESTS 66 1699 133632000 2200
25914193 kobae964 B March 29, 2017, 5:02 p.m. OK Rust TESTS 66 1403 148889600 2200

remove filters

Back to search problems