Codeforces Round 497 (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
1007 Codeforces Round 497 (Div. 1) FINISHED False 7800 206033124 July 13, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12256 ) A Reorder the Array PROGRAMMING combinatorics data structures math sortings two pointers 1300

B"You are given an array of integers. Vasya can permute (change order) its integers. He wants to do it so that as many as possible integers will become on a place where a smaller integer used to stand. Help Vasya find the maximal number of such integers. For instance, if we are given an array [10, 20, 30, 40] , we can permute it so that it becomes [20, 40, 10, 30] . Then on the first and the second positions the integers became larger ( 20>10 , 40>20 ) and did not on the third and the fourth, so for this permutation, the number that Vasya wants to maximize equals 2 . Read the note for the first example, there is one more demonstrative test case. Help Vasya to permute integers in such way that the number of positions in a new array, where integers are greater than in the original one, is maximal. The first line contains a single integer n ( 1 <= q n <= q 10^5 ) -- the length of the array. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 10^9 ) -- the elements of the array. Print a single integer -- the maximal number of the array's elements which after a permutation will stand on the position where a smaller element stood in the initial array. In the first sample, one of the best permutations is [1, 5, 5, 3, 10, 1, 1] . On the positions from second to fifth the elements became larger, so the answer for this permutation is 4. In the second sample, there is no way to increase any element with a permutation, so the answer is 0. "...

Tutorials

