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 154270499 Dec. 28, 2019, 5:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7857 ) D Christmas Trees PROGRAMMING graphs greedy shortest paths 1800

B'There are n Christmas trees on an infinite number line. The i -th tree grows at the position x_i . All x_i are guaranteed to be distinct. Each integer point can be either occupied by the Christmas tree, by the human or not occupied at all. Non-integer points cannot be occupied by anything. There are m people who want to celebrate Christmas. Let y_1, y_2, ... , y_m be the positions of people (note that all values x_1, x_2, ... , x_n, y_1, y_2, ... , y_m should be distinct and all y_j should be integer). You want to find such an arrangement of people that the value sum limits_{j=1}^{m} min limits_{i=1}^{n}|x_i - y_j| is the minimum possible (in other words, the sum of distances to the nearest Christmas tree for all people should be minimized). In other words, let d_j be the distance from the j -th human to the nearest Christmas tree ( d_j = min limits_{i=1}^{n} |y_j - x_i| ). Then you need to choose such positions y_1, y_2, ... , y_m that sum limits_{j=1}^{m} d_j is the minimum possible. The first line of the input contains two integers n and m ( 1 <= n, m <= 2 cdot 10^5 ) -- the number of Christmas trees and the number of people. The second line of the input contains n integers x_1, x_2, ... , x_n ( -10^9 <= x_i <= 10^9 ), where x_i is the position of the i -th Christmas tree. It is guaranteed that all x_i are distinct. In the first line print one integer res -- the minimum possible value of sum limits_{j=1}^{m} min limits_{i=1}^{n}|x_i - y_j| (in other words, the sum of distances to the nearest Christmas tree for all people). In the second line print m integers y_1, y_2, ... , y_m ( -2 cdot 10^9 <= y_j <= 2 cdot 10^9 ), where y_j is the position of the j -th human. All y_j should be distinct and all values x_1, x_2, ... , x_n, y_1, y_2, ... , y_m should be d'...

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
67854041 ruban D Dec. 29, 2019, 5:11 a.m. OK Delphi TESTS 46 561 141926400 1800
67988727 kaiboy D Dec. 31, 2019, 2:20 a.m. OK GNU C11 TESTS 46 764 5222400 1800
68130233 Priyanka2310 D Jan. 3, 2020, 4:45 p.m. OK GNU C11 TESTS 46 764 5222400 1800
67988457 kaiboy D Dec. 31, 2019, 1:58 a.m. OK GNU C11 TESTS 46 764 6451200 1800
68200787 mohana-256 D Jan. 4, 2020, 3:40 p.m. OK GNU C11 TESTS 46 779 5222400 1800
67988446 kaiboy D Dec. 31, 2019, 1:57 a.m. OK GNU C11 TESTS 46 779 6451200 1800
67842897 rainboy D Dec. 28, 2019, 8:08 p.m. OK GNU C11 TESTS 46 795 5222400 1800
67832674 pengin_2000 D Dec. 28, 2019, 6:44 p.m. OK GNU C11 TESTS 46 826 4812800 1800
68327216 ioana.jianu D Jan. 6, 2020, 5:19 p.m. OK GNU C++11 TESTS 46 108 4812800 1800
68435122 vjudge4 D Jan. 9, 2020, 8:39 a.m. OK GNU C++11 TESTS 46 109 2457600 1800
68486074 Sylvie233 D Jan. 10, 2020, 9:46 a.m. OK GNU C++11 TESTS 46 109 11571200 1800
67989652 351txdy D Dec. 31, 2019, 3:22 a.m. OK GNU C++11 TESTS 46 124 2457600 1800
69576586 zhuyou_y D Jan. 26, 2020, 3:47 p.m. OK GNU C++11 TESTS 46 124 5324800 1800
68139416 code_struck D Jan. 3, 2020, 8:57 p.m. OK GNU C++11 TESTS 46 124 6246400 1800
67862634 yaozhuojiang D Dec. 29, 2019, 8:40 a.m. OK GNU C++11 TESTS 46 124 9523200 1800
68664571 festivus D Jan. 12, 2020, 2:42 p.m. OK GNU C++11 TESTS 46 124 10137600 1800
69251762 ACtowards D Jan. 21, 2020, 2:29 p.m. OK GNU C++11 TESTS 46 140 4812800 1800
67828204 Mr-Roboto D Dec. 28, 2019, 6:26 p.m. OK GNU C++11 TESTS 46 140 5529600 1800
67845722 4tis D Dec. 28, 2019, 9:28 p.m. OK GNU C++14 TESTS 46 124 1638400 1800
67845278 4tis D Dec. 28, 2019, 9:13 p.m. OK GNU C++14 TESTS 46 124 1638400 1800
67845149 4tis D Dec. 28, 2019, 9:08 p.m. OK GNU C++14 TESTS 46 124 1638400 1800
67844784 4tis D Dec. 28, 2019, 8:57 p.m. OK GNU C++14 TESTS 46 124 1638400 1800
67931650 4tis D Dec. 29, 2019, 6:14 p.m. OK GNU C++14 TESTS 46 124 1638400 1800
67825382 Rituraj_81 D Dec. 28, 2019, 6:15 p.m. OK GNU C++14 TESTS 46 124 2457600 1800
69557239 Whisdangist D Jan. 26, 2020, 9:17 a.m. OK GNU C++14 TESTS 46 124 3174400 1800
67875344 OnlyLatinLetters D Dec. 29, 2019, 1:05 p.m. OK GNU C++14 TESTS 46 124 3993600 1800
67875170 zhugezy D Dec. 29, 2019, 1:01 p.m. OK GNU C++14 TESTS 46 124 4812800 1800
67864025 Binario D Dec. 29, 2019, 9:06 a.m. OK GNU C++14 TESTS 46 124 5222400 1800
67826314 Snow D Dec. 28, 2019, 6:18 p.m. OK GNU C++17 TESTS 46 109 5222400 1800
67872918 Jackylkk2003 D Dec. 29, 2019, 12:12 p.m. OK GNU C++17 TESTS 46 124 1638400 1800
68335933 Superty D Jan. 6, 2020, 9:54 p.m. OK GNU C++17 TESTS 46 124 4505600 1800
68055166 scopeInfinity D Jan. 1, 2020, 9:50 p.m. OK GNU C++17 TESTS 46 124 4812800 1800
67970461 ZeroScar D Dec. 30, 2019, 2:50 p.m. OK GNU C++17 TESTS 46 124 4812800 1800
68417744 Apprenti D Jan. 8, 2020, 7:46 p.m. OK GNU C++17 TESTS 46 124 5120000 1800
68418771 Apprenti D Jan. 8, 2020, 8:21 p.m. OK GNU C++17 TESTS 46 124 5120000 1800
68062696 pootis D Jan. 2, 2020, 5:34 a.m. OK GNU C++17 TESTS 46 124 5324800 1800
68199883 Pi_Yuan_Yuan D Jan. 4, 2020, 3:02 p.m. OK GNU C++17 TESTS 46 124 5632000 1800
67857836 Jalilvand.mJ D Dec. 29, 2019, 6:50 a.m. OK GNU C++17 TESTS 46 124 6656000 1800
68050634 Taube D Jan. 1, 2020, 6:38 p.m. OK Go TESTS 46 327 16076800 1800
68628666 collares D Jan. 12, 2020, 1:03 a.m. OK Haskell TESTS 46 1918 139776000 1800
68628606 collares D Jan. 12, 2020, 12:59 a.m. OK Haskell TESTS 46 1980 100966400 1800
68628592 collares D Jan. 12, 2020, 12:58 a.m. OK Haskell TESTS 46 1980 100966400 1800
67842896 Dukkha D Dec. 28, 2019, 8:08 p.m. OK Java 11 TESTS 46 545 0 1800
69241098 Piccadilly D Jan. 21, 2020, 11:26 a.m. OK Java 11 TESTS 46 717 63385600 1800
67848380 bleh0.5 D Dec. 28, 2019, 11:55 p.m. OK Java 11 TESTS 46 764 86425600 1800
68178365 kukreja-vlk D Jan. 4, 2020, 12:48 p.m. OK Java 11 TESTS 46 826 51916800 1800
68343991 rohithsajith D Jan. 7, 2020, 6:05 a.m. OK Java 11 TESTS 46 842 52326400 1800
69240715 Piccadilly D Jan. 21, 2020, 11:18 a.m. OK Java 11 TESTS 46 904 64409600 1800
67849507 MagentaArtist D Dec. 29, 2019, 1:27 a.m. OK Java 11 TESTS 46 951 70451200 1800
67831705 TheSawan D Dec. 28, 2019, 6:40 p.m. OK Java 11 TESTS 46 998 106598400 1800
68880609 HipHop D Jan. 15, 2020, 6:39 p.m. OK Java 11 TESTS 46 1106 104652800 1800
68095418 marwlod D Jan. 2, 2020, 8:25 p.m. OK Java 11 TESTS 46 1107 61542400 1800
67848169 di_halt D Dec. 28, 2019, 11:36 p.m. OK Java 8 TESTS 46 202 22630400 1800
67843252 z80 D Dec. 28, 2019, 8:16 p.m. OK Java 8 TESTS 46 202 22630400 1800
67842167 z80 D Dec. 28, 2019, 7:52 p.m. OK Java 8 TESTS 46 265 7475200 1800
67865299 basheer97 D Dec. 29, 2019, 9:30 a.m. OK Java 8 TESTS 46 327 37785600 1800
67823963 z80 D Dec. 28, 2019, 6:10 p.m. OK Java 8 TESTS 46 358 28672000 1800
67864555 amolpratap007 D Dec. 29, 2019, 9:16 a.m. OK Java 8 TESTS 46 373 17305600 1800
67918104 gouh9qn D Dec. 29, 2019, 4 p.m. OK Java 8 TESTS 46 389 33280000 1800
68070548 anathema D Jan. 2, 2020, 10:04 a.m. OK Java 8 TESTS 46 420 30310400 1800
67865194 basheer97 D Dec. 29, 2019, 9:28 a.m. OK Java 8 TESTS 46 420 37580800 1800
69427115 iamyashh D Jan. 23, 2020, 4:09 p.m. OK Java 8 TESTS 46 436 29286400 1800
67947710 Spheniscine D Dec. 30, 2019, 6:14 a.m. OK Kotlin TESTS 46 623 55398400 1800
67947455 Spheniscine D Dec. 30, 2019, 6:06 a.m. OK Kotlin TESTS 46 639 55398400 1800
67841062 Glushen D Dec. 28, 2019, 7:33 p.m. OK Kotlin TESTS 46 685 26419200 1800
67948029 Spheniscine D Dec. 30, 2019, 6:23 a.m. OK Kotlin TESTS 46 733 77721600 1800
67946841 Spheniscine D Dec. 30, 2019, 5:47 a.m. OK Kotlin TESTS 46 779 55296000 1800
67947922 Spheniscine D Dec. 30, 2019, 6:20 a.m. OK Kotlin TESTS 46 779 77721600 1800
67947994 Spheniscine D Dec. 30, 2019, 6:22 a.m. OK Kotlin TESTS 46 872 77619200 1800
67832629 cmplx-xyttmt D Dec. 28, 2019, 6:44 p.m. OK Kotlin TESTS 46 1201 88166400 1800
67811368 Kenb D Dec. 28, 2019, 5:29 p.m. OK Kotlin TESTS 46 1918 72704000 1800
67818339 riantkb D Dec. 28, 2019, 5:50 p.m. OK Mono C# TESTS 46 249 40243200 1800
69283938 mban259 D Jan. 22, 2020, 7:17 a.m. OK Mono C# TESTS 46 265 48435200 1800
69423096 sakapon D Jan. 23, 2020, 2:59 p.m. OK Mono C# TESTS 46 280 52736000 1800
67823115 hibatibati D Dec. 28, 2019, 6:07 p.m. OK Mono C# TESTS 46 327 65638400 1800
69498443 sakapon D Jan. 25, 2020, 5:30 a.m. OK Mono C# TESTS 46 343 64409600 1800
69497711 sakapon D Jan. 25, 2020, 5:06 a.m. OK Mono C# TESTS 46 374 62054400 1800
67821210 IlyaCk D Dec. 28, 2019, 6 p.m. OK Mono C# TESTS 46 389 59289600 1800
67812512 keymoon D Dec. 28, 2019, 5:33 p.m. OK Mono C# TESTS 46 732 64204800 1800
68890404 vjudge1 D Jan. 16, 2020, 1:52 a.m. OK MS C++ TESTS 46 109 5222400 1800
68707757 kwfumou1242 D Jan. 13, 2020, 11:56 a.m. OK MS C++ TESTS 46 327 8192000 1800
68308133 vjudge1 D Jan. 6, 2020, 9:55 a.m. OK MS C++ TESTS 46 499 22528000 1800
68297113 vjudge3 D Jan. 6, 2020, 3:48 a.m. OK MS C++ TESTS 46 545 28569600 1800
68671634 vjudge2 D Jan. 12, 2020, 5:03 p.m. OK MS C++ TESTS 46 670 27955200 1800
68471868 vjudge3 D Jan. 10, 2020, 2:28 a.m. OK MS C++ TESTS 46 685 18329600 1800
67826912 youx D Dec. 28, 2019, 6:21 p.m. OK MS C++ 2017 TESTS 46 217 18944000 1800
67811811 pichulia D Dec. 28, 2019, 5:31 p.m. OK MS C++ 2017 TESTS 46 280 31539200 1800
67845653 extremum D Dec. 28, 2019, 9:26 p.m. OK MS C++ 2017 TESTS 46 358 5017600 1800
67830883 novink D Dec. 28, 2019, 6:37 p.m. OK MS C++ 2017 TESTS 46 374 7884800 1800
67823172 CrashMaster D Dec. 28, 2019, 6:07 p.m. OK MS C++ 2017 TESTS 46 405 9728000 1800
67843754 tahtarovserver D Dec. 28, 2019, 8:28 p.m. OK MS C++ 2017 TESTS 46 405 13107200 1800
67838134 TeaTime D Dec. 28, 2019, 7:04 p.m. OK MS C++ 2017 TESTS 46 421 13004800 1800
68377351 omerb.zeybek D Jan. 7, 2020, 8:49 p.m. OK MS C++ 2017 TESTS 46 467 16076800 1800
67829841 Hapsidra D Dec. 28, 2019, 6:32 p.m. OK MS C++ 2017 TESTS 46 498 19763200 1800
68102208 ddh D Jan. 3, 2020, 4:19 a.m. OK MS C++ 2017 TESTS 46 514 17100800 1800
67939127 evgeny.poloznov D Dec. 29, 2019, 10:36 p.m. OK PHP TESTS 46 202 121446400 1800
68153801 MVP D Jan. 4, 2020, 8:04 a.m. OK PyPy 2 TESTS 46 265 16486400 1800
67818215 pajenegod D Dec. 28, 2019, 5:50 p.m. OK PyPy 2 TESTS 46 358 43110400 1800
68572509 ezboi D Jan. 11, 2020, 3:10 a.m. OK PyPy 2 TESTS 46 390 35942400 1800
67833082 c1729 D Dec. 28, 2019, 6:46 p.m. OK PyPy 2 TESTS 46 1294 26316800 1800
68391273 shanu_im D Jan. 8, 2020, 8:45 a.m. OK PyPy 2 TESTS 46 1762 63488000 1800
68051359 weifgweuifvhewi D Jan. 1, 2020, 7:02 p.m. OK PyPy 3 TESTS 46 529 26931200 1800
67946116 Cloverr_ D Dec. 30, 2019, 5:22 a.m. OK PyPy 3 TESTS 46 607 44134400 1800
67946216 Cloverr_ D Dec. 30, 2019, 5:26 a.m. OK PyPy 3 TESTS 46 608 44339200 1800
67866359 connorjayr D Dec. 29, 2019, 9:49 a.m. OK PyPy 3 TESTS 46 608 48230400 1800
67865241 Mohamed_Ayman D Dec. 29, 2019, 9:29 a.m. OK PyPy 3 TESTS 46 623 41267200 1800
67863678 Mohamed_Ayman D Dec. 29, 2019, 9 a.m. OK PyPy 3 TESTS 46 624 41676800 1800
69479201 aberent D Jan. 24, 2020, 5:10 p.m. OK PyPy 3 TESTS 46 624 48025600 1800
68062932 codershuvo D Jan. 2, 2020, 5:45 a.m. OK PyPy 3 TESTS 46 639 29388800 1800
68063126 siyy D Jan. 2, 2020, 5:55 a.m. OK PyPy 3 TESTS 46 639 31948800 1800
67820689 3x7 D Dec. 28, 2019, 5:58 p.m. OK PyPy 3 TESTS 46 639 39116800 1800
67853881 anonymous0314 D Dec. 29, 2019, 5:06 a.m. OK Python 2 TESTS 46 810 33075200 1800
67841521 ChaosL D Dec. 28, 2019, 7:40 p.m. OK Python 2 TESTS 46 1668 31129600 1800
67831709 grayGoose D Dec. 28, 2019, 6:40 p.m. OK Python 2 TESTS 46 1980 72089600 1800
67951873 Cloverr_ D Dec. 30, 2019, 8:01 a.m. OK Python 3 TESTS 46 545 37990400 1800
67824551 r57shell D Dec. 28, 2019, 6:12 p.m. OK Python 3 TESTS 46 654 37580800 1800
68318048 mike.shvets D Jan. 6, 2020, 1:55 p.m. OK Python 3 TESTS 46 670 36044800 1800
68007104 Firsov62121 D Dec. 31, 2019, 1:45 p.m. OK Python 3 TESTS 46 717 26009600 1800
69088131 Brescanu D Jan. 19, 2020, 9:07 a.m. OK Python 3 TESTS 46 826 58572800 1800
67826089 hemanth_ram D Dec. 28, 2019, 6:18 p.m. OK Python 3 TESTS 46 873 39833600 1800
67895383 432073 D Dec. 29, 2019, 2:34 p.m. OK Python 3 TESTS 46 982 33996800 1800
67892431 432073 D Dec. 29, 2019, 2:28 p.m. OK Python 3 TESTS 46 982 33996800 1800
68308689 iffndef D Jan. 6, 2020, 10:10 a.m. OK Python 3 TESTS 46 982 40038400 1800
68037139 parvez018 D Jan. 1, 2020, 12:37 p.m. OK Python 3 TESTS 46 982 52838400 1800
67846666 old_boo D Dec. 28, 2019, 10:05 p.m. OK Ruby TESTS 46 436 38604800 1800
67817865 super_hook_girl_lover D Dec. 28, 2019, 5:49 p.m. OK Ruby TESTS 46 763 73830400 1800
68109503 xavier13540 D Jan. 3, 2020, 8:54 a.m. OK Rust TESTS 46 202 18432000 1800
69227380 sansen D Jan. 21, 2020, 7:54 a.m. OK Rust TESTS 46 374 30105600 1800

remove filters

Back to search problems