Codeforces Round 611 (Div. 3)

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
1283 Codeforces Round 611 (Div. 3) FINISHED False 7200 159800111 Dec. 28, 2019, 5:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6668 ) E New Year Parties PROGRAMMING dp greedy 1800

B'Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... n friends live in a city which can be represented as a number line. The i -th friend lives in a house with an integer coordinate x_i . The i -th friend can come celebrate the New Year to the house with coordinate x_i-1 , x_i+1 or stay at x_i . Each friend is allowed to move no more than once. For all friends 1 <= x_i <= n holds, however, they can come to houses with coordinates 0 and n+1 (if their houses are at 1 or n , respectively). For example, let the initial positions be x = [1, 2, 4, 4] . The final ones then can be [1, 3, 3, 4] , [0, 2, 3, 3] , [2, 2, 5, 5] , [2, 1, 3, 5] and so on. The number of occupied houses is the number of distinct positions among the final ones. So all friends choose the moves they want to perform. After that the number of occupied houses is calculated. What is the minimum and the maximum number of occupied houses can there be? The first line contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of friends. The second line contains n integers x_1, x_2, ... , x_n ( 1 <= x_i <= n ) -- the coordinates of the houses of the friends. Print two integers -- the minimum and the maximum possible number of occupied houses after all moves are performed. In the first example friends can go to [2, 2, 3, 3] . So friend 1 goes to x_1+1 , friend 2 stays at his house x_2 , friend 3 goes to x_3-1 and friend 4 goes to x_4-1 . [1, 1, 3, 3] , [2, 2, 3, 3] or [2, 2, 4, 4] are also all valid options to obtain 2 occupied houses. For the maximum number of occupied houses friends can go to [1, 2, 3, 4] or to [0, 2, 4, 5] , for example. '...

Tutorials