Editorial for Codeforces Round #497 by Skyglow

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
40367430 LanceDai A July 15, 2018, 6:37 a.m. OK Clang++17 Diagnostics TESTS 33 639 6860800 1300
40367783 LanceDai A July 15, 2018, 6:46 a.m. OK Clang++17 Diagnostics TESTS 33 920 819200 1300
40268835 avm A July 13, 2018, 2:46 p.m. OK D TESTS 33 109 11878400 1300
40721851 __ShaW A July 25, 2018, 1:50 a.m. OK FPC TESTS 33 46 409600 1300
49501948 PhuongPeu A Feb. 5, 2019, 3:38 p.m. OK FPC TESTS 33 61 921600 1300
40309712 LTL_td A July 14, 2018, 7:29 a.m. OK GNU C++ TESTS 33 31 204800 1300
41239459 Scut82 A Aug. 5, 2018, 9:14 a.m. OK GNU C++ TESTS 33 31 409600 1300
41235426 Scut82 A Aug. 5, 2018, 6:56 a.m. OK GNU C++ TESTS 33 31 409600 1300
40544718 cqbz163003gzm A July 19, 2018, 10:57 a.m. OK GNU C++ TESTS 33 31 409600 1300
40544102 Hineven A July 19, 2018, 10:35 a.m. OK GNU C++ TESTS 33 31 409600 1300
40458570 lxqiaoyx A July 17, 2018, 2:21 a.m. OK GNU C++ TESTS 33 31 409600 1300
40369437 ZCDHJ A July 15, 2018, 7:29 a.m. OK GNU C++ TESTS 33 31 409600 1300
40269200 thx-2 A July 13, 2018, 2:47 p.m. OK GNU C++ TESTS 33 31 409600 1300
40266146 HugeGun A July 13, 2018, 2:42 p.m. OK GNU C++ TESTS 33 31 409600 1300
41589156 hangyesheng A Aug. 14, 2018, 1:08 p.m. OK GNU C++ TESTS 33 31 409600 1300
46686036 NoSoul A Dec. 6, 2018, 2:03 p.m. OK GNU C11 TESTS 33 46 512000 1300
67651855 romarioputra A Dec. 26, 2019, 12:26 p.m. OK GNU C11 TESTS 33 46 819200 1300
43019227 kiennd9 A Sept. 18, 2018, 2:56 a.m. OK GNU C11 TESTS 33 46 1638400 1300
42765130 a01329173 A Sept. 11, 2018, 12:51 p.m. OK GNU C11 TESTS 33 62 716800 1300
50276022 abanerjee A Feb. 21, 2019, 10:03 a.m. OK GNU C11 TESTS 33 62 1638400 1300
61027892 MicroXie A Sept. 21, 2019, 4:37 p.m. OK GNU C11 TESTS 33 62 3993600 1300
61027904 vjudge3 A Sept. 21, 2019, 4:37 p.m. OK GNU C11 TESTS 33 62 3993600 1300
40266038 __math A July 13, 2018, 2:41 p.m. OK GNU C++11 TESTS 33 31 409600 1300
47183164 luogu_bot2 A Dec. 18, 2018, 12:07 a.m. OK GNU C++11 TESTS 33 31 409600 1300
40265571 Always A July 13, 2018, 2:40 p.m. OK GNU C++11 TESTS 33 31 409600 1300
47183156 Althen A Dec. 18, 2018, 12:06 a.m. OK GNU C++11 TESTS 33 31 409600 1300
47183140 fwat A Dec. 18, 2018, 12:05 a.m. OK GNU C++11 TESTS 33 31 409600 1300
40968097 jyz1232012 A July 30, 2018, noon OK GNU C++11 TESTS 33 31 409600 1300
40305786 vjudge2 A July 14, 2018, 5:40 a.m. OK GNU C++11 TESTS 33 31 409600 1300
40300632 functionendless A July 14, 2018, 1:41 a.m. OK GNU C++11 TESTS 33 31 409600 1300
40299258 Fuko_Ibuki A July 14, 2018, 12:21 a.m. OK GNU C++11 TESTS 33 31 409600 1300
42135906 RNS_MHB A Aug. 26, 2018, 11:49 p.m. OK GNU C++11 TESTS 33 31 512000 1300
41942299 vitya7 A Aug. 21, 2018, 4:15 p.m. OK GNU C++14 TESTS 33 46 409600 1300
69507017 menna_tallah A Jan. 25, 2020, 9:03 a.m. OK GNU C++14 TESTS 33 46 409600 1300
66363990 khushi1806 A Dec. 5, 2019, 6:44 p.m. OK GNU C++14 TESTS 33 46 409600 1300
52075580 Piglet1607 A March 31, 2019, 9:50 a.m. OK GNU C++14 TESTS 33 46 409600 1300
51392661 AMnu A March 17, 2019, 1:20 a.m. OK GNU C++14 TESTS 33 46 409600 1300
48082033 blackstone1 A Jan. 8, 2019, 8:34 a.m. OK GNU C++14 TESTS 33 46 409600 1300
47837040 shb123 A Jan. 2, 2019, 10:24 a.m. OK GNU C++14 TESTS 33 46 409600 1300
41669220 werr12345 A Aug. 17, 2018, 3:14 a.m. OK GNU C++14 TESTS 33 46 409600 1300
41649951 _-- A Aug. 16, 2018, 11:13 a.m. OK GNU C++14 TESTS 33 46 409600 1300
41262578 Randooom A Aug. 6, 2018, 4:18 a.m. OK GNU C++14 TESTS 33 46 409600 1300
54268417 DEVV5 A May 17, 2019, 7:24 a.m. OK GNU C++17 TESTS 33 46 409600 1300
53281894 vjudge5 A April 25, 2019, 12:20 p.m. OK GNU C++17 TESTS 33 46 409600 1300
52060428 Char_Coder A March 31, 2019, 12:07 a.m. OK GNU C++17 TESTS 33 46 409600 1300
54513118 Songtak A May 23, 2019, 8:15 a.m. OK GNU C++17 TESTS 33 46 409600 1300
56645465 snrahul A July 7, 2019, 6:10 a.m. OK GNU C++17 TESTS 33 46 409600 1300
60847360 int64_t A Sept. 19, 2019, 12:58 p.m. OK GNU C++17 TESTS 33 46 409600 1300
63127669 emoseW A Oct. 22, 2019, 1:17 p.m. OK GNU C++17 TESTS 33 46 409600 1300
63652560 vilcheuski A Oct. 28, 2019, 11:49 a.m. OK GNU C++17 TESTS 33 46 409600 1300
64705892 staniewzki A Nov. 11, 2019, 4:30 p.m. OK GNU C++17 TESTS 33 46 409600 1300
65335196 vjudge2 A Nov. 19, 2019, 8:37 a.m. OK GNU C++17 TESTS 33 46 409600 1300
60280170 kaloosh A Sept. 8, 2019, 8:15 p.m. OK Java 8 TESTS 33 124 0 1300
52681381 cribabby A April 13, 2019, 12:35 p.m. OK Java 8 TESTS 33 124 0 1300
51050052 tsumit023 A March 8, 2019, 8:32 p.m. OK Java 8 TESTS 33 124 0 1300
63078336 c0def0rcer A Oct. 21, 2019, 2:21 p.m. OK Java 8 TESTS 33 139 0 1300
59225617 garnacha A Aug. 21, 2019, 1:40 p.m. OK Java 8 TESTS 33 139 0 1300
40296660 pj21 A July 13, 2018, 8:45 p.m. OK Java 8 TESTS 33 139 0 1300
60769542 rgupta917 A Sept. 18, 2019, 12:12 p.m. OK Java 8 TESTS 33 140 0 1300
51471526 boltUsain A March 19, 2019, 6:49 a.m. OK Java 8 TESTS 33 140 0 1300
46573499 omelette A Dec. 4, 2018, 7:21 a.m. OK Java 8 TESTS 33 140 0 1300
40266780 tanzaku A July 13, 2018, 2:43 p.m. OK Java 8 TESTS 33 140 0 1300
40294011 gabe A July 13, 2018, 7:08 p.m. OK JavaScript TESTS 33 93 11161600 1300
42556530 Spark_code A Sept. 6, 2018, 2:26 p.m. OK JavaScript TESTS 33 155 17305600 1300
40853378 user32 A July 27, 2018, 3:51 p.m. OK Kotlin TESTS 33 373 9216000 1300
57699945 hatsuyuki15 A July 24, 2019, 5:33 p.m. OK Kotlin TESTS 33 436 13619200 1300
54761195 og.kostya A May 28, 2019, 3:53 p.m. OK Mono C# TESTS 33 62 409600 1300
40574066 Adiletkhan A July 20, 2018, 10:05 a.m. OK Mono C# TESTS 33 92 10444800 1300
40277557 jyk A July 13, 2018, 3:11 p.m. OK Mono C# TESTS 33 93 11161600 1300
40290155 kuuso A July 13, 2018, 4:29 p.m. OK Mono C# TESTS 33 93 11980800 1300
44231480 nemars A Oct. 13, 2018, 12:39 a.m. OK Mono C# TESTS 33 93 15974400 1300
40293771 lxn A July 13, 2018, 6:50 p.m. OK MS C++ TESTS 33 31 1024000 1300
44951642 vjudge5 A Oct. 27, 2018, 12:23 p.m. OK MS C++ TESTS 33 31 15052800 1300
40506699 vjudge3 A July 18, 2018, 8:50 a.m. OK MS C++ TESTS 33 46 409600 1300
40364457 vjudge2 A July 15, 2018, 4:33 a.m. OK MS C++ TESTS 33 46 409600 1300
40264677 waltz A July 13, 2018, 2:38 p.m. OK MS C++ TESTS 33 46 409600 1300
67067033 vjudge4 A Dec. 17, 2019, 11:29 a.m. OK MS C++ TESTS 33 46 409600 1300
47867336 vjudge3 A Jan. 3, 2019, 10:38 a.m. OK MS C++ TESTS 33 46 409600 1300
45432525 scorpiowf A Nov. 8, 2018, 5:25 a.m. OK MS C++ TESTS 33 46 409600 1300
41455442 vjudge2 A Aug. 11, 2018, 6:12 a.m. OK MS C++ TESTS 33 46 409600 1300
40508320 vjudge5 A July 18, 2018, 9:38 a.m. OK MS C++ TESTS 33 46 409600 1300
53840579 yp0413170331 A May 7, 2019, 7:13 a.m. OK MS C++ 2017 TESTS 33 46 1228800 1300
67070108 vjudge2 A Dec. 17, 2019, 12:28 p.m. OK MS C++ 2017 TESTS 33 61 819200 1300
67067262 vjudge3 A Dec. 17, 2019, 11:33 a.m. OK MS C++ 2017 TESTS 33 62 1228800 1300
56430065 darkus-_- A July 2, 2019, 11:39 a.m. OK MS C++ 2017 TESTS 33 109 1228800 1300
68719818 0Mordecai0 A Jan. 13, 2020, 3:49 p.m. OK MS C++ 2017 TESTS 33 109 2150400 1300
65319670 MikeShLN A Nov. 18, 2019, 7 p.m. OK MS C++ 2017 TESTS 33 124 409600 1300
59476490 CtrlAlt A Aug. 25, 2019, 4:01 p.m. OK MS C++ 2017 TESTS 33 124 409600 1300
68884016 arduinoprog A Jan. 15, 2020, 8:10 p.m. OK MS C++ 2017 TESTS 33 124 716800 1300
56850127 Natali1 A July 11, 2019, 3:20 p.m. OK MS C++ 2017 TESTS 33 124 819200 1300
56880877 Dragostan A July 12, 2019, 10:23 a.m. OK MS C++ 2017 TESTS 33 124 819200 1300
40334484 Pashechka A July 14, 2018, 3:24 p.m. OK PascalABC.NET TESTS 33 124 15667200 1300
40296304 mayakin A July 13, 2018, 8:26 p.m. OK PHP TESTS 33 186 7987200 1300
40725765 JennyChen A July 25, 2018, 4:47 a.m. OK PHP TESTS 33 233 26828800 1300
44767848 test616.cpp A Oct. 24, 2018, 10:57 a.m. OK PyPy 2 TESTS 33 140 11264000 1300
40297404 sasasagagaga A July 13, 2018, 9:38 p.m. OK PyPy 2 TESTS 33 264 11980800 1300
55706471 tchr A June 18, 2019, 7:49 a.m. OK PyPy 3 TESTS 33 218 11468800 1300
55706597 tchr A June 18, 2019, 7:53 a.m. OK PyPy 3 TESTS 33 218 11571200 1300
46401721 omarnvidia A Nov. 30, 2018, 12:35 p.m. OK PyPy 3 TESTS 33 218 11571200 1300
47308544 nthoang A Dec. 20, 2018, 6:15 p.m. OK PyPy 3 TESTS 33 218 15872000 1300
65400362 algdgn A Nov. 19, 2019, 9:33 p.m. OK PyPy 3 TESTS 33 233 11468800 1300
54654110 Aidos A May 26, 2019, 7:17 a.m. OK PyPy 3 TESTS 33 234 15052800 1300
64739386 KrishRawat A Nov. 12, 2019, 11:29 a.m. OK PyPy 3 TESTS 33 249 10649600 1300
40310630 Marii A July 14, 2018, 7:53 a.m. OK PyPy 3 TESTS 33 249 11776000 1300
57923479 lIn_nIl A July 29, 2019, 6:09 a.m. OK PyPy 3 TESTS 33 249 11878400 1300
69299189 Anu_cool A Jan. 22, 2020, 1:16 p.m. OK PyPy 3 TESTS 33 249 13926400 1300
44767793 test616.cpp A Oct. 24, 2018, 10:55 a.m. OK Python 2 TESTS 33 202 9216000 1300
59553458 pktyagi1 A Aug. 27, 2019, 4:48 a.m. OK Python 2 TESTS 33 249 5836800 1300
42195199 franckmy A Aug. 28, 2018, 5:59 a.m. OK Python 2 TESTS 33 264 5734400 1300
40393104 ccs3326 A July 16, 2018, 2:41 a.m. OK Python 2 TESTS 33 264 5836800 1300
40570305 rakshak197 A July 20, 2018, 7:47 a.m. OK Python 2 TESTS 33 265 6451200 1300
47441961 Nure A Dec. 24, 2018, 2:28 a.m. OK Python 2 TESTS 33 265 6553600 1300
41332952 tnowakow A Aug. 8, 2018, 9:56 a.m. OK Python 2 TESTS 33 280 5632000 1300
40393141 ccs3326 A July 16, 2018, 2:43 a.m. OK Python 2 TESTS 33 280 5632000 1300
40265625 Neil A July 13, 2018, 2:41 p.m. OK Python 2 TESTS 33 280 5632000 1300
40333609 nealzane A July 14, 2018, 3:20 p.m. OK Python 2 TESTS 33 280 5734400 1300
45587851 samsaed A Nov. 12, 2018, 10:15 a.m. OK Python 3 TESTS 33 155 10854400 1300
55519559 kirtanpathak4 A June 13, 2019, 7:41 a.m. OK Python 3 TESTS 33 170 12697600 1300
40782927 ar7L A July 26, 2018, 2:54 p.m. OK Python 3 TESTS 33 171 8908800 1300
40769968 palan A July 26, 2018, 8:08 a.m. OK Python 3 TESTS 33 171 8908800 1300
40726884 aruncveli A July 25, 2018, 5:30 a.m. OK Python 3 TESTS 33 171 8908800 1300
45499512 kgmkr00001 A Nov. 10, 2018, 6:11 a.m. OK Python 3 TESTS 33 171 11776000 1300
40756103 MadJayhawk A July 25, 2018, 10:43 p.m. OK Python 3 TESTS 33 171 12492800 1300
40301305 avalya7 A July 14, 2018, 2:16 a.m. OK Python 3 TESTS 33 171 12492800 1300
40812848 amintaheri90 A July 26, 2018, 6:39 p.m. OK Python 3 TESTS 33 186 8806400 1300
41140024 ashok123 A Aug. 3, 2018, 2:03 a.m. OK Python 3 TESTS 33 186 9216000 1300

remove filters

Back to search problems