Codeforces Round 207 (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
356 Codeforces Round 207 (Div. 1) FINISHED False 7200 355773604 Oct. 15, 2013, noon

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1278 ) C Compartments PROGRAMMING combinatorics constructive algorithms greedy implementation 2200

B'A team of students from the city S is sent to the All-Berland Olympiad in Informatics. Traditionally, they go on the train. All students have bought tickets in one carriage, consisting of n compartments (each compartment has exactly four people). We know that if one compartment contain one or two students, then they get bored, and if one compartment contain three or four students, then the compartment has fun throughout the entire trip. The students want to swap with other people, so that no compartment with students had bored students. To swap places with another person, you need to convince him that it is really necessary. The students can not independently find the necessary arguments, so they asked a sympathetic conductor for help. The conductor can use her life experience to persuade any passenger to switch places with some student. However, the conductor does not want to waste time persuading the wrong people, so she wants to know what is the minimum number of people necessary to persuade her to change places with the students. Your task is to find the number. After all the swaps each compartment should either have no student left, or have a company of three or four students. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- the number of compartments in the carriage. The second line contains n integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an showing how many students ride in each compartment (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x894). It is guaranteed that at least one student is riding in the train. If no sequence of swapping seats with other people leads to the desired result, print number "-1" (without the quotes). In another case, print the smallest number of people you need to persuade to swap places.'...

Tutorials

