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.
Problems
All Berland residents are waiting for an unprecedented tour of wizard in his Blue Helicopter over the cities of Berland! It is well-known that there are n cities in Berland, some pairs of which are connected by bidirectional roads. Each pair of cities is connected by no more than one road. It is not guaranteed that the road network is connected , i.e. it is possible that you can't reach some city from some other. The tour will contain several episodes. In each of the episodes: the wizard will disembark at some city x from the Helicopter; he will give a performance and show a movie for free at the city x ; he will drive to some neighboring city y using a road; he will give a performance and show a movie for free at the city y ; he will drive to some neighboring to y city z ; he will give a performance and show a movie for free at the city z ; he will embark the Helicopter and fly away from the city z . It is known that the wizard doesn't like to use roads, so he agrees to use each road at most once (regardless of direction). In other words, for road between a and b he only can drive once from a to b , or drive once from b to a , or do not use this road at all. The wizards wants to plan as many episodes as possible without violation the above rules. Help the wizard! Please note that the wizard can visit the same city multiple times, the restriction is on roads only. The first line contains two integers n , m ( 1 ≤ n ≤ 2·10 5 , 0 ≤ m ≤ 2·10 5 ) — the number of cities and the number of roads in Berland, respectively. The roads description follow, one in each line. Each description is a pair of two integers a i , b i ( 1 ≤ a i , b i ≤ n , a i ≠ b i ), where a i and b i are the ids of the cities connected by the i -th road. It is guaranteed that there are no two roads connecting the same pair of cities. Every road is bidirectional. The cities are numbered from 1 to n . It is possible that the road network in Berland is not connected. In the first line print w — |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
31776918 |
vjudge2 |
F |
Oct. 27, 2017, 1:56 a.m. |
OK |
GNU C++ |
TESTS |
63 |
93 |
19456000 |
|
2400 |
|
31776938 |
vjudge1 |
F |
Oct. 27, 2017, 1:57 a.m. |
OK |
GNU C++ |
TESTS |
63 |
109 |
19353600 |
|
2400 |
|
31157361 |
hyj542682306 |
F |
Oct. 9, 2017, 1:28 a.m. |
OK |
GNU C++ |
TESTS |
63 |
124 |
10342400 |
|
2400 |
|
41903781 |
Miracle_2001 |
F |
Aug. 20, 2018, 1:31 p.m. |
OK |
GNU C++ |
TESTS |
63 |
124 |
19968000 |
|
2400 |
|
31777639 |
vjudge4 |
F |
Oct. 27, 2017, 2:39 a.m. |
OK |
GNU C++ |
TESTS |
63 |
124 |
19968000 |
|
2400 |
|
31777611 |
vjudge2 |
F |
Oct. 27, 2017, 2:37 a.m. |
OK |
GNU C++ |
TESTS |
63 |
124 |
19968000 |
|
2400 |
|
31162385 |
zhou888 |
F |
Oct. 9, 2017, 8:29 a.m. |
OK |
GNU C++ |
TESTS |
63 |
124 |
23040000 |
|
2400 |
|
41901606 |
Miracle_2001 |
F |
Aug. 20, 2018, 12:26 p.m. |
OK |
GNU C++ |
TESTS |
63 |
139 |
19968000 |
|
2400 |
|
35089612 |
luogu_bot4 |
F |
Feb. 9, 2018, 12:35 p.m. |
OK |
GNU C++ |
TESTS |
63 |
140 |
12390400 |
|
2400 |
|
31777567 |
vjudge4 |
F |
Oct. 27, 2017, 2:34 a.m. |
OK |
GNU C++ |
TESTS |
63 |
140 |
19968000 |
|
2400 |
|
40979770 |
ReaLNero1 |
F |
July 30, 2018, 5:14 p.m. |
OK |
GNU C++11 |
TESTS |
63 |
78 |
30310400 |
|
2400 |
|
31205279 |
wjy666 |
F |
Oct. 11, 2017, 2:44 a.m. |
OK |
GNU C++11 |
TESTS |
63 |
78 |
30310400 |
|
2400 |
|
62610537 |
qq125ZZsb |
F |
Oct. 15, 2019, 9:33 a.m. |
OK |
GNU C++11 |
TESTS |
63 |
93 |
10547200 |
|
2400 |
|
59707444 |
Sakura_Kaka |
F |
Aug. 30, 2019, 1:15 p.m. |
OK |
GNU C++11 |
TESTS |
63 |
93 |
19251200 |
|
2400 |
|
59695022 |
zrz_orz |
F |
Aug. 30, 2019, 8:09 a.m. |
OK |
GNU C++11 |
TESTS |
63 |
108 |
9420800 |
|
2400 |
|
62606477 |
M_sea |
F |
Oct. 15, 2019, 7:57 a.m. |
OK |
GNU C++11 |
TESTS |
63 |
108 |
12800000 |
|
2400 |
|
62603150 |
hyjhyj |
F |
Oct. 15, 2019, 6:35 a.m. |
OK |
GNU C++11 |
TESTS |
63 |
108 |
20172800 |
|
2400 |
|
59776960 |
Morning_Glory |
F |
Aug. 31, 2019, 12:11 a.m. |
OK |
GNU C++11 |
TESTS |
63 |
108 |
35225600 |
|
2400 |
|
50622400 |
xielinhan |
F |
March 1, 2019, 3:03 a.m. |
OK |
GNU C++11 |
TESTS |
63 |
109 |
20070400 |
|
2400 |
|
43119170 |
lpa20020220 |
F |
Sept. 20, 2018, 2:55 p.m. |
OK |
GNU C++11 |
TESTS |
63 |
109 |
21196800 |
|
2400 |
|
54964076 |
bhargav_0085 |
F |
June 2, 2019, 5:30 a.m. |
OK |
GNU C++14 |
TESTS |
63 |
155 |
18022400 |
|
2400 |
|
30449254 |
Egor.Lifar |
F |
Sept. 17, 2017, 8:17 p.m. |
OK |
GNU C++14 |
TESTS |
63 |
171 |
27136000 |
|
2400 |
|
30452900 |
Als123 |
F |
Sept. 18, 2017, 1:18 a.m. |
OK |
GNU C++14 |
TESTS |
63 |
171 |
35737600 |
|
2400 |
|
59693415 |
luogu_bot3 |
F |
Aug. 30, 2019, 7:19 a.m. |
OK |
GNU C++14 |
TESTS |
63 |
202 |
12492800 |
|
2400 |
|
59440313 |
vjudge2 |
F |
Aug. 25, 2019, 10:54 a.m. |
OK |
GNU C++14 |
TESTS |
63 |
202 |
24883200 |
|
2400 |
|
49382526 |
m1sterzer0 |
F |
Feb. 3, 2019, 3:44 a.m. |
OK |
GNU C++14 |
TESTS |
63 |
217 |
25702400 |
|
2400 |
|
67605403 |
I_love_Kuroni |
F |
Dec. 25, 2019, 1:24 p.m. |
OK |
GNU C++14 |
TESTS |
63 |
218 |
25190400 |
|
2400 |
|
45492184 |
Minnakhmetov |
F |
Nov. 9, 2018, 7:50 p.m. |
OK |
GNU C++14 |
TESTS |
63 |
218 |
29798400 |
|
2400 |
|
30489569 |
sincerity |
F |
Sept. 19, 2017, 6:28 a.m. |
OK |
GNU C++14 |
TESTS |
63 |
233 |
21606400 |
|
2400 |
|
30450603 |
MrLolthe1st |
F |
Sept. 17, 2017, 9:22 p.m. |
OK |
GNU C++14 |
TESTS |
63 |
233 |
26316800 |
|
2400 |
|
59693392 |
Roal_L |
F |
Aug. 30, 2019, 7:19 a.m. |
OK |
GNU C++17 |
TESTS |
63 |
186 |
12492800 |
|
2400 |
|
69424274 |
kvutxdy |
F |
Jan. 23, 2020, 3:19 p.m. |
OK |
GNU C++17 |
TESTS |
63 |
248 |
28160000 |
|
2400 |
|
69064186 |
ImForbiddenToSayILoveYou |
F |
Jan. 18, 2020, 5:53 p.m. |
OK |
GNU C++17 |
TESTS |
63 |
248 |
28160000 |
|
2400 |
|
69543379 |
Kafka |
F |
Jan. 25, 2020, 11:32 p.m. |
OK |
GNU C++17 |
TESTS |
63 |
249 |
28979200 |
|
2400 |
|
68870510 |
Its_Gumball |
F |
Jan. 15, 2020, 3:01 p.m. |
OK |
GNU C++17 |
TESTS |
63 |
249 |
45875200 |
|
2400 |
|
57194283 |
mlyean |
F |
July 17, 2019, 11:41 a.m. |
OK |
GNU C++17 |
TESTS |
63 |
264 |
28979200 |
|
2400 |
|
63078060 |
Phortox |
F |
Oct. 21, 2019, 2:16 p.m. |
OK |
GNU C++17 |
TESTS |
63 |
265 |
25395200 |
|
2400 |
|
62458645 |
coffee_machine |
F |
Oct. 13, 2019, 7:26 a.m. |
OK |
GNU C++17 |
TESTS |
63 |
265 |
41779200 |
|
2400 |
|
68930613 |
Mahdi_Shokoufi |
F |
Jan. 16, 2020, 11:14 a.m. |
OK |
GNU C++17 |
TESTS |
63 |
280 |
24166400 |
|
2400 |
|
42358575 |
Ilya-bar |
F |
Sept. 2, 2018, 10:21 a.m. |
OK |
GNU C++17 |
TESTS |
63 |
280 |
26624000 |
|
2400 |
|
59506811 |
vjudge5 |
F |
Aug. 26, 2019, 6:29 a.m. |
OK |
MS C++ |
TESTS |
63 |
155 |
13209600 |
|
2400 |
|
30754973 |
Miris |
F |
Sept. 26, 2017, 3:21 p.m. |
OK |
MS C++ |
TESTS |
63 |
577 |
119398400 |
|
2400 |
|
30755908 |
Miris |
F |
Sept. 26, 2017, 3:54 p.m. |
OK |
MS C++ |
TESTS |
63 |
826 |
123187200 |
|
2400 |
|
64763662 |
DarisHS |
F |
Nov. 12, 2019, 7:52 p.m. |
OK |
MS C++ 2017 |
TESTS |
63 |
935 |
32563200 |
|
2400 |
remove filters
Back to search problems