Codeforces Round 167 (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
272 Codeforces Round 167 (Div. 2) FINISHED False 7200 376928997 Feb. 13, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1234 ) E Dima and Horses PROGRAMMING combinatorics constructive algorithms graphs 2300

B'Dima came to the horse land. There are n horses living in the land. Each horse in the horse land has several enemies (enmity is a symmetric relationship). The horse land isn 't very hostile, so the number of enemies of each horse is at most 3. Right now the horse land is going through an election campaign. So the horses trusted Dima to split them into two parts. At that the horses want the following condition to hold: a horse shouldn 't have more than one enemy in its party. Help Dima split the horses into parties. Note that one of the parties can turn out to be empty. The first line contains two integers n, xe2 x80 x89m -- the number of horses in the horse land and the number of enemy pairs. Next m lines define the enemy pairs. The i-th line contains integers ai, xe2 x80 x89bi (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), which mean that horse ai is the enemy of horse bi. Consider the horses indexed in some way from 1 to n. It is guaranteed that each horse has at most three enemies. No pair of enemies occurs more than once in the input. Print a line, consisting of n characters: the i-th character of the line must equal "0", if the horse number i needs to go to the first party, otherwise this character should equal "1". If there isn 't a way to divide the horses as required, print -1.'...

Tutorials