Codeforces Round #207: разбор задач

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
5817029 segezha C Jan. 27, 2014, 5:12 a.m. OK FPC TESTS 141 62 0 2200
4792842 Alex_2oo8 C Oct. 15, 2013, 12:39 p.m. OK FPC TESTS 141 62 0 2200
4929454 Nik_Storm_2010 C Oct. 29, 2013, 2:34 p.m. OK FPC TESTS 141 62 102400 2200
4817219 vietdoan C Oct. 18, 2013, 3:13 a.m. OK FPC TESTS 141 62 102400 2200
25373386 Gray_58 C March 10, 2017, 6:06 a.m. OK FPC TESTS 141 109 1740800 2200
23648525 lukomskiy C Jan. 8, 2017, 3:19 p.m. OK FPC TESTS 141 124 1638400 2200
29470100 keppo C Aug. 15, 2017, 12:01 a.m. OK FPC TESTS 141 140 1638400 2200
4802270 -oo- C Oct. 16, 2013, 4 a.m. OK GNU C TESTS 141 124 0 2200
10541638 lnsuyn C April 1, 2015, 12:41 p.m. OK GNU C TESTS 141 139 0 2200
6022852 LoneFox C March 15, 2014, 11:02 p.m. OK GNU C++ TESTS 141 15 0 2200
4795451 sy2006 C Oct. 15, 2013, 1:19 p.m. OK GNU C++ TESTS 141 15 3993600 2200
40989447 ReaLNero1 C July 30, 2018, 10:56 p.m. OK GNU C++ TESTS 141 31 0 2200
10500916 Memory120 C March 28, 2015, 1:51 p.m. OK GNU C++ TESTS 141 31 0 2200
4926243 FancyCoder C Oct. 29, 2013, 3:17 a.m. OK GNU C++ TESTS 141 31 0 2200
4825481 nocLyt C Oct. 19, 2013, 2:33 p.m. OK GNU C++ TESTS 141 31 0 2200
4825354 nocLyt C Oct. 19, 2013, 2:10 p.m. OK GNU C++ TESTS 141 31 0 2200
4806711 eddy1021 C Oct. 16, 2013, 1:44 p.m. OK GNU C++ TESTS 141 31 0 2200
4797185 bill125 C Oct. 15, 2013, 1:47 p.m. OK GNU C++ TESTS 141 31 0 2200
38962978 Scut82 C June 5, 2018, 8:02 a.m. OK GNU C++ TESTS 141 31 3584000 2200
4804390 Chortos-2 C Oct. 16, 2013, 9:42 a.m. OK GNU C++0x TESTS 141 15 3993600 2200
5042001 doraemon C Nov. 10, 2013, 11:40 a.m. OK GNU C++0x TESTS 141 62 0 2200
4918624 sleepiforest C Oct. 28, 2013, 9:55 a.m. OK GNU C++0x TESTS 141 62 0 2200
4913095 hex539 C Oct. 27, 2013, 1:02 p.m. OK GNU C++0x TESTS 141 62 0 2200
4809278 tomasz.kociumaka C Oct. 16, 2013, 5:36 p.m. OK GNU C++0x TESTS 141 62 0 2200
4801775 boleyn.su C Oct. 16, 2013, 2:22 a.m. OK GNU C++0x TESTS 141 62 0 2200
4801573 tsfn C Oct. 16, 2013, 1:42 a.m. OK GNU C++0x TESTS 141 62 0 2200
4797851 SteelRaven C Oct. 15, 2013, 1:56 p.m. OK GNU C++0x TESTS 141 62 0 2200
4796261 Xellos C Oct. 15, 2013, 1:33 p.m. OK GNU C++0x TESTS 141 62 0 2200
4913123 hex539 C Oct. 27, 2013, 1:07 p.m. OK GNU C++0x TESTS 141 78 0 2200
63699592 shuashuawan C Oct. 29, 2019, 6:50 a.m. OK GNU C++11 TESTS 141 31 0 2200
63653891 wangzhijian C Oct. 28, 2019, 12:09 p.m. OK GNU C++11 TESTS 141 31 0 2200
54501287 WOSHIGEPACHONG2 C May 22, 2019, 9:07 p.m. OK GNU C++11 TESTS 141 31 0 2200
52951788 menjiantong C April 18, 2019, 12:12 p.m. OK GNU C++11 TESTS 141 31 0 2200
12218171 vjudge5 C July 24, 2015, 7:01 p.m. OK GNU C++11 TESTS 141 31 204800 2200
65563723 JCC_ C Nov. 23, 2019, 4:46 a.m. OK GNU C++11 TESTS 141 124 0 2200
65111702 jiang.zhi C Nov. 15, 2019, 11:17 p.m. OK GNU C++11 TESTS 141 124 0 2200
55182664 SoiMae C June 6, 2019, 12:36 a.m. OK GNU C++11 TESTS 141 124 0 2200
45754606 hansenhaig C Nov. 15, 2018, 4:46 a.m. OK GNU C++11 TESTS 141 124 0 2200
31866161 Noureldin C Oct. 29, 2017, 12:19 p.m. OK GNU C++11 TESTS 141 124 0 2200
28813632 LiChenKoh C July 24, 2017, 4:06 a.m. OK GNU C++14 TESTS 141 31 12185600 2200
25978560 BanFcc C March 31, 2017, 12:34 p.m. OK GNU C++14 TESTS 141 140 1945600 2200
54410677 zstu_MingSD C May 20, 2019, 9:31 a.m. OK GNU C++14 TESTS 141 171 4198400 2200
65574181 1551105887 C Nov. 23, 2019, 8:50 a.m. OK GNU C++14 TESTS 141 186 0 2200
63067326 JasonZhan C Oct. 21, 2019, 11:19 a.m. OK GNU C++14 TESTS 141 186 0 2200
46839985 NotNight C Dec. 10, 2018, 6:47 a.m. OK GNU C++14 TESTS 141 186 0 2200
67520363 bjn C Dec. 24, 2019, 12:13 p.m. OK GNU C++14 TESTS 141 186 204800 2200
58248639 rko27 C Aug. 4, 2019, 6:45 a.m. OK GNU C++14 TESTS 141 186 3993600 2200
65576332 1551105887 C Nov. 23, 2019, 9:30 a.m. OK GNU C++14 TESTS 141 187 0 2200
58940634 Scut82 C Aug. 17, 2019, 6:45 a.m. OK GNU C++14 TESTS 141 187 0 2200
63061148 LeiviniaBirdway C Oct. 21, 2019, 8:43 a.m. OK GNU C++17 TESTS 141 171 0 2200
63670461 Mansur C Oct. 28, 2019, 4:42 p.m. OK GNU C++17 TESTS 141 171 1228800 2200
57187323 vjudge1 C July 17, 2019, 9:06 a.m. OK GNU C++17 TESTS 141 186 0 2200
55576227 ruo C June 15, 2019, 1:19 a.m. OK GNU C++17 TESTS 141 186 0 2200
47542422 pranav_012 C Dec. 27, 2018, 7:56 a.m. OK GNU C++17 TESTS 141 186 3993600 2200
56398877 pkgunboat C July 1, 2019, 3:54 p.m. OK GNU C++17 TESTS 141 187 0 2200
52710714 ivan100sic C April 13, 2019, 3:49 p.m. OK GNU C++17 TESTS 141 187 0 2200
49943362 ONE_DAY_I_WILL C Feb. 15, 2019, 10:53 a.m. OK GNU C++17 TESTS 141 202 0 2200
35655423 WooDeND C Feb. 24, 2018, 5:35 p.m. OK GNU C++17 TESTS 141 202 1945600 2200
42730111 Martin53 C Sept. 10, 2018, 11 a.m. OK GNU C++17 TESTS 141 218 204800 2200
6475915 Sammarize C April 25, 2014, 10:33 p.m. OK Java 6 TESTS 141 156 3993600 2200
4804248 bay C Oct. 16, 2013, 9:20 a.m. OK Java 6 TESTS 141 296 58572800 2200
4826578 Ljubitel C Oct. 19, 2013, 5:46 p.m. OK Java 6 TESTS 141 312 58572800 2200
4922532 mkirsche C Oct. 28, 2013, 5:50 p.m. OK Java 6 TESTS 141 764 6758400 2200
4802398 uwi C Oct. 16, 2013, 4:29 a.m. OK Java 7 TESTS 141 62 0 2200
4800163 MaVa C Oct. 15, 2013, 8:34 p.m. OK Java 7 TESTS 141 93 0 2200
4811019 RDG C Oct. 17, 2013, 2:32 a.m. OK Java 7 TESTS 141 109 0 2200
4792397 Egor C Oct. 15, 2013, 12:33 p.m. OK Java 7 TESTS 141 109 0 2200
4849068 Saguntoz C Oct. 23, 2013, 7:17 a.m. OK Java 7 TESTS 141 124 3891200 2200
4803015 hyggyh C Oct. 16, 2013, 6:30 a.m. OK Java 7 TESTS 141 124 3891200 2200
4857030 xenoslash C Oct. 24, 2013, 5:32 a.m. OK Java 7 TESTS 141 140 0 2200
4803014 hyggyh C Oct. 16, 2013, 6:29 a.m. OK Java 7 TESTS 141 140 3891200 2200
4794588 lightning C Oct. 15, 2013, 1:04 p.m. OK Java 7 TESTS 141 140 4096000 2200
4798984 darnley C Oct. 15, 2013, 5:59 p.m. OK Java 7 TESTS 141 156 3891200 2200
52998788 cplayer C April 19, 2019, 5:53 a.m. OK Java 8 TESTS 141 202 26316800 2200
10832644 alibaba C April 23, 2015, 8:43 a.m. OK Java 8 TESTS 141 202 32563200 2200
42624592 vjudge5 C Sept. 7, 2018, 3:01 p.m. OK Java 8 TESTS 141 919 74240000 2200
4931130 Mark_tven C Oct. 29, 2013, 9:48 p.m. OK MS C# TESTS 141 202 34508800 2200
7823381 azukun C Sept. 18, 2014, 6:39 a.m. OK MS C# TESTS 141 296 40448000 2200
7823360 azukun C Sept. 18, 2014, 6:35 a.m. OK MS C# TESTS 141 327 48435200 2200
4949099 Yury_Bandarchuk C Nov. 1, 2013, 6:51 a.m. OK MS C++ TESTS 141 109 0 2200
4901107 kcm1700 C Oct. 26, 2013, 9:06 a.m. OK MS C++ TESTS 141 109 0 2200
4818795 Kasparyan_Mikhail C Oct. 18, 2013, 10:35 a.m. OK MS C++ TESTS 141 109 0 2200
4793309 kingofnumbers C Oct. 15, 2013, 12:45 p.m. OK MS C++ TESTS 141 109 0 2200
4805222 ophunter C Oct. 16, 2013, 11:46 a.m. OK MS C++ TESTS 141 109 3891200 2200
52663082 vjudge4 C April 13, 2019, 2:06 a.m. OK MS C++ TESTS 141 109 3993600 2200
4824470 Xiaodongdong C Oct. 19, 2013, 11:48 a.m. OK MS C++ TESTS 141 124 0 2200
4814984 tomas.svab C Oct. 17, 2013, 3:34 p.m. OK MS C++ TESTS 141 124 0 2200
4802327 Elun C Oct. 16, 2013, 4:13 a.m. OK MS C++ TESTS 141 124 0 2200
4802258 nf001 C Oct. 16, 2013, 3:56 a.m. OK MS C++ TESTS 141 124 0 2200
60509508 pajenegod C Sept. 14, 2019, 1:27 a.m. OK PyPy 2 TESTS 141 342 37376000 2200
4880630 KBRCH C Oct. 25, 2013, 3:13 p.m. OK Python 2 TESTS 141 62 4608000 2200
4849933 RainDreamer C Oct. 23, 2013, 9:37 a.m. OK Python 2 TESTS 141 561 10342400 2200
4994583 RamTararam C Nov. 5, 2013, 3:50 p.m. OK Python 2 TESTS 141 639 11468800 2200
4900519 baggiojmj C Oct. 26, 2013, 7:29 a.m. OK Python 2 TESTS 141 655 12390400 2200
4853582 nealzane C Oct. 23, 2013, 2:39 p.m. OK Python 2 TESTS 141 686 9830400 2200
35861584 ______n______ C March 2, 2018, 10:06 p.m. OK Python 2 TESTS 141 686 14848000 2200
35861560 ______u______ C March 2, 2018, 10:05 p.m. OK Python 2 TESTS 141 686 14848000 2200
35861165 _____i_____ C March 2, 2018, 9:57 p.m. OK Python 2 TESTS 141 686 14848000 2200
35861092 _____k_____ C March 2, 2018, 9:55 p.m. OK Python 2 TESTS 141 686 14848000 2200
35857704 ______h______ C March 2, 2018, 8:45 p.m. OK Python 2 TESTS 141 686 14848000 2200
5635399 dc. C Jan. 8, 2014, 1:35 a.m. OK Python 3 TESTS 141 483 11059200 2200
42824521 vjudge2 C Sept. 13, 2018, 9:04 a.m. OK Python 3 TESTS 141 545 14540800 2200
42824483 JoeGun C Sept. 13, 2018, 9:03 a.m. OK Python 3 TESTS 141 545 14540800 2200
44927699 YazanRi C Oct. 26, 2018, 9:05 p.m. OK Python 3 TESTS 141 546 14540800 2200
4849994 leomao C Oct. 23, 2013, 9:46 a.m. OK Python 3 TESTS 141 561 13721600 2200
42135284 Mk_Python_v1 C Aug. 26, 2018, 10:57 p.m. OK Python 3 TESTS 141 607 14745600 2200
4850006 leomao C Oct. 23, 2013, 9:48 a.m. OK Python 3 TESTS 141 639 13721600 2200
4810189 MinakoKojima C Oct. 16, 2013, 8:32 p.m. OK Ruby TESTS 141 561 36556800 2200

remove filters

Back to search problems