Codeforces Round 671 (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
1419 Codeforces Round 671 (Div. 2) FINISHED False 7200 136653863 Sept. 19, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 24851 ) D1 Sage's Birthday (easy version) PROGRAMMING binary search greedy implementation sortings

B"This is the easy version of the problem. The difference between the versions is that in the easy version all prices a_i are different. You can make hacks if and only if you solved both versions of the problem. Today is Sage's birthday, and she will go shopping to buy ice spheres. All n ice spheres are placed in a row and they are numbered from 1 to n from left to right. Each ice sphere has a positive integer price. In this version all prices are different. An ice sphere is cheap if it costs strictly less than two neighboring ice spheres: the nearest to the left and the nearest to the right. The leftmost and the rightmost ice spheres are not cheap. Sage will choose all cheap ice spheres and then buy only them. You can visit the shop before Sage and reorder the ice spheres as you wish. Find out the maximum number of ice spheres that Sage can buy, and show how the ice spheres should be reordered. The first line contains a single integer n (1 <= n <= 10^5) -- the number of ice spheres in the shop. The second line contains n different integers a_1, a_2, ... , a_n (1 <= a_i <= 10^9) -- the prices of ice spheres. In the first line print the maximum number of ice spheres that Sage can buy. In the second line print the prices of ice spheres in the optimal order. If there are several correct answers, you can print any of them. In the example it's not possible to place ice spheres in any order so that Sage would buy 3 of them. If the ice spheres are placed like this (3, 1, 4, 2, 5) , then Sage will buy two spheres: one for 1 and one for 2 , because they are cheap. "...

Tutorials

