Codeforces Round 129 (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
204 Codeforces Round 129 (Div. 1) FINISHED False 7200 395850586 July 11, 2012, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5334 ) B Little Elephant and Cards PROGRAMMING binary search data structures 1600

B'The Little Elephant loves to play with color cards. He has n cards, each has exactly two colors (the color of the front side and the color of the back side). Initially, all the cards lay on the table with the front side up. In one move the Little Elephant can turn any card to the other side. The Little Elephant thinks that a set of cards on the table is funny if at least half of the cards have the same color (for each card the color of the upper side is considered). Help the Little Elephant to find the minimum number of moves needed to make the set of n cards funny. The first line contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of the cards. The following n lines contain the description of all cards, one card per line. The cards are described by a pair of positive integers not exceeding 109 -- colors of both sides. The first number in a line is the color of the front of the card, the second one -- of the back. The color of the front of the card may coincide with the color of the back of the card. The numbers in the lines are separated by single spaces. On a single line print a single integer -- the sought minimum number of moves. If it is impossible to make the set funny, print -1. In the first sample there initially are three cards lying with colors 4, 4, 7. Since two of the three cards are of the same color 4, you do not need to change anything, so the answer is 0. In the second sample, you can turn the first and the fourth cards. After that three of the five cards will be of color 7.'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
1895534 MrJigan1488 B July 12, 2012, 8:07 p.m. OK Delphi TESTS 90 60 10547200 1600
1884626 tourist B July 11, 2012, 3:42 p.m. OK Delphi TESTS 90 90 13516800 1600
1994750 Shaykhutdinov-T-I B Aug. 9, 2012, 9:08 a.m. OK Delphi TESTS 90 110 12800000 1600
2254202 Mosyagin B Sept. 26, 2012, 7:21 p.m. OK Delphi TESTS 90 156 48128000 1600
1897468 AleksanderBalobanov B July 13, 2012, 12:18 p.m. OK Delphi TESTS 90 160 23552000 1600
2631656 Misha100896 B Nov. 23, 2012, 11:29 a.m. OK Delphi TESTS 90 203 2048000 1600
1892406 ruban B July 11, 2012, 7:44 p.m. OK Delphi TESTS 90 300 37376000 1600
1910120 songsymbol B July 18, 2012, 10:49 p.m. OK FPC TESTS 90 80 5939200 1600
2303016 thaison1496 B Oct. 5, 2012, 4:09 p.m. OK FPC TESTS 90 109 2457600 1600
2853274 Alex_2oo8 B Dec. 29, 2012, 11:16 a.m. OK FPC TESTS 90 125 1638400 1600
1939354 Nik_Storm_2010 B July 25, 2012, 2:17 p.m. OK FPC TESTS 90 130 2764800 1600
1885151 Sereja B July 11, 2012, 3:46 p.m. OK FPC TESTS 90 130 2969600 1600
1891761 clooocanany B July 11, 2012, 6:57 p.m. OK FPC TESTS 90 130 9216000 1600
1896222 giongto35 B July 13, 2012, 3:52 a.m. OK FPC TESTS 90 130 9318400 1600
1887838 Oryshych B July 11, 2012, 4:20 p.m. OK FPC TESTS 90 130 29286400 1600
2904976 25122008 B Jan. 11, 2013, 12:40 p.m. OK FPC TESTS 90 140 3993600 1600
2050660 vilcheuski B Aug. 26, 2012, 4:57 p.m. OK FPC TESTS 90 140 6553600 1600
2173333 abhineet08 B Sept. 15, 2012, 5:03 p.m. OK GNU C TESTS 90 109 2252800 1600
1997881 fzr B Aug. 10, 2012, 1:36 p.m. OK GNU C TESTS 90 130 35123200 1600
2323099 hs_poonia B Oct. 8, 2012, 12:44 p.m. OK GNU C TESTS 90 140 1228800 1600
2636233 hariprasath B Nov. 24, 2012, 7:55 a.m. OK GNU C TESTS 90 140 3174400 1600
1949110 baezilisK B July 29, 2012, 8:20 a.m. OK GNU C TESTS 90 140 18227200 1600
1949118 baezilisK B July 29, 2012, 8:21 a.m. OK GNU C TESTS 90 160 4608000 1600
1949106 baezilisK B July 29, 2012, 8:18 a.m. OK GNU C TESTS 90 160 25497600 1600
1971336 rown B Aug. 2, 2012, 3:46 p.m. OK GNU C TESTS 90 160 135475200 1600
1998611 fzr B Aug. 11, 2012, 12:45 a.m. OK GNU C TESTS 90 170 7065600 1600
1998613 vjudge5 B Aug. 11, 2012, 12:47 a.m. OK GNU C TESTS 90 190 7065600 1600
2041503 trunghieu11 B Aug. 22, 2012, 4:02 a.m. OK GNU C++ TESTS 90 50 3072000 1600
4608529 marat.snowbear B Sept. 29, 2013, 10:44 p.m. OK GNU C++ TESTS 90 62 1433600 1600
5976986 vjudge3 B March 10, 2014, 11:54 a.m. OK GNU C++ TESTS 90 62 1740800 1600
5976974 budlele B March 10, 2014, 11:52 a.m. OK GNU C++ TESTS 90 62 1740800 1600
4171683 scarecrow07 B July 26, 2013, 8:19 p.m. OK GNU C++ TESTS 90 62 3993600 1600
1977473 vjudge5 B Aug. 5, 2012, 5:02 a.m. OK GNU C++ TESTS 90 90 3072000 1600
1893496 chaos_king B July 12, 2012, 3:11 a.m. OK GNU C++ TESTS 90 90 4710400 1600
1893512 chaos_king B July 12, 2012, 3:16 a.m. OK GNU C++ TESTS 90 90 4710400 1600
34293700 vjudge3 B Jan. 19, 2018, 6:30 a.m. OK GNU C++ TESTS 90 92 3686400 1600
40991053 ReaLNero1 B July 31, 2018, 12:22 a.m. OK GNU C++ TESTS 90 92 3993600 1600
9488968 swust_20131737 B Jan. 21, 2015, 2:49 a.m. OK GNU C++0x TESTS 90 122 614400 1600
5028094 No_stop B Nov. 8, 2013, 8:52 a.m. OK GNU C++0x TESTS 90 124 22220800 1600
1892687 Lebesgue B July 11, 2012, 8:47 p.m. OK GNU C++0x TESTS 90 130 21504000 1600
2299833 cuiaoxiang B Oct. 4, 2012, 3:34 p.m. OK GNU C++0x TESTS 90 203 6656000 1600
9261940 suchir B Dec. 24, 2014, 10:29 p.m. OK GNU C++0x TESTS 90 248 8294400 1600
9238722 paulwang eddy1021 akaiNeko B Dec. 24, 2014, 7:45 a.m. OK GNU C++0x TESTS 90 278 9830400 1600
5240784 PIAOYI B Nov. 26, 2013, 6:37 a.m. OK GNU C++0x TESTS 90 280 9011200 1600
1887040 mengpq B July 11, 2012, 4:08 p.m. OK GNU C++0x TESTS 90 300 9523200 1600
9480331 nosy B Jan. 19, 2015, 10:40 p.m. OK GNU C++0x TESTS 90 310 1638400 1600
4317158 wanbo B Aug. 20, 2013, 7:12 p.m. OK GNU C++0x TESTS 90 312 9216000 1600
49553774 Hezx B Feb. 7, 2019, 8:11 a.m. OK GNU C++11 TESTS 90 122 4812800 1600
12234756 cq_phqg B July 27, 2015, 4:38 a.m. OK GNU C++11 TESTS 90 124 3174400 1600
57723356 UBERMENSCH. B July 25, 2019, 6:22 a.m. OK GNU C++11 TESTS 90 124 3481600 1600
26144085 Gasser B April 5, 2017, 1:11 p.m. OK GNU C++11 TESTS 90 124 5324800 1600
34293908 vjudge3 B Jan. 19, 2018, 6:38 a.m. OK GNU C++11 TESTS 90 124 26112000 1600
16609933 00001 B March 9, 2016, 12:18 a.m. OK GNU C++11 TESTS 90 154 3584000 1600
26143843 Gasser B April 5, 2017, 1 p.m. OK GNU C++11 TESTS 90 154 5324800 1600
52136466 hongzhiyin B April 1, 2019, 3:12 a.m. OK GNU C++11 TESTS 90 154 25600000 1600
61346498 luogu_bot5 B Sept. 27, 2019, 5:20 a.m. OK GNU C++11 TESTS 90 156 1638400 1600
17261301 zhaoziy B April 10, 2016, 7:55 a.m. OK GNU C++11 TESTS 90 156 2252800 1600
49037089 wleung_bvg B Jan. 27, 2019, 4:12 a.m. OK GNU C++14 TESTS 90 92 12697600 1600
30781640 Turysbek B Sept. 27, 2017, 3:44 p.m. OK GNU C++14 TESTS 90 154 3993600 1600
45753307 greenblade B Nov. 15, 2018, 3:33 a.m. OK GNU C++14 TESTS 90 156 1228800 1600
32953226 npip99 B Dec. 5, 2017, 4:18 p.m. OK GNU C++14 TESTS 90 156 7680000 1600
32953068 npip99 B Dec. 5, 2017, 4:11 p.m. OK GNU C++14 TESTS 90 156 7680000 1600
34295309 vjudge2 B Jan. 19, 2018, 7:34 a.m. OK GNU C++14 TESTS 90 156 23961600 1600
30025949 Bassel B Sept. 3, 2017, 7:03 a.m. OK GNU C++14 TESTS 90 186 3174400 1600
40925098 4-II B July 29, 2018, 5:45 p.m. OK GNU C++14 TESTS 90 186 3993600 1600
27258654 vjudge2 B May 21, 2017, 4:53 a.m. OK GNU C++14 TESTS 90 186 6144000 1600
59091320 Yunnn B Aug. 19, 2019, 12:50 p.m. OK GNU C++14 TESTS 90 186 7168000 1600
51768619 O.S.Mozes B March 23, 2019, 5:10 p.m. OK GNU C++17 TESTS 90 156 5939200 1600
64851405 tnakao B Nov. 13, 2019, 7:48 p.m. OK GNU C++17 TESTS 90 186 3174400 1600
62201504 NelsonGomesNeto B Oct. 9, 2019, 12:12 p.m. OK GNU C++17 TESTS 90 186 4300800 1600
59218561 Dhananjay_049 B Aug. 21, 2019, 11:20 a.m. OK GNU C++17 TESTS 90 186 7577600 1600
54491877 kimbj0709 B May 22, 2019, 3:48 p.m. OK GNU C++17 TESTS 90 186 9318400 1600
38144507 madhur4127 B May 12, 2018, 5:07 p.m. OK GNU C++17 TESTS 90 186 9318400 1600
63608223 PracticeAccount123 B Oct. 27, 2019, 4:03 p.m. OK GNU C++17 TESTS 90 216 1433600 1600
67317219 Takagi B Dec. 21, 2019, 6:35 a.m. OK GNU C++17 TESTS 90 216 9216000 1600
57020819 mlyean B July 14, 2019, 1:58 p.m. OK GNU C++17 TESTS 90 218 3584000 1600
43886383 iSika B Oct. 6, 2018, 7:40 a.m. OK GNU C++17 TESTS 90 218 3993600 1600
1891500 cojna B July 11, 2012, 6:50 p.m. OK Haskell TESTS 90 380 19353600 1600
21501103 pavel.rosputko B Oct. 16, 2016, 3:58 p.m. OK Haskell TESTS 90 872 74444800 1600
2333232 DimsFromDergachy B Oct. 10, 2012, 4:48 a.m. OK Haskell TESTS 90 1843 20992000 1600
67616657 ashanksingh1997 B Dec. 25, 2019, 5:29 p.m. OK Java 11 TESTS 90 1432 24371200 1600
1883981 uwi B July 11, 2012, 3:36 p.m. OK Java 6 TESTS 90 230 43212800 1600
9479188 dalex B Jan. 19, 2015, 7:04 p.m. OK Java 6 TESTS 90 248 0 1600
9479242 dalex B Jan. 19, 2015, 7:12 p.m. OK Java 6 TESTS 90 248 0 1600
9479255 dalex B Jan. 19, 2015, 7:13 p.m. OK Java 6 TESTS 90 278 0 1600
9479208 dalex B Jan. 19, 2015, 7:07 p.m. OK Java 6 TESTS 90 280 0 1600
4087441 mkirsche B July 17, 2013, 2:50 p.m. OK Java 6 TESTS 90 281 614400 1600
1899693 Egor B July 14, 2012, 10:45 p.m. OK Java 6 TESTS 90 310 52633600 1600
5636341 alibaba B Jan. 8, 2014, 7:32 a.m. OK Java 6 TESTS 90 342 102400 1600
1899661 Egor B July 14, 2012, 9:35 p.m. OK Java 6 TESTS 90 390 54886400 1600
1885154 Sammarize B July 11, 2012, 3:46 p.m. OK Java 6 TESTS 90 470 43622400 1600
1911200 sadkangaroo B July 19, 2012, 10:03 a.m. OK Java 7 TESTS 90 230 45363200 1600
9479190 dalex B Jan. 19, 2015, 7:04 p.m. OK Java 7 TESTS 90 248 0 1600
9479211 dalex B Jan. 19, 2015, 7:07 p.m. OK Java 7 TESTS 90 248 0 1600
9479244 dalex B Jan. 19, 2015, 7:12 p.m. OK Java 7 TESTS 90 248 0 1600
1892684 yarrr B July 11, 2012, 8:46 p.m. OK Java 7 TESTS 90 270 45568000 1600
9479259 dalex B Jan. 19, 2015, 7:14 p.m. OK Java 7 TESTS 90 278 0 1600
6738162 0p9o8i B May 30, 2014, 5:29 a.m. OK Java 7 TESTS 90 280 204800 1600
1892694 yarrr B July 11, 2012, 8:50 p.m. OK Java 7 TESTS 90 280 45465600 1600
1899660 Egor B July 14, 2012, 9:35 p.m. OK Java 7 TESTS 90 380 58163200 1600
9479180 dalex B Jan. 19, 2015, 7:03 p.m. OK Java 7 TESTS 90 498 2969600 1600
9479246 dalex B Jan. 19, 2015, 7:12 p.m. OK Java 8 TESTS 90 340 5017600 1600
9479191 dalex B Jan. 19, 2015, 7:05 p.m. OK Java 8 TESTS 90 342 4915200 1600
9479263 dalex B Jan. 19, 2015, 7:14 p.m. OK Java 8 TESTS 90 342 5017600 1600
9479219 dalex B Jan. 19, 2015, 7:07 p.m. OK Java 8 TESTS 90 404 0 1600
25120804 Maulik_Patel B March 1, 2017, 10:42 a.m. OK Java 8 TESTS 90 468 36454400 1600
20084122 MazzForces B Aug. 23, 2016, 11:29 a.m. OK Java 8 TESTS 90 530 20684800 1600
9479184 dalex B Jan. 19, 2015, 7:03 p.m. OK Java 8 TESTS 90 590 13107200 1600
41655256 ShowStopper728 B Aug. 16, 2018, 2:10 p.m. OK Java 8 TESTS 90 622 12902400 1600
10843326 poikniok B April 24, 2015, 3:40 a.m. OK Java 8 TESTS 90 624 29900800 1600
62685849 darthvaderdv16 B Oct. 16, 2019, 2:03 p.m. OK Java 8 TESTS 90 652 10854400 1600
58328720 Spheniscine B Aug. 5, 2019, 8:39 a.m. OK Kotlin TESTS 90 872 14950400 1600
58328741 Spheniscine B Aug. 5, 2019, 8:39 a.m. OK Kotlin TESTS 90 1246 16486400 1600
3584288 supachai_pay B April 21, 2013, 9:15 a.m. OK Mono C# TESTS 90 203 18124800 1600
1945135 Quercitron B July 27, 2012, 4 p.m. OK Mono C# TESTS 90 800 23449600 1600
1889307 it4.kp B July 11, 2012, 4:46 p.m. OK Mono C# TESTS 90 910 24371200 1600
1887812 fiver B July 11, 2012, 4:20 p.m. OK Mono C# TESTS 90 1010 38912000 1600
14928417 og.kostya B Dec. 22, 2015, 5:15 p.m. OK MS C# TESTS 90 186 16384000 1600
33464501 m1_k3 B Dec. 20, 2017, 7:12 p.m. OK MS C# TESTS 90 340 29081600 1600
22491588 pomjuice B Nov. 25, 2016, 2:57 p.m. OK MS C# TESTS 90 810 27852800 1600
1886718 seen B July 11, 2012, 4:04 p.m. OK MS C++ TESTS 90 90 4710400 1600
1886935 aa2985759 B July 11, 2012, 4:07 p.m. OK MS C++ TESTS 90 90 12492800 1600
1918786 KOHCTAHTIH B July 21, 2012, 5:03 a.m. OK MS C++ TESTS 90 110 3072000 1600
1898384 Sklyack B July 13, 2012, 6:17 p.m. OK MS C++ TESTS 90 110 3891200 1600
1898387 Sklyack B July 13, 2012, 6:19 p.m. OK MS C++ TESTS 90 110 3891200 1600
25457715 vjudge4 B March 13, 2017, 4:04 p.m. OK MS C++ TESTS 90 124 3481600 1600
1893170 L_Ecry B July 12, 2012, 1:28 a.m. OK MS C++ TESTS 90 130 4096000 1600
1893166 fcjy888 B July 12, 2012, 1:26 a.m. OK MS C++ TESTS 90 130 5427200 1600
1891593 916852 B July 11, 2012, 6:52 p.m. OK MS C++ TESTS 90 130 5427200 1600
1885037 kuzmichev_dima B July 11, 2012, 3:45 p.m. OK MS C++ TESTS 90 130 6963200 1600
63298365 pmitkov B Oct. 24, 2019, 1:35 p.m. OK MS C++ 2017 TESTS 90 310 8908800 1600
53392909 zcb B April 27, 2019, 7:45 a.m. OK MS C++ 2017 TESTS 90 404 11264000 1600
56974448 2462478392 B July 13, 2019, 11:40 a.m. OK MS C++ 2017 TESTS 90 436 10444800 1600
44603107 hongquanntct B Oct. 20, 2018, 3:25 p.m. OK PHP TESTS 90 216 12185600 1600
44603013 hongquanntct B Oct. 20, 2018, 3:23 p.m. OK PHP TESTS 90 248 14233600 1600
18877916 mayakin B July 4, 2016, 6:59 a.m. OK PHP TESTS 90 778 46182400 1600
39437603 nowyyz B June 20, 2018, 1:47 p.m. OK PyPy 3 TESTS 90 1934 22425600 1600
10197630 krismaz B March 7, 2015, 8:39 p.m. OK Python 2 TESTS 90 748 12800000 1600
1999963 xiaocai B Aug. 11, 2012, 12:11 p.m. OK Python 2 TESTS 90 860 27136000 1600
1897676 Madiyar B July 13, 2012, 1:11 p.m. OK Python 2 TESTS 90 890 17817600 1600
1897694 Madiyar B July 13, 2012, 1:16 p.m. OK Python 2 TESTS 90 890 19456000 1600
1886452 nwi B July 11, 2012, 4 p.m. OK Python 2 TESTS 90 940 17817600 1600
1892807 bryn B July 11, 2012, 9:34 p.m. OK Python 2 TESTS 90 1030 17817600 1600
1884801 neex.emil B July 11, 2012, 3:43 p.m. OK Python 2 TESTS 90 1030 24268800 1600
1900869 sleepiforest B July 15, 2012, 2:03 p.m. OK Python 2 TESTS 90 1030 26316800 1600
54631227 wrong_lemma B May 25, 2019, 2:33 p.m. OK Python 2 TESTS 90 1060 16588800 1600
20019654 Oidiot B Aug. 21, 2016, 5:58 a.m. OK Python 2 TESTS 90 1060 21094400 1600
7749156 AbdoA2 B Sept. 12, 2014, 7:22 a.m. OK Python 3 TESTS 90 872 11571200 1600
5420708 yugle7 B Dec. 13, 2013, 1:41 p.m. OK Python 3 TESTS 90 1092 16076800 1600
29509451 rprtr258 B Aug. 16, 2017, 4:03 p.m. OK Python 3 TESTS 90 1154 25292800 1600
42123854 Mk_Python_v1 B Aug. 26, 2018, 1:56 p.m. OK Python 3 TESTS 90 1184 21299200 1600
50242980 ashok123 B Feb. 20, 2019, 1:41 p.m. OK Python 3 TESTS 90 1184 22220800 1600
25585546 eduardovaca B March 17, 2017, 10:26 p.m. OK Python 3 TESTS 90 1622 44953600 1600
38965034 imyangzzzzzz B June 5, 2018, 9:41 a.m. OK Python 3 TESTS 90 1996 30515200 1600
35844527 ______n______ B March 2, 2018, 3:31 p.m. OK Ruby TESTS 90 684 29388800 1600
35844339 _____i_____ B March 2, 2018, 3:27 p.m. OK Ruby TESTS 90 684 29388800 1600
35844549 ______u______ B March 2, 2018, 3:32 p.m. OK Ruby TESTS 90 684 29388800 1600
35844338 _____k_____ B March 2, 2018, 3:27 p.m. OK Ruby TESTS 90 684 29388800 1600
35836935 ______M______ B March 2, 2018, 1:04 p.m. OK Ruby TESTS 90 684 29388800 1600
35839227 ______i______ B March 2, 2018, 1:48 p.m. OK Ruby TESTS 90 684 29388800 1600
35839947 ______k______ B March 2, 2018, 2:09 p.m. OK Ruby TESTS 90 684 29388800 1600
35839954 ______h______ B March 2, 2018, 2:09 p.m. OK Ruby TESTS 90 684 29388800 1600
64297004 olexandryermilov B Nov. 5, 2019, 8:54 a.m. OK Scala TESTS 90 1528 8806400 1600

remove filters

Back to search problems