Codeforces Round #167 tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3144498 AHTuTTuTyX E Feb. 18, 2013, 6:12 p.m. OK Delphi TESTS 50 171 7270400 2300
3171360 tennisru E Feb. 22, 2013, 8:46 a.m. OK FPC TESTS 50 218 7168000 2300
3132088 t_t_0000 E Feb. 15, 2013, 11:06 a.m. OK FPC TESTS 50 218 72192000 2300
3137748 Omelianenko E Feb. 16, 2013, 6:17 p.m. OK FPC TESTS 50 234 123801600 2300
3119294 mlz000 E Feb. 13, 2013, 4:38 p.m. OK FPC TESTS 50 265 72192000 2300
3117148 Anastasiya.Zhyr E Feb. 13, 2013, 4:15 p.m. OK FPC TESTS 50 281 13721600 2300
3129112 mbv E Feb. 14, 2013, 2:38 p.m. OK FPC TESTS 50 296 13721600 2300
3123416 Turtwig E Feb. 13, 2013, 5:27 p.m. OK FPC TESTS 50 296 13721600 2300
3169754 ig_dug E Feb. 22, 2013, 2:07 a.m. OK FPC TESTS 50 296 14028800 2300
3266781 kinpa200296 E March 8, 2013, 4:51 p.m. OK FPC TESTS 50 328 24268800 2300
3147192 Dima_qwer E Feb. 19, 2013, 1:43 p.m. OK FPC TESTS 50 421 9728000 2300
21003927 rainboy E Sept. 29, 2016, 10:24 p.m. OK GNU C TESTS 50 280 8704000 2300
3129142 gxnncrx1993 E Feb. 14, 2013, 2:45 p.m. OK GNU C TESTS 50 296 53452800 2300
21001196 rainboy E Sept. 29, 2016, 7:01 p.m. OK GNU C TESTS 50 466 13721600 2300
3132528 bakabakashyoshyo E Feb. 15, 2013, 12:47 p.m. OK GNU C++ TESTS 50 156 9625600 2300
3129138 coolwyj E Feb. 14, 2013, 2:44 p.m. OK GNU C++ TESTS 50 171 8396800 2300
3129788 lpy E Feb. 14, 2013, 5:06 p.m. OK GNU C++ TESTS 50 187 7475200 2300
40990203 ReaLNero1 E July 30, 2018, 11:42 p.m. OK GNU C++ TESTS 50 218 11161600 2300
3126939 yunan E Feb. 14, 2013, 7:34 a.m. OK GNU C++ TESTS 50 234 46080000 2300
5819696 vjudge3 E Jan. 27, 2014, 1:46 p.m. OK GNU C++ TESTS 50 248 7987200 2300
11135061 PoPoQQQ E May 18, 2015, 12:57 p.m. OK GNU C++ TESTS 50 248 9728000 2300
3725685 vjudge1 E May 16, 2013, 4:25 a.m. OK GNU C++ TESTS 50 250 6041600 2300
3137909 lexo E Feb. 16, 2013, 7:07 p.m. OK GNU C++ TESTS 50 250 8396800 2300
3750301 lhm E May 20, 2013, 1:59 p.m. OK GNU C++ TESTS 50 250 18636800 2300
3133336 gonewithsin E Feb. 15, 2013, 3:52 p.m. OK GNU C++0x TESTS 50 296 5120000 2300
9397710 hkglly E Jan. 10, 2015, 1:48 p.m. OK GNU C++0x TESTS 50 312 9318400 2300
3146241 BryantMark E Feb. 19, 2013, 9 a.m. OK GNU C++0x TESTS 50 359 18124800 2300
3128513 hex539 E Feb. 14, 2013, 12:52 p.m. OK GNU C++0x TESTS 50 375 16896000 2300
8370253 shankar556288 E Oct. 23, 2014, 5:38 p.m. OK GNU C++0x TESTS 50 404 9728000 2300
8753369 Plumrain E Nov. 19, 2014, 8:16 a.m. OK GNU C++0x TESTS 50 436 10752000 2300
10177014 vjudge5 E March 6, 2015, 1:05 p.m. OK GNU C++0x TESTS 50 466 9523200 2300
10185921 AhmadrezaM E March 7, 2015, 5:18 a.m. OK GNU C++0x TESTS 50 498 13107200 2300
3124341 lonelyboy E Feb. 13, 2013, 6:54 p.m. OK GNU C++0x TESTS 50 546 10752000 2300
3121598 lonelyxiang E Feb. 13, 2013, 5:07 p.m. OK GNU C++0x TESTS 50 546 10752000 2300
57821474 py_ultron E July 26, 2019, 11:40 p.m. OK GNU C++11 TESTS 50 280 13004800 2300
57897455 lopare E July 28, 2019, 2:12 p.m. OK GNU C++11 TESTS 50 312 13004800 2300
19923197 vjudge3 E Aug. 17, 2016, 8:56 a.m. OK GNU C++11 TESTS 50 312 13619200 2300
67421851 gheorghe_armand E Dec. 22, 2019, 11:59 a.m. OK GNU C++11 TESTS 50 342 8499200 2300
17129922 freebsdx E April 2, 2016, 12:26 p.m. OK GNU C++11 TESTS 50 342 15052800 2300
19923246 forlove E Aug. 17, 2016, 8:58 a.m. OK GNU C++11 TESTS 50 372 13619200 2300
12811881 abdou_93 E Sept. 2, 2015, 7:34 a.m. OK GNU C++11 TESTS 50 404 10444800 2300
49441944 The.Last.Wizard E Feb. 3, 2019, 9:47 p.m. OK GNU C++11 TESTS 50 404 12595200 2300
59233804 Evilandrew E Aug. 21, 2019, 4:35 p.m. OK GNU C++11 TESTS 50 436 10444800 2300
54948348 Juzek E June 1, 2019, 5:31 p.m. OK GNU C++11 TESTS 50 436 21299200 2300
59693073 vjudge1 E Aug. 30, 2019, 7:10 a.m. OK GNU C++14 TESTS 50 342 8704000 2300
59693386 smallcaiji E Aug. 30, 2019, 7:19 a.m. OK GNU C++14 TESTS 50 372 9728000 2300
59692933 smallcaiji E Aug. 30, 2019, 7:07 a.m. OK GNU C++14 TESTS 50 404 8704000 2300
27116044 dhsrhkdgus E May 15, 2017, 5:45 a.m. OK GNU C++14 TESTS 50 436 14233600 2300
50564081 Beast_Within E Feb. 27, 2019, 12:23 p.m. OK GNU C++14 TESTS 50 466 10649600 2300
38127231 UESTC_Sphinx E May 12, 2018, 4:15 a.m. OK GNU C++14 TESTS 50 466 11878400 2300
38127211 UESTC_Sphinx E May 12, 2018, 4:14 a.m. OK GNU C++14 TESTS 50 468 12083200 2300
59660788 vjudge5 E Aug. 29, 2019, 12:24 p.m. OK GNU C++14 TESTS 50 468 13004800 2300
69517806 yan-zp E Jan. 25, 2020, 12:32 p.m. OK GNU C++14 TESTS 50 498 12800000 2300
35744882 artur.socha E Feb. 26, 2018, 8:23 p.m. OK GNU C++14 TESTS 50 498 13414400 2300
51849981 ruo E March 26, 2019, 7:22 a.m. OK GNU C++17 TESTS 50 436 9728000 2300
47717994 AliShahali1382 E Dec. 30, 2018, 9:14 a.m. OK GNU C++17 TESTS 50 466 11776000 2300
67608324 Phortox E Dec. 25, 2019, 2:24 p.m. OK GNU C++17 TESTS 50 496 12697600 2300
61550592 ivan100sic E Sept. 30, 2019, 12:18 p.m. OK GNU C++17 TESTS 50 498 13209600 2300
45838024 Pakalns E Nov. 16, 2018, 4:42 p.m. OK GNU C++17 TESTS 50 498 13209600 2300
40487905 arbitrary_A E July 17, 2018, 5:55 p.m. OK GNU C++17 TESTS 50 498 21811200 2300
59665266 vjudge3 E Aug. 29, 2019, 1:58 p.m. OK GNU C++17 TESTS 50 528 10649600 2300
40883224 Martin53 E July 28, 2018, 11:40 a.m. OK GNU C++17 TESTS 50 530 11776000 2300
59564553 ST_C E Aug. 27, 2019, 10:08 a.m. OK GNU C++17 TESTS 50 560 15257600 2300
66501237 magdy.hasan E Dec. 8, 2019, 12:37 p.m. OK GNU C++17 TESTS 50 560 90726400 2300
3134290 uwi E Feb. 15, 2013, 6:55 p.m. OK Java 6 TESTS 50 500 25395200 2300
3135004 ahmad_mamdouh E Feb. 16, 2013, 1:44 a.m. OK Java 6 TESTS 50 937 49254400 2300
3143084 arya5691 E Feb. 18, 2013, noon OK Java 6 TESTS 50 1250 48947200 2300
3135007 ahmad_mamdouh E Feb. 16, 2013, 1:45 a.m. OK Java 6 TESTS 50 1296 99020800 2300
3143061 arya5691 E Feb. 18, 2013, 11:54 a.m. OK Java 6 TESTS 50 1326 48947200 2300
3135022 ahmad_mamdouh E Feb. 16, 2013, 1:52 a.m. OK Java 6 TESTS 50 1421 122368000 2300
3134995 ahmad_mamdouh E Feb. 16, 2013, 1:38 a.m. OK Java 6 TESTS 50 1500 109158400 2300
3135027 ahmad_mamdouh E Feb. 16, 2013, 1:54 a.m. OK Java 6 TESTS 50 1544 122982400 2300
3126714 elunichkin E Feb. 14, 2013, 6:38 a.m. OK Java 6 TESTS 50 1921 3379200 2300
3124355 Jokser E Feb. 13, 2013, 6:55 p.m. OK Java 7 TESTS 50 718 23859200 2300
16560029 DukeOfYork E March 7, 2016, 3:28 a.m. OK Java 7 TESTS 50 1122 53964800 2300
6250423 THE_QUEEN_IN_THE_NORTH E April 3, 2014, 1:36 p.m. OK Java 7 TESTS 50 1402 48537600 2300
3429292 xenoslash E April 1, 2013, 3:16 a.m. OK Java 7 TESTS 50 1421 48128000 2300
3137936 Andreos E Feb. 16, 2013, 7:21 p.m. OK Java 7 TESTS 50 1468 78745600 2300
10223897 marcose18 E March 10, 2015, 6:24 a.m. OK Java 7 TESTS 50 1652 73420800 2300
10223892 marcose18 E March 10, 2015, 6:22 a.m. OK Java 7 TESTS 50 1652 82636800 2300
10225000 kws4679 E March 10, 2015, 9:45 a.m. OK Java 7 TESTS 50 1776 63692800 2300
3126716 elunichkin E Feb. 14, 2013, 6:39 a.m. OK Java 7 TESTS 50 1981 1126400 2300
20997912 Dukkha E Sept. 29, 2016, 4:24 p.m. OK Java 8 TESTS 50 1060 36556800 2300
15038572 mkirsche E Dec. 27, 2015, 12:39 a.m. OK Java 8 TESTS 50 1434 75366400 2300
15089041 alibaba E Dec. 29, 2015, 6:40 p.m. OK Java 8 TESTS 50 1526 73420800 2300
3133459 onigiri E Feb. 15, 2013, 4:16 p.m. OK Mono C# TESTS 50 1093 32460800 2300
53541582 teru E April 30, 2019, 7:07 a.m. OK Mono C# TESTS 50 1372 35840000 2300
4400962 patkovskyi E Sept. 3, 2013, 11:37 a.m. OK MS C# TESTS 50 1278 26624000 2300
3415665 vjudge5 E March 28, 2013, 1:15 p.m. OK MS C++ TESTS 50 250 7475200 2300
3415614 vjudge3 E March 28, 2013, 1:05 p.m. OK MS C++ TESTS 50 250 8396800 2300
3415520 vjudge1 E March 28, 2013, 12:44 p.m. OK MS C++ TESTS 50 250 8396800 2300
3415590 vjudge3 E March 28, 2013, 12:58 p.m. OK MS C++ TESTS 50 265 8396800 2300
3415595 vjudge1 E March 28, 2013, 1:01 p.m. OK MS C++ TESTS 50 265 8396800 2300
3128612 fssqawj E Feb. 14, 2013, 1:09 p.m. OK MS C++ TESTS 50 343 12083200 2300
13307512 Alone_L E Sept. 30, 2015, 2 a.m. OK MS C++ TESTS 50 404 7168000 2300
3733755 xin5739 E May 18, 2013, 1:35 p.m. OK MS C++ TESTS 50 421 11776000 2300
59665244 vjudge2 E Aug. 29, 2019, 1:58 p.m. OK MS C++ TESTS 50 466 11673600 2300
3171958 harhrayr E Feb. 22, 2013, 11:40 a.m. OK MS C++ TESTS 50 500 13721600 2300
54886625 CtrlAlt E May 31, 2019, 5:41 p.m. OK MS C++ 2017 TESTS 50 622 12390400 2300

remove filters

Back to search problems