Codeforces Round #671 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
93294402 dbdxzwh D1 Sept. 20, 2020, 2:20 a.m. OK Clang++17 Diagnostics TESTS 65 967 819200
93293106 ndocx D1 Sept. 20, 2020, 1:41 a.m. OK FPC TESTS 65 202 409600
93267101 kakayoshi D1 Sept. 19, 2020, 4:32 p.m. OK FPC TESTS 65 233 819200
93266077 PAG D1 Sept. 19, 2020, 4:30 p.m. OK FPC TESTS 65 343 1638400
93286121 babaiserror D1 Sept. 19, 2020, 9:20 p.m. OK GNU C11 TESTS 65 405 819200
93272373 ashishsah255 D1 Sept. 19, 2020, 6:27 p.m. OK GNU C11 TESTS 65 468 409600
93278001 aryanpandeya D1 Sept. 19, 2020, 7:06 p.m. OK GNU C11 TESTS 65 468 1638400
93295981 QwQcOrZ D1 Sept. 20, 2020, 3:02 a.m. OK GNU C++11 TESTS 65 46 819200
93297841 lzzAKIOI D1 Sept. 20, 2020, 3:45 a.m. OK GNU C++11 TESTS 65 46 1024000
93297462 AyoAyowei D1 Sept. 20, 2020, 3:39 a.m. OK GNU C++11 TESTS 65 46 1843200
93290146 pocafup D1 Sept. 19, 2020, 11:36 p.m. OK GNU C++11 TESTS 65 61 819200
93298806 qrzbing D1 Sept. 20, 2020, 4:05 a.m. OK GNU C++11 TESTS 65 62 409600
93295666 SSerxhs D1 Sept. 20, 2020, 2:53 a.m. OK GNU C++11 TESTS 65 62 409600
93291124 pzc2004 D1 Sept. 20, 2020, 12:23 a.m. OK GNU C++11 TESTS 65 62 819200
93291214 onglu1 D1 Sept. 20, 2020, 12:26 a.m. OK GNU C++11 TESTS 65 62 819200
93292677 feifeiko D1 Sept. 20, 2020, 1:28 a.m. OK GNU C++11 TESTS 65 62 819200
93296037 cghtxdy D1 Sept. 20, 2020, 3:04 a.m. OK GNU C++11 TESTS 65 62 819200
93264905 Easyyy D1 Sept. 19, 2020, 4:28 p.m. OK GNU C++14 TESTS 65 77 409600
93279131 ProAbdo D1 Sept. 19, 2020, 7:19 p.m. OK GNU C++14 TESTS 65 77 409600
93273367 ashutoshd2001 D1 Sept. 19, 2020, 6:31 p.m. OK GNU C++14 TESTS 65 77 409600
93274503 himanshu7524 D1 Sept. 19, 2020, 6:37 p.m. OK GNU C++14 TESTS 65 77 819200
93273355 Tman D1 Sept. 19, 2020, 6:31 p.m. OK GNU C++14 TESTS 65 77 819200
93299490 vjudge4 D1 Sept. 20, 2020, 4:18 a.m. OK GNU C++14 TESTS 65 77 819200
93265707 a1157996973 D1 Sept. 19, 2020, 4:29 p.m. OK GNU C++14 TESTS 65 77 819200
93297120 __007 D1 Sept. 20, 2020, 3:31 a.m. OK GNU C++14 TESTS 65 77 819200
93276894 Vedanshu D1 Sept. 19, 2020, 6:55 p.m. OK GNU C++14 TESTS 65 77 819200
93274831 lemondeath D1 Sept. 19, 2020, 6:39 p.m. OK GNU C++14 TESTS 65 77 1126400
93294780 kurtisy D1 Sept. 20, 2020, 2:30 a.m. OK GNU C++17 TESTS 65 77 409600
93295568 gunjan768 D1 Sept. 20, 2020, 2:51 a.m. OK GNU C++17 TESTS 65 77 409600
93288054 Gabo_03 D1 Sept. 19, 2020, 10:09 p.m. OK GNU C++17 TESTS 65 77 409600
93286972 white_horseman D1 Sept. 19, 2020, 9:41 p.m. OK GNU C++17 TESTS 65 77 409600
93277098 drst_4912 D1 Sept. 19, 2020, 6:58 p.m. OK GNU C++17 TESTS 65 77 409600
93275805 chawlajay111 D1 Sept. 19, 2020, 6:46 p.m. OK GNU C++17 TESTS 65 77 409600
93265423 harry787 D1 Sept. 19, 2020, 4:29 p.m. OK GNU C++17 TESTS 65 77 409600
93302395 shamim7999 D1 Sept. 20, 2020, 5:14 a.m. OK GNU C++17 TESTS 65 77 614400
93297614 son.goku.0337 D1 Sept. 20, 2020, 3:41 a.m. OK GNU C++17 TESTS 65 77 819200
93302867 Ajay_balaji D1 Sept. 20, 2020, 5:23 a.m. OK GNU C++17 TESTS 65 77 819200
93281058 smigwump D1 Sept. 19, 2020, 7:44 p.m. OK GNU C++17 (64) TESTS 65 62 409600
93297535 smigwump D1 Sept. 20, 2020, 3:40 a.m. OK GNU C++17 (64) TESTS 65 62 409600
93277511 jaeger177012 D1 Sept. 19, 2020, 7:02 p.m. OK GNU C++17 (64) TESTS 65 62 409600
93278513 Ari D1 Sept. 19, 2020, 7:12 p.m. OK GNU C++17 (64) TESTS 65 62 819200
93283028 3RB D1 Sept. 19, 2020, 8:15 p.m. OK GNU C++17 (64) TESTS 65 62 819200
93296820 Anachor D1 Sept. 20, 2020, 3:24 a.m. OK GNU C++17 (64) TESTS 65 62 819200
93296754 Theofratus D1 Sept. 20, 2020, 3:22 a.m. OK GNU C++17 (64) TESTS 65 62 819200
93293651 heyuhhh D1 Sept. 20, 2020, 1:58 a.m. OK GNU C++17 (64) TESTS 65 62 819200
93290031 BeAsTmAsTeR D1 Sept. 19, 2020, 11:32 p.m. OK GNU C++17 (64) TESTS 65 62 819200
93284407 Anvy26 D1 Sept. 19, 2020, 8:42 p.m. OK GNU C++17 (64) TESTS 65 62 819200
93286064 clyring D1 Sept. 19, 2020, 9:19 p.m. OK Haskell TESTS 65 483 26316800
93287866 singhdhanwant D1 Sept. 19, 2020, 10:04 p.m. OK Java 11 TESTS 65 265 0
93265525 Apass.Jack D1 Sept. 19, 2020, 4:29 p.m. OK Java 11 TESTS 65 280 0
93274887 brijeshujcbm D1 Sept. 19, 2020, 6:40 p.m. OK Java 11 TESTS 65 312 0
93266372 vishrut_goti6231 D1 Sept. 19, 2020, 4:30 p.m. OK Java 11 TESTS 65 561 0
93286018 aCitizen D1 Sept. 19, 2020, 9:18 p.m. OK Java 11 TESTS 65 577 0
93283340 nikhilmishra1211 D1 Sept. 19, 2020, 8:21 p.m. OK Java 11 TESTS 65 577 0
93266573 betichodi_madarchodi D1 Sept. 19, 2020, 4:31 p.m. OK Java 11 TESTS 65 592 409600
93302505 infinity_code D1 Sept. 20, 2020, 5:16 a.m. OK Java 11 TESTS 65 608 0
93264838 mezmik D1 Sept. 19, 2020, 4:27 p.m. OK Java 11 TESTS 65 639 0
93282923 kabirkanha D1 Sept. 19, 2020, 8:13 p.m. OK Java 11 TESTS 65 716 0
93299767 Pranay2516 D1 Sept. 20, 2020, 4:24 a.m. OK Java 8 TESTS 65 155 0
93295501 kamal_20 D1 Sept. 20, 2020, 2:49 a.m. OK Java 8 TESTS 65 155 0
93279675 nandit D1 Sept. 19, 2020, 7:25 p.m. OK Java 8 TESTS 65 155 0
93277920 MubtasimShahriar D1 Sept. 19, 2020, 7:06 p.m. OK Java 8 TESTS 65 156 0
93283446 kadintang1 D1 Sept. 19, 2020, 8:23 p.m. OK Java 8 TESTS 65 171 0
93304781 ritvik369 D1 Sept. 20, 2020, 5:52 a.m. OK Java 8 TESTS 65 171 0
93282555 soumyab D1 Sept. 19, 2020, 8:07 p.m. OK Java 8 TESTS 65 171 0
93278845 kbadrinath D1 Sept. 19, 2020, 7:16 p.m. OK Java 8 TESTS 65 171 0
93267776 niteshnanda D1 Sept. 19, 2020, 4:33 p.m. OK Java 8 TESTS 65 171 0
93264788 OnFireVivek D1 Sept. 19, 2020, 4:27 p.m. OK Java 8 TESTS 65 187 0
93301454 Spheniscine D1 Sept. 20, 2020, 4:58 a.m. OK Kotlin TESTS 65 202 1638400
93266500 ravinem1 D1 Sept. 19, 2020, 4:31 p.m. OK Mono C# TESTS 65 202 28364800
93275643 Sasha1 D1 Sept. 19, 2020, 6:45 p.m. OK Mono C# TESTS 65 733 18329600
93293302 Educated_GUCCI D1 Sept. 20, 2020, 1:47 a.m. OK MS C++ 2017 TESTS 65 93 409600
93280307 transcending D1 Sept. 19, 2020, 7:33 p.m. OK MS C++ 2017 TESTS 65 171 409600
93279239 transcending D1 Sept. 19, 2020, 7:20 p.m. OK MS C++ 2017 TESTS 65 187 409600
93282947 shacastic D1 Sept. 19, 2020, 8:14 p.m. OK MS C++ 2017 TESTS 65 187 819200
93284360 Awa149 D1 Sept. 19, 2020, 8:41 p.m. OK MS C++ 2017 TESTS 65 202 1331200
93275973 explorer_sifat D1 Sept. 19, 2020, 6:48 p.m. OK Node.js TESTS 65 186 20070400
93272845 hajab D1 Sept. 19, 2020, 6:29 p.m. OK PyPy 2 TESTS 65 171 11571200
93286692 chaudhary_19 D1 Sept. 19, 2020, 9:34 p.m. OK PyPy 2 TESTS 65 186 13004800
93280760 manish.17 D1 Sept. 19, 2020, 7:39 p.m. OK PyPy 3 TESTS 65 202 12185600
93304430 Anuranjan_Pandey D1 Sept. 20, 2020, 5:47 a.m. OK PyPy 3 TESTS 65 218 12288000
93276433 kaleabasfaw2010 D1 Sept. 19, 2020, 6:51 p.m. OK PyPy 3 TESTS 65 265 9830400
93279436 shadoX D1 Sept. 19, 2020, 7:23 p.m. OK PyPy 3 TESTS 65 280 12390400
93303641 poltergeist_80 D1 Sept. 20, 2020, 5:36 a.m. OK PyPy 3 TESTS 65 342 12390400
93276415 chill_house D1 Sept. 19, 2020, 6:51 p.m. OK PyPy 3 TESTS 65 343 12083200
93278029 superb_shreyas D1 Sept. 19, 2020, 7:07 p.m. OK PyPy 3 TESTS 65 343 12800000
93304350 vishwas_007 D1 Sept. 20, 2020, 5:46 a.m. OK PyPy 3 TESTS 65 343 12902400
93296874 subha0501 D1 Sept. 20, 2020, 3:25 a.m. OK PyPy 3 TESTS 65 343 13209600
93279668 rishabhsingh054 D1 Sept. 19, 2020, 7:25 p.m. OK PyPy 3 TESTS 65 343 13312000
93279241 ComptineDunAutreEte D1 Sept. 19, 2020, 7:20 p.m. OK Python 2 TESTS 65 327 5734400
93266635 8893163535SonNH D1 Sept. 19, 2020, 4:31 p.m. OK Python 3 TESTS 65 234 11468800
93283129 carrymartes D1 Sept. 19, 2020, 8:17 p.m. OK Python 3 TESTS 65 280 11878400
93291827 ixuan D1 Sept. 20, 2020, 12:54 a.m. OK Python 3 TESTS 65 311 8499200
93266105 CostumeParty D1 Sept. 19, 2020, 4:30 p.m. OK Python 3 TESTS 65 312 9830400
93296430 _DON_ D1 Sept. 20, 2020, 3:14 a.m. OK Python 3 TESTS 65 326 8499200
93291604 deadguy D1 Sept. 20, 2020, 12:45 a.m. OK Python 3 TESTS 65 326 8499200
93298997 adi112100 D1 Sept. 20, 2020, 4:09 a.m. OK Python 3 TESTS 65 327 8499200
93288174 GTrigger D1 Sept. 19, 2020, 10:13 p.m. OK Python 3 TESTS 65 327 8499200
93288146 GTrigger D1 Sept. 19, 2020, 10:12 p.m. OK Python 3 TESTS 65 327 8499200
93279687 swagsy2000 D1 Sept. 19, 2020, 7:25 p.m. OK Python 3 TESTS 65 327 8499200
93268107 bor.is D1 Sept. 19, 2020, 4:33 p.m. OK Rust TESTS 65 108 5017600

remove filters

Back to search problems