Codeforces Round #611 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
68022217 clrcldy E Jan. 1, 2020, 12:58 a.m. OK Clang++17 Diagnostics TESTS 36 873 1638400 1800
68116334 ruban E Jan. 3, 2020, 11:35 a.m. OK Delphi TESTS 36 77 31334400 1800
68697060 chaorenhaha E Jan. 13, 2020, 8:15 a.m. OK FPC TESTS 36 77 3276800 1800
68697040 chaorenhaha E Jan. 13, 2020, 8:15 a.m. OK FPC TESTS 36 77 4300800 1800
68200674 kavya246 E Jan. 4, 2020, 3:36 p.m. OK GNU C11 TESTS 36 61 1024000 1800
68200759 mohana-256 E Jan. 4, 2020, 3:39 p.m. OK GNU C11 TESTS 36 61 1024000 1800
67849740 kaiboy E Dec. 29, 2019, 1:44 a.m. OK GNU C11 TESTS 36 62 1024000 1800
67843570 rainboy E Dec. 28, 2019, 8:24 p.m. OK GNU C11 TESTS 36 62 1024000 1800
67985392 akshatdalton E Dec. 30, 2019, 10:11 p.m. OK GNU C11 TESTS 36 62 4812800 1800
67834827 pengin_2000 E Dec. 28, 2019, 6:53 p.m. OK GNU C11 TESTS 36 93 1638400 1800
67846592 kaiboy E Dec. 28, 2019, 10:02 p.m. OK GNU C11 TESTS 36 93 1843200 1800
68150602 Peanut.Tang E Jan. 4, 2020, 6:44 a.m. OK GNU C++11 TESTS 36 31 614400 1800
69296432 wasa855 E Jan. 22, 2020, 12:23 p.m. OK GNU C++11 TESTS 36 31 819200 1800
67850499 yalizjc E Dec. 29, 2019, 2:31 a.m. OK GNU C++11 TESTS 36 31 1638400 1800
67875804 sun_of_Ice E Dec. 29, 2019, 1:15 p.m. OK GNU C++11 TESTS 36 31 1638400 1800
68343512 caidzh E Jan. 7, 2020, 5:46 a.m. OK GNU C++11 TESTS 36 31 3174400 1800
68036535 Frame233 E Jan. 1, 2020, 12:20 p.m. OK GNU C++11 TESTS 36 46 1024000 1800
67850570 Frame233 E Dec. 29, 2019, 2:35 a.m. OK GNU C++11 TESTS 36 46 1024000 1800
68223394 tomsay E Jan. 5, 2020, 6:03 a.m. OK GNU C++11 TESTS 36 46 1024000 1800
69239917 cornivores E Jan. 21, 2020, 11:02 a.m. OK GNU C++11 TESTS 36 46 1638400 1800
68225208 zclong E Jan. 5, 2020, 6:51 a.m. OK GNU C++11 TESTS 36 46 1638400 1800
68380067 Lezedary_sandwich E Jan. 7, 2020, 11:39 p.m. OK GNU C++14 TESTS 36 46 1843200 1800
68223337 iAmrifat E Jan. 5, 2020, 6:02 a.m. OK GNU C++14 TESTS 36 61 5017600 1800
69441782 spookywooky E Jan. 23, 2020, 10:15 p.m. OK GNU C++14 TESTS 36 62 819200 1800
67971325 lok52 E Dec. 30, 2019, 3:08 p.m. OK GNU C++14 TESTS 36 62 819200 1800
67847914 stefdasca E Dec. 28, 2019, 11:15 p.m. OK GNU C++14 TESTS 36 62 819200 1800
68102999 ayushjain2809 E Jan. 3, 2020, 5:05 a.m. OK GNU C++14 TESTS 36 62 1638400 1800
68832810 yyhslfw E Jan. 15, 2020, 12:21 a.m. OK GNU C++14 TESTS 36 62 1638400 1800
68642116 Indecchi E Jan. 12, 2020, 7:51 a.m. OK GNU C++14 TESTS 36 62 1638400 1800
68220476 applemelon E Jan. 5, 2020, 4:19 a.m. OK GNU C++14 TESTS 36 62 1638400 1800
68163775 prakhar6381 E Jan. 4, 2020, noon OK GNU C++14 TESTS 36 62 1638400 1800
68218193 nickluo E Jan. 5, 2020, 2:19 a.m. OK GNU C++17 TESTS 36 46 1331200 1800
67851984 angrysqrt3 E Dec. 29, 2019, 3:49 a.m. OK GNU C++17 TESTS 36 61 3174400 1800
68161186 zxcv_1 E Jan. 4, 2020, 10:55 a.m. OK GNU C++17 TESTS 36 62 819200 1800
68279273 Bhismania E Jan. 5, 2020, 4:23 p.m. OK GNU C++17 TESTS 36 62 819200 1800
68320972 Anji E Jan. 6, 2020, 2:57 p.m. OK GNU C++17 TESTS 36 62 819200 1800
69244012 anarchist04 E Jan. 21, 2020, 12:21 p.m. OK GNU C++17 TESTS 36 62 819200 1800
67853197 vinhntndu E Dec. 29, 2019, 4:42 a.m. OK GNU C++17 TESTS 36 62 819200 1800
67982149 tquicks E Dec. 30, 2019, 7:53 p.m. OK GNU C++17 TESTS 36 62 819200 1800
68085666 mikunakano E Jan. 2, 2020, 4:08 p.m. OK GNU C++17 TESTS 36 62 1638400 1800
68155164 Numb_lzw E Jan. 4, 2020, 8:41 a.m. OK GNU C++17 TESTS 36 62 1638400 1800
68122073 Taube E Jan. 3, 2020, 1:42 p.m. OK Go TESTS 36 202 0 1800
68216316 liesen E Jan. 4, 2020, 11:51 p.m. OK Haskell TESTS 36 732 37888000 1800
68630683 collares E Jan. 12, 2020, 2:36 a.m. OK Haskell TESTS 36 733 26316800 1800
67875633 ShesMyNerd E Dec. 29, 2019, 1:11 p.m. OK Java 11 TESTS 36 218 0 1800
69161684 RetiredProgrammer E Jan. 20, 2020, 12:25 a.m. OK Java 11 TESTS 36 233 0 1800
69161665 RetiredProgrammer E Jan. 20, 2020, 12:25 a.m. OK Java 11 TESTS 36 233 0 1800
67834663 kashishsingh8700 E Dec. 28, 2019, 6:52 p.m. OK Java 11 TESTS 36 233 0 1800
67823854 mangkoo E Dec. 28, 2019, 6:09 p.m. OK Java 11 TESTS 36 249 0 1800
67822605 bleh0.5 E Dec. 28, 2019, 6:05 p.m. OK Java 11 TESTS 36 265 3379200 1800
69233620 Piccadilly E Jan. 21, 2020, 10:27 a.m. OK Java 11 TESTS 36 296 14233600 1800
68052942 about E Jan. 1, 2020, 8 p.m. OK Java 11 TESTS 36 311 409600 1800
68052257 sunnycarlos E Jan. 1, 2020, 7:33 p.m. OK Java 11 TESTS 36 312 17408000 1800
67820497 Anonymous E Dec. 28, 2019, 5:58 p.m. OK Java 11 TESTS 36 326 13721600 1800
67862289 amolpratap007 E Dec. 29, 2019, 8:34 a.m. OK Java 8 TESTS 36 124 0 1800
67853372 KharYusuf E Dec. 29, 2019, 4:48 a.m. OK Java 8 TESTS 36 124 0 1800
67944813 luchy0120 E Dec. 30, 2019, 4:33 a.m. OK Java 8 TESTS 36 140 0 1800
67870573 basheer97 E Dec. 29, 2019, 11:18 a.m. OK Java 8 TESTS 36 140 0 1800
67840915 yash49 E Dec. 28, 2019, 7:31 p.m. OK Java 8 TESTS 36 140 0 1800
67854587 Optimist_Code E Dec. 29, 2019, 5:28 a.m. OK Java 8 TESTS 36 155 0 1800
67856845 Keyur21 E Dec. 29, 2019, 6:27 a.m. OK Java 8 TESTS 36 155 2048000 1800
68055946 AnandOza E Jan. 1, 2020, 10:38 p.m. OK Java 8 TESTS 36 155 2048000 1800
67866105 Keyur21 E Dec. 29, 2019, 9:44 a.m. OK Java 8 TESTS 36 155 2048000 1800
68487197 shaurya_singh E Jan. 10, 2020, 10:15 a.m. OK Java 8 TESTS 36 156 2048000 1800
68342777 Spheniscine E Jan. 7, 2020, 5:12 a.m. OK Kotlin TESTS 36 202 5120000 1800
68342681 Spheniscine E Jan. 7, 2020, 5:08 a.m. OK Kotlin TESTS 36 202 5222400 1800
67813569 Kenb E Dec. 28, 2019, 5:36 p.m. OK Kotlin TESTS 36 342 6451200 1800
67843804 cmplx-xyttmt E Dec. 28, 2019, 8:29 p.m. OK Kotlin TESTS 36 405 16588800 1800
67811688 riantkb E Dec. 28, 2019, 5:30 p.m. OK Mono C# TESTS 36 124 20889600 1800
67819573 hibatibati E Dec. 28, 2019, 5:55 p.m. OK Mono C# TESTS 36 139 21094400 1800
67837002 IlyaCk E Dec. 28, 2019, 7:01 p.m. OK Mono C# TESTS 36 140 28876800 1800
69424246 sakapon E Jan. 23, 2020, 3:18 p.m. OK Mono C# TESTS 36 155 28979200 1800
69285220 mban259 E Jan. 22, 2020, 7:52 a.m. OK Mono C# TESTS 36 155 32972800 1800
68482636 vjudge5 E Jan. 10, 2020, 8:24 a.m. OK MS C++ TESTS 36 46 819200 1800
68280370 vjudge2 E Jan. 5, 2020, 5:03 p.m. OK MS C++ TESTS 36 62 3174400 1800
68472196 vjudge1 E Jan. 10, 2020, 2:45 a.m. OK MS C++ TESTS 36 155 1228800 1800
68564486 vjudge2 E Jan. 10, 2020, 8:19 p.m. OK MS C++ TESTS 36 171 819200 1800
68709973 kwfumou1242 E Jan. 13, 2020, 12:40 p.m. OK MS C++ TESTS 36 296 11264000 1800
68570404 vjudge5 E Jan. 11, 2020, 1:46 a.m. OK MS C++ TESTS 36 452 29798400 1800
69277858 sbwww E Jan. 22, 2020, 3:51 a.m. OK MS C++ 2017 TESTS 36 78 1638400 1800
67843387 youx E Dec. 28, 2019, 8:19 p.m. OK MS C++ 2017 TESTS 36 93 1638400 1800
68403020 DR.Salieri E Jan. 8, 2020, 1:51 p.m. OK MS C++ 2017 TESTS 36 93 1638400 1800
67832184 egardoz01 E Dec. 28, 2019, 6:42 p.m. OK MS C++ 2017 TESTS 36 93 2048000 1800
67857737 hack2kong E Dec. 29, 2019, 6:48 a.m. OK MS C++ 2017 TESTS 36 93 2560000 1800
67827974 pichulia E Dec. 28, 2019, 6:25 p.m. OK MS C++ 2017 TESTS 36 93 24064000 1800
68098102 milutin_ E Jan. 2, 2020, 10:46 p.m. OK MS C++ 2017 TESTS 36 171 819200 1800
68214026 onipp E Jan. 4, 2020, 9:14 p.m. OK MS C++ 2017 TESTS 36 171 1024000 1800
67936643 Hazm E Dec. 29, 2019, 8:39 p.m. OK MS C++ 2017 TESTS 36 171 1843200 1800
67844802 extremum E Dec. 28, 2019, 8:57 p.m. OK MS C++ 2017 TESTS 36 171 2662400 1800
67930591 rsFalse E Dec. 29, 2019, 5:51 p.m. OK Perl TESTS 36 249 30720000 1800
67929496 rsFalse E Dec. 29, 2019, 5:19 p.m. OK Perl TESTS 36 264 30822400 1800
67849498 rsFalse E Dec. 29, 2019, 1:27 a.m. OK Perl TESTS 36 280 33177600 1800
68154475 MVP E Jan. 4, 2020, 8:23 a.m. OK PyPy 2 TESTS 36 187 11161600 1800
67823299 pajenegod E Dec. 28, 2019, 6:07 p.m. OK PyPy 2 TESTS 36 202 13824000 1800
68404535 anshuman16423 E Jan. 8, 2020, 2:24 p.m. OK PyPy 2 TESTS 36 248 17510400 1800
67841974 raj1307 E Dec. 28, 2019, 7:48 p.m. OK PyPy 2 TESTS 36 264 21606400 1800
68573774 ezboi E Jan. 11, 2020, 3:55 a.m. OK PyPy 2 TESTS 36 327 29491200 1800
67822947 c1729 E Dec. 28, 2019, 6:06 p.m. OK PyPy 2 TESTS 36 343 24166400 1800
68715769 Leendertz E Jan. 13, 2020, 2:24 p.m. OK PyPy 3 TESTS 36 249 16281600 1800
67987105 tycyd E Dec. 31, 2019, 12:06 a.m. OK PyPy 3 TESTS 36 280 16793600 1800
67876042 daimi89 E Dec. 29, 2019, 1:20 p.m. OK PyPy 3 TESTS 36 296 14336000 1800
68471863 cbx E Jan. 10, 2020, 2:27 a.m. OK PyPy 3 TESTS 36 296 14438400 1800
67839767 legion E Dec. 28, 2019, 7:17 p.m. OK PyPy 3 TESTS 36 296 16076800 1800
68125309 mdaw E Jan. 3, 2020, 2:56 p.m. OK PyPy 3 TESTS 36 296 18944000 1800
67847302 FLOP E Dec. 28, 2019, 10:37 p.m. OK PyPy 3 TESTS 36 296 22220800 1800
68555103 cbx E Jan. 10, 2020, 4:50 p.m. OK PyPy 3 TESTS 36 311 14233600 1800
67849949 MarcoReusKross E Dec. 29, 2019, 1:59 a.m. OK PyPy 3 TESTS 36 311 16486400 1800
68097328 siyy E Jan. 2, 2020, 9:56 p.m. OK PyPy 3 TESTS 36 311 16896000 1800
67973037 soumyasarkar1998 E Dec. 30, 2019, 3:45 p.m. OK Python 2 TESTS 36 498 11059200 1800
67853122 anonymous0314 E Dec. 29, 2019, 4:40 a.m. OK Python 2 TESTS 36 498 12083200 1800
68151665 shaurya950 E Jan. 4, 2020, 7:09 a.m. OK Python 2 TESTS 36 530 24268800 1800
68005424 sureshsinghspd E Dec. 31, 2019, 12:57 p.m. OK Python 3 TESTS 36 358 14643200 1800
67833289 Kagemeka E Dec. 28, 2019, 6:47 p.m. OK Python 3 TESTS 36 390 14950400 1800
69576533 Brahma_Thigathathigan E Jan. 26, 2020, 3:46 p.m. OK Python 3 TESTS 36 421 14643200 1800
67855394 Gaurav1 E Dec. 29, 2019, 5:51 a.m. OK Python 3 TESTS 36 421 22118400 1800
67862124 MajAK E Dec. 29, 2019, 8:30 a.m. OK Python 3 TESTS 36 436 14438400 1800
67841016 Parag_AP E Dec. 28, 2019, 7:33 p.m. OK Python 3 TESTS 36 436 14848000 1800
68468234 cbx E Jan. 9, 2020, 10:17 p.m. OK Python 3 TESTS 36 451 14233600 1800
67864875 III_Wolverine_III E Dec. 29, 2019, 9:22 a.m. OK Python 3 TESTS 36 451 20684800 1800
67826939 r57shell E Dec. 28, 2019, 6:21 p.m. OK Python 3 TESTS 36 452 14336000 1800
68041253 Rinatti E Jan. 1, 2020, 2:25 p.m. OK Python 3 TESTS 36 452 14643200 1800
67824442 super_hook_girl_lover E Dec. 28, 2019, 6:11 p.m. OK Ruby TESTS 36 420 28467200 1800
68110512 xavier13540 E Jan. 3, 2020, 9:20 a.m. OK Rust TESTS 36 46 3174400 1800
69227589 sansen E Jan. 21, 2020, 8:01 a.m. OK Rust TESTS 36 46 3276800 1800
68296177 folen E Jan. 6, 2020, 2:56 a.m. OK Rust TESTS 36 46 7884800 1800

remove filters

Back to search problems