Codeforces Round 570 (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
1183 Codeforces Round 570 (Div. 3) FINISHED False 8100 170263499 June 26, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14589 ) D Candy Box (easy version) PROGRAMMING greedy sortings 1400

B'This problem is actually a subproblem of problem G from the same contest. There are n candies in a candy box. The type of the i -th candy is a_i ( 1 <= a_i <= n ). You have to prepare a gift using some of these candies with the following restriction: the numbers of candies of each type presented in a gift should be all distinct (i. xe2 x80 x89e. for example, a gift having two candies of type 1 and two candies of type 2 is bad). It is possible that multiple types of candies are completely absent from the gift. It is also possible that not all candies of some types will be taken to a gift. Your task is to find out the maximum possible size of the single gift you can prepare using the candies you have. You have to answer q independent queries. If you are Python programmer, consider using PyPy instead of Python when you submit your code. The first line of the input contains one integer q ( 1 <= q <= 2 cdot 10^5 ) -- the number of queries. Each query is represented by two lines. The first line of each query contains one integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of candies. The second line of each query contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ), where a_i is the type of the i -th candy in the box. It is guaranteed that the sum of n over all queries does not exceed 2 cdot 10^5 . For each query print one integer -- the maximum possible size of the single gift you can compose using candies you got in this query with the restriction described in the problem statement. In the first query, you can prepare a gift with two candies of type 8 and one candy of type 5 , totalling to 3 candies. Note that this is not the only possible solution -- taking two candies of type 4 and one candy of type 6 is also valid. '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56495991 453908766 D July 4, 2019, 2:57 a.m. OK Clang++17 Diagnostics TESTS 31 186 0 1400
56709346 vjudge2 D July 8, 2019, 12:12 p.m. OK Clang++17 Diagnostics TESTS 31 202 0 1400
57502841 vjudge2 D July 22, 2019, 10:57 a.m. OK Clang++17 Diagnostics TESTS 31 202 2252800 1400
56885465 ttepu D July 12, 2019, 12:23 p.m. OK Clang++17 Diagnostics TESTS 31 997 28467200 1400
57554707 romanporsh D July 22, 2019, 7:04 p.m. OK FPC TESTS 31 638 1638400 1400
63980096 chaorenhaha D Nov. 1, 2019, 9:58 a.m. OK FPC TESTS 31 639 8294400 1400
56419744 sansen D July 2, 2019, 6:45 a.m. OK GNU C11 TESTS 31 155 2457600 1400
56230120 -Decryptor- D June 28, 2019, 1:58 p.m. OK GNU C11 TESTS 31 639 819200 1400
56188064 _nmp_ D June 28, 2019, 6:06 a.m. OK GNU C11 TESTS 31 639 1843200 1400
57984425 MRoy D July 30, 2019, 10:47 a.m. OK GNU C11 TESTS 31 654 1638400 1400
58516479 harshitrkt D Aug. 10, 2019, 12:17 a.m. OK GNU C11 TESTS 31 655 819200 1400
56440729 med_amine D July 2, 2019, 4:13 p.m. OK GNU C11 TESTS 31 655 1638400 1400
56251340 rishiraje D June 29, 2019, 3:25 a.m. OK GNU C11 TESTS 31 655 1638400 1400
56259884 Rithik123 D June 29, 2019, 7:40 a.m. OK GNU C11 TESTS 31 655 2355200 1400
56166874 ktk54x D June 27, 2019, 2:39 p.m. OK GNU C11 TESTS 31 655 4198400 1400
61820356 kaiboy D Oct. 4, 2019, 1:58 a.m. OK GNU C11 TESTS 31 670 819200 1400
65417776 luogu_bot4 D Nov. 20, 2019, 7:40 a.m. OK GNU C++11 TESTS 31 31 614400 1400
64153171 yalizjc D Nov. 3, 2019, 12:01 p.m. OK GNU C++11 TESTS 31 31 819200 1400
57141005 vjudge1 D July 16, 2019, 11:03 a.m. OK GNU C++11 TESTS 31 31 1638400 1400
56182444 csj D June 28, 2019, 1:28 a.m. OK GNU C++11 TESTS 31 31 1638400 1400
56181470 Heartlessly csj D June 28, 2019, 12:09 a.m. OK GNU C++11 TESTS 31 31 1638400 1400
57766342 baobao765 D July 25, 2019, 8:41 p.m. OK GNU C++11 TESTS 31 31 3891200 1400
57747395 ILoLy D July 25, 2019, 1:32 p.m. OK GNU C++11 TESTS 31 31 3891200 1400
56167240 -Javelin- D June 27, 2019, 2:49 p.m. OK GNU C++11 TESTS 31 31 8806400 1400
56496397 Enrong D July 4, 2019, 3:14 a.m. OK GNU C++11 TESTS 31 46 614400 1400
56160431 Frame233 D June 27, 2019, 12:06 p.m. OK GNU C++11 TESTS 31 46 614400 1400
58849387 ttaosnmniya.6638.cross D Aug. 15, 2019, 6:51 a.m. OK GNU C++14 TESTS 31 77 1536000 1400
57592863 Acker_man D July 23, 2019, 12:52 p.m. OK GNU C++14 TESTS 31 78 819200 1400
56178880 emacser D June 27, 2019, 9:08 p.m. OK GNU C++14 TESTS 31 78 819200 1400
57093891 nweeks D July 15, 2019, 11:38 a.m. OK GNU C++14 TESTS 31 78 819200 1400
58917590 p.ferrari D Aug. 16, 2019, 3:38 p.m. OK GNU C++14 TESTS 31 78 819200 1400
65418811 vjudge4 D Nov. 20, 2019, 8:07 a.m. OK GNU C++14 TESTS 31 78 1228800 1400
57354524 mayiyang D July 20, 2019, 5:37 a.m. OK GNU C++14 TESTS 31 78 1638400 1400
60415268 iShibly D Sept. 12, 2019, 1:37 a.m. OK GNU C++14 TESTS 31 78 2457600 1400
57356359 Divi_09 D July 20, 2019, 6:27 a.m. OK GNU C++14 TESTS 31 78 3174400 1400
68842074 _HonEy D Jan. 15, 2020, 6:08 a.m. OK GNU C++14 TESTS 31 93 819200 1400
56187507 shamim7999 D June 28, 2019, 5:49 a.m. OK GNU C++17 TESTS 31 62 819200 1400
60148958 rareone0602 D Sept. 6, 2019, 2:37 a.m. OK GNU C++17 TESTS 31 77 819200 1400
56276780 Zabiyaka D June 29, 2019, 2:39 p.m. OK GNU C++17 TESTS 31 77 819200 1400
56735228 julianfernando D July 9, 2019, 4:43 a.m. OK GNU C++17 TESTS 31 77 2355200 1400
56183742 Isabela_CR D June 28, 2019, 2:48 a.m. OK GNU C++17 TESTS 31 77 3993600 1400
57601204 MohamedKhaled D July 23, 2019, 3:52 p.m. OK GNU C++17 TESTS 31 78 819200 1400
56446896 glebanya D July 2, 2019, 7:18 p.m. OK GNU C++17 TESTS 31 78 819200 1400
59870891 ikolcov D Sept. 1, 2019, 7:19 p.m. OK GNU C++17 TESTS 31 78 819200 1400
58531697 zxcv_1 D Aug. 10, 2019, 9:50 a.m. OK GNU C++17 TESTS 31 78 819200 1400
57258888 BrunoTissei D July 18, 2019, 3:52 a.m. OK GNU C++17 TESTS 31 78 819200 1400
56300899 efimmanevich D June 30, 2019, 8:49 a.m. OK Go TESTS 31 202 4608000 1400
56233918 old_boo D June 28, 2019, 3:20 p.m. OK Haskell TESTS 31 702 30412800 1400
56178427 old_boo D June 27, 2019, 8:49 p.m. OK Haskell TESTS 31 717 30515200 1400
56233934 old_boo D June 28, 2019, 3:21 p.m. OK Haskell TESTS 31 733 30515200 1400
60470643 tonyu0 D Sept. 13, 2019, 5:17 a.m. OK Haskell TESTS 31 748 30412800 1400
56169912 mredigonda D June 27, 2019, 4 p.m. OK Haskell TESTS 31 888 16896000 1400
66436162 al_Jahy D Dec. 7, 2019, 6:16 a.m. OK Java 11 TESTS 31 1513 0 1400
69944840 khyatiagrawal19 D Feb. 1, 2020, 7:17 a.m. OK Java 11 TESTS 31 1840 0 1400
56163328 mufaddalnaya D June 27, 2019, 1:15 p.m. OK Java 8 TESTS 31 124 0 1400
56151014 seo D June 27, 2019, 8:10 a.m. OK Java 8 TESTS 31 124 0 1400
56181685 ashen.lily D June 28, 2019, 12:28 a.m. OK Java 8 TESTS 31 139 0 1400
61852843 housni D Oct. 4, 2019, 1:13 p.m. OK Java 8 TESTS 31 140 0 1400
58310781 bwang1008 D Aug. 4, 2019, 10:34 p.m. OK Java 8 TESTS 31 140 0 1400
57849136 akshay2301 D July 27, 2019, 12:25 p.m. OK Java 8 TESTS 31 140 0 1400
56677202 NMouad21 D July 7, 2019, 4:06 p.m. OK Java 8 TESTS 31 140 0 1400
56170446 r_sutaria D June 27, 2019, 4:16 p.m. OK Java 8 TESTS 31 140 0 1400
58940441 dyhu083 D Aug. 17, 2019, 6:40 a.m. OK Java 8 TESTS 31 155 0 1400
56359928 Anonymous9 D June 30, 2019, 6:50 p.m. OK Java 8 TESTS 31 155 0 1400
56480814 Lavlet D July 3, 2019, 3:58 p.m. OK JavaScript TESTS 31 1154 42598400 1400
57571103 Killer45 D July 23, 2019, 5:16 a.m. OK Kotlin TESTS 31 171 5222400 1400
56472652 harryoooooooooo D July 3, 2019, 11:50 a.m. OK Kotlin TESTS 31 374 17100800 1400
61545854 david_varela D Sept. 30, 2019, 10:23 a.m. OK Kotlin TESTS 31 390 17203200 1400
56252557 Spheniscine D June 29, 2019, 4:30 a.m. OK Kotlin TESTS 31 420 27648000 1400
56168998 Spheniscine D June 27, 2019, 3:35 p.m. OK Kotlin TESTS 31 421 27545600 1400
56170117 Spheniscine D June 27, 2019, 4:07 p.m. OK Kotlin TESTS 31 436 27545600 1400
56167425 Spheniscine D June 27, 2019, 2:53 p.m. OK Kotlin TESTS 31 1684 27545600 1400
56167150 Spheniscine D June 27, 2019, 2:46 p.m. OK Kotlin TESTS 31 1700 26828800 1400
56488351 Black_Fregat D July 3, 2019, 7:44 p.m. OK Kotlin TESTS 31 2184 30924800 1400
56148864 og.kostya D June 27, 2019, 7:25 a.m. OK Mono C# TESTS 31 77 3174400 1400
66166386 tomomo2b2 D Dec. 2, 2019, 7:50 a.m. OK Mono C# TESTS 31 218 35840000 1400
56522667 TRR D July 4, 2019, 3:39 p.m. OK Mono C# TESTS 31 1262 17100800 1400
63273983 QuantumKnight D Oct. 24, 2019, 5:55 a.m. OK Mono C# TESTS 31 1403 35840000 1400
56550785 NEvOl D July 5, 2019, 9:39 a.m. OK Mono C# TESTS 31 1419 28057600 1400
57847007 vjudge4 D July 27, 2019, 11:36 a.m. OK MS C++ TESTS 31 62 1638400 1400
58086590 vjudge5 D July 31, 2019, 3:52 p.m. OK MS C++ TESTS 31 77 819200 1400
57261563 vjudge1 D July 18, 2019, 5:26 a.m. OK MS C++ TESTS 31 77 1638400 1400
61730699 vjudge2 D Oct. 2, 2019, 4:41 p.m. OK MS C++ TESTS 31 77 1638400 1400
56881214 vjudge5 D July 12, 2019, 10:33 a.m. OK MS C++ TESTS 31 78 819200 1400
57255133 vjudge5 D July 18, 2019, 2:06 a.m. OK MS C++ TESTS 31 78 819200 1400
65417563 vjudge5 D Nov. 20, 2019, 7:35 a.m. OK MS C++ TESTS 31 78 819200 1400
65420560 vjudge5 D Nov. 20, 2019, 8:46 a.m. OK MS C++ TESTS 31 78 819200 1400
56739335 vjudge5 D July 9, 2019, 6:57 a.m. OK MS C++ TESTS 31 78 819200 1400
65700881 vjudge1 D Nov. 25, 2019, 10:44 a.m. OK MS C++ TESTS 31 78 819200 1400
65417807 vjudge2 D Nov. 20, 2019, 7:41 a.m. OK MS C++ 2017 TESTS 31 77 819200 1400
63057800 vjudge1 D Oct. 21, 2019, 7:13 a.m. OK MS C++ 2017 TESTS 31 124 819200 1400
56432289 Xun_ D July 2, 2019, 12:34 p.m. OK MS C++ 2017 TESTS 31 124 819200 1400
56185323 llolitay D June 28, 2019, 4:15 a.m. OK MS C++ 2017 TESTS 31 124 819200 1400
56169239 Jiang142857 D June 27, 2019, 3:42 p.m. OK MS C++ 2017 TESTS 31 124 1638400 1400
56157015 zcb D June 27, 2019, 10:41 a.m. OK MS C++ 2017 TESTS 31 124 1638400 1400
56984194 vjudge5 D July 13, 2019, 3:11 p.m. OK MS C++ 2017 TESTS 31 139 819200 1400
56741546 lyk1012 D July 9, 2019, 7:56 a.m. OK MS C++ 2017 TESTS 31 139 5222400 1400
57261547 liuhb D July 18, 2019, 5:26 a.m. OK MS C++ 2017 TESTS 31 140 1638400 1400
57840766 vjudge3 D July 27, 2019, 9:13 a.m. OK MS C++ 2017 TESTS 31 140 1638400 1400
56402500 eg322 D July 1, 2019, 5:32 p.m. OK PascalABC.NET TESTS 31 1668 102400 1400
56168535 mayakin D June 27, 2019, 3:24 p.m. OK PHP TESTS 31 920 16384000 1400
56164740 homie D June 27, 2019, 1:49 p.m. OK PyPy 2 TESTS 31 780 18432000 1400
56554382 bertrandovide D July 5, 2019, 11:39 a.m. OK PyPy 2 TESTS 31 936 18739200 1400
56554294 bertrandovide D July 5, 2019, 11:36 a.m. OK PyPy 2 TESTS 31 936 18739200 1400
58120773 bhuya D Aug. 1, 2019, 10:38 a.m. OK PyPy 2 TESTS 31 2698 13312000 1400
57938819 -Morass- D July 29, 2019, 11:49 a.m. OK PyPy 2 TESTS 31 2729 11776000 1400
56553441 bertrandovide D July 5, 2019, 11:07 a.m. OK PyPy 2 TESTS 31 2730 16793600 1400
56153788 snape_here D June 27, 2019, 9:16 a.m. OK PyPy 3 TESTS 31 373 15872000 1400
56310526 Carnivorei D June 30, 2019, 2:33 p.m. OK PyPy 3 TESTS 31 374 15769600 1400
56154178 snape_here D June 27, 2019, 9:27 a.m. OK PyPy 3 TESTS 31 374 15769600 1400
56238410 s1ddharth3 D June 28, 2019, 5:16 p.m. OK PyPy 3 TESTS 31 389 16691200 1400
56784848 niteshmittal68 D July 10, 2019, 7:55 a.m. OK PyPy 3 TESTS 31 390 15769600 1400
56444820 teekteek D July 2, 2019, 6:18 p.m. OK PyPy 3 TESTS 31 405 16179200 1400
56158958 pranaymalhan D June 27, 2019, 11:32 a.m. OK PyPy 3 TESTS 31 420 19865600 1400
56273178 Rusu D June 29, 2019, 12:59 p.m. OK PyPy 3 TESTS 31 421 11059200 1400
57881474 Parag_AP D July 28, 2019, 7:59 a.m. OK PyPy 3 TESTS 31 421 16588800 1400
56163401 sprkgoyal D June 27, 2019, 1:16 p.m. OK PyPy 3 TESTS 31 421 19865600 1400
56164700 homie D June 27, 2019, 1:48 p.m. OK Python 2 TESTS 31 810 21913600 1400
56149638 ayush0016 D June 27, 2019, 7:42 a.m. OK Python 2 TESTS 31 935 11878400 1400
57938840 -Morass- D July 29, 2019, 11:50 a.m. OK Python 2 TESTS 31 951 12288000 1400
57548021 Helli.code D July 22, 2019, 4:39 p.m. OK Python 2 TESTS 31 1013 11878400 1400
56150260 ayush0016 D June 27, 2019, 7:55 a.m. OK Python 2 TESTS 31 1029 11161600 1400
62094023 aTastyNoodle D Oct. 8, 2019, 6:50 a.m. OK Python 2 TESTS 31 1107 31641600 1400
56722635 SarveshDubey D July 8, 2019, 5:40 p.m. OK Python 2 TESTS 31 1309 28262400 1400
56188016 james_bot D June 28, 2019, 6:05 a.m. OK Python 2 TESTS 31 1653 13721600 1400
56263732 jolt.tks D June 29, 2019, 9:06 a.m. OK Python 2 TESTS 31 1716 13004800 1400
56178292 Danimator D June 27, 2019, 8:42 p.m. OK Python 2 TESTS 31 1777 14233600 1400
56164913 tadashiya D June 27, 2019, 1:54 p.m. OK Python 3 TESTS 31 967 14131200 1400
56165110 tadashiya D June 27, 2019, 1:58 p.m. OK Python 3 TESTS 31 1013 14233600 1400
56164505 tadashiya D June 27, 2019, 1:44 p.m. OK Python 3 TESTS 31 1044 14233600 1400
57881512 Parag_AP D July 28, 2019, 8 a.m. OK Python 3 TESTS 31 1278 15155200 1400
56164988 Mohamed_Ayman D June 27, 2019, 1:55 p.m. OK Python 3 TESTS 31 1279 16384000 1400
56171051 LintuStorm D June 27, 2019, 4:35 p.m. OK Python 3 TESTS 31 1325 14131200 1400
56388628 nguyenminhhieu0709 D July 1, 2019, 11:37 a.m. OK Python 3 TESTS 31 1341 18841600 1400
57865304 danh07808 D July 27, 2019, 8:35 p.m. OK Python 3 TESTS 31 1403 16384000 1400
57592396 takakin D July 23, 2019, 12:43 p.m. OK Python 3 TESTS 31 1700 16076800 1400
56491190 mbouadeus D July 3, 2019, 10:06 p.m. OK Python 3 TESTS 31 1855 13107200 1400
68228095 nemi_zzz D Jan. 5, 2020, 8:02 a.m. OK Ruby TESTS 31 733 41267200 1400
56269426 kobae964 D June 29, 2019, 11:29 a.m. OK Rust TESTS 31 109 5939200 1400
61346837 chinmaykousik1 D Sept. 27, 2019, 5:34 a.m. OK Rust TESTS 31 156 9216000 1400

remove filters

Back to search problems