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
( 2380 ) G Candy Box (hard version) PROGRAMMING greedy implementation sortings 2100

B"This problem is a version of problem D from the same contest with some additional constraints and tasks. 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. You really like some of the candies and don't want to include them into the gift, but you want to eat them yourself instead. For each candy, a number f_i is given, which is equal to 0 if you really want to keep i -th candy for yourself, or 1 if you don't mind including it into your gift. It is possible that two candies of the same type have different values of f_i . You want your gift to be as large as possible, but you don't want to include too many of the candies you want to eat into the gift. So, you want to calculate the maximum possible number of candies that can be included into a gift, and among all ways to choose maximum number of candies, you want to maximize the number of candies having f_i = 1 in your gift. 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. The first line of each query contains one integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of candies. Then n lines follow, each containing two integers a_i and f_i ( 1 <= a_i <= n , 0 <= f_i <= 1 ), where a_i is the type of the i -th candy, and f_i de"...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56504366 453908766 G July 4, 2019, 7:48 a.m. OK Clang++17 Diagnostics TESTS 29 592 19558400 2100
57355706 sansen G July 20, 2019, 6:11 a.m. OK GNU C11 TESTS 29 78 7372800 2100
58064740 MRoy G July 31, 2019, 8:35 a.m. OK GNU C11 TESTS 29 670 7372800 2100
64825438 luogu_bot1 G Nov. 13, 2019, 3:30 p.m. OK GNU C++11 TESTS 29 46 3993600 2100
56161154 cmwqf G June 27, 2019, 12:23 p.m. OK GNU C++11 TESTS 29 46 5529600 2100
56182468 csj G June 28, 2019, 1:29 a.m. OK GNU C++11 TESTS 29 46 7168000 2100
56182408 Heartlessly csj G June 28, 2019, 1:26 a.m. OK GNU C++11 TESTS 29 46 7168000 2100
56306301 qianlanse G June 30, 2019, 12:01 p.m. OK GNU C++11 TESTS 29 46 9625600 2100
63060485 Kylin_ G Oct. 21, 2019, 8:27 a.m. OK GNU C++11 TESTS 29 46 17715200 2100
62283728 DAH G Oct. 10, 2019, 1:10 p.m. OK GNU C++11 TESTS 29 61 3993600 2100
59978248 vjudge1 G Sept. 4, 2019, 7:02 a.m. OK GNU C++11 TESTS 29 62 3993600 2100
64153748 yalizjc G Nov. 3, 2019, 12:10 p.m. OK GNU C++11 TESTS 29 62 6758400 2100
56163114 Frame233 G June 27, 2019, 1:09 p.m. OK GNU C++11 TESTS 29 77 3379200 2100
56191577 sonhv3112 G June 28, 2019, 7:53 a.m. OK GNU C++14 TESTS 29 108 3379200 2100
56615970 erogame G July 6, 2019, 9:39 a.m. OK GNU C++14 TESTS 29 109 3993600 2100
56227686 ChillstepGoingOn G June 28, 2019, 1:15 p.m. OK GNU C++14 TESTS 29 124 3174400 2100
56185234 kudokidld_ G June 28, 2019, 4:10 a.m. OK GNU C++14 TESTS 29 124 3174400 2100
63646204 GJC_xj G Oct. 28, 2019, 9:47 a.m. OK GNU C++14 TESTS 29 124 3993600 2100
56301285 bluefi G June 30, 2019, 9:02 a.m. OK GNU C++14 TESTS 29 124 5324800 2100
59200207 Azrael142857 G Aug. 21, 2019, 4:15 a.m. OK GNU C++14 TESTS 29 124 5324800 2100
56441846 ljk0411jg G July 2, 2019, 4:48 p.m. OK GNU C++14 TESTS 29 124 6860800 2100
56440178 ljk0411jg G July 2, 2019, 3:57 p.m. OK GNU C++14 TESTS 29 124 6860800 2100
68684591 Scut82 G Jan. 13, 2020, 2:20 a.m. OK GNU C++14 TESTS 29 124 8908800 2100
56736043 julianfernando G July 9, 2019, 5:17 a.m. OK GNU C++17 TESTS 29 108 5324800 2100
56422361 yswness G July 2, 2019, 7:57 a.m. OK GNU C++17 TESTS 29 109 3174400 2100
56462111 FoolishMe G July 3, 2019, 7:17 a.m. OK GNU C++17 TESTS 29 109 3174400 2100
57308507 peterr G July 19, 2019, 5:24 a.m. OK GNU C++17 TESTS 29 109 3584000 2100
56148752 Lucina G June 27, 2019, 7:22 a.m. OK GNU C++17 TESTS 29 109 5222400 2100
56148692 Lucina G June 27, 2019, 7:21 a.m. OK GNU C++17 TESTS 29 109 5222400 2100
56234307 pkgunboat G June 28, 2019, 3:31 p.m. OK GNU C++17 TESTS 29 109 5632000 2100
59437608 wish2lucky G Aug. 25, 2019, 9:34 a.m. OK GNU C++17 TESTS 29 124 1843200 2100
68661322 vjudge2 G Jan. 12, 2020, 1:44 p.m. OK GNU C++17 TESTS 29 124 3174400 2100
63668931 teapotd G Oct. 28, 2019, 4:16 p.m. OK GNU C++17 TESTS 29 124 3174400 2100
56156105 seo G June 27, 2019, 10:17 a.m. OK Java 8 TESTS 29 155 0 2100
56155700 bhautik_77 G June 27, 2019, 10:06 a.m. OK Java 8 TESTS 29 171 2764800 2100
63757968 dyhu083 G Oct. 30, 2019, 1:17 a.m. OK Java 8 TESTS 29 171 4505600 2100
56153035 james222424 G June 27, 2019, 8:56 a.m. OK Java 8 TESTS 29 202 4915200 2100
56156660 _apurv_ G June 27, 2019, 10:31 a.m. OK Java 8 TESTS 29 202 5734400 2100
56626021 horseprabhat625 G July 6, 2019, 1:56 p.m. OK Java 8 TESTS 29 218 4096000 2100
56846373 Jarik G July 11, 2019, 1:48 p.m. OK Java 8 TESTS 29 218 5120000 2100
56178842 iamyashh G June 27, 2019, 9:06 p.m. OK Java 8 TESTS 29 218 13107200 2100
56155562 Nutella3000 G June 27, 2019, 10:02 a.m. OK Java 8 TESTS 29 233 0 2100
69065248 O_E G Jan. 18, 2020, 6:19 p.m. OK Java 8 TESTS 29 233 0 2100
56780098 Spheniscine G July 10, 2019, 5:47 a.m. OK Kotlin TESTS 29 483 14848000 2100
56778158 Spheniscine G July 10, 2019, 4:21 a.m. OK Kotlin TESTS 29 498 14848000 2100
56478012 harryoooooooooo G July 3, 2019, 2:03 p.m. OK Kotlin TESTS 29 717 16486400 2100
56151114 og.kostya G June 27, 2019, 8:12 a.m. OK Mono C# TESTS 29 140 8089600 2100
56182102 vjudge5 G June 28, 2019, 1:01 a.m. OK MS C++ TESTS 29 93 2969600 2100
65519967 vjudge2 G Nov. 22, 2019, 7:49 a.m. OK MS C++ TESTS 29 109 4403200 2100
56266293 S.K G June 29, 2019, 10:01 a.m. OK MS C++ TESTS 29 140 6348800 2100
57448565 hwangganzi G July 21, 2019, 8:59 a.m. OK MS C++ 2017 TESTS 29 217 6348800 2100
57990221 Yanhui G July 30, 2019, 12:57 p.m. OK MS C++ 2017 TESTS 29 234 22732800 2100
57446970 hwangganzi G July 21, 2019, 8:31 a.m. OK MS C++ 2017 TESTS 29 249 11264000 2100
56183990 xsc G June 28, 2019, 3:01 a.m. OK MS C++ 2017 TESTS 29 249 11264000 2100
56819093 pseuda G July 10, 2019, 9:35 p.m. OK MS C++ 2017 TESTS 29 592 20070400 2100
59360246 GeKa G Aug. 23, 2019, 2:59 p.m. OK MS C++ 2017 TESTS 29 1185 4915200 2100
56238566 CtrlAlt G June 28, 2019, 5:20 p.m. OK MS C++ 2017 TESTS 29 1278 16793600 2100
57706831 SaYami G July 24, 2019, 8:34 p.m. OK PyPy 3 TESTS 29 607 22425600 2100
56157848 nik-in-au G June 27, 2019, 11:03 a.m. OK PyPy 3 TESTS 29 608 36147200 2100
56178381 Pokeylope G June 27, 2019, 8:46 p.m. OK PyPy 3 TESTS 29 639 22016000 2100
56178643 Pokeylope G June 27, 2019, 8:57 p.m. OK PyPy 3 TESTS 29 686 18534400 2100
56177281 titia G June 27, 2019, 7:57 p.m. OK PyPy 3 TESTS 29 888 51712000 2100
56166257 sprkgoyal G June 27, 2019, 2:25 p.m. OK PyPy 3 TESTS 29 1014 36556800 2100
57550188 Helli.code G July 22, 2019, 5:10 p.m. OK Python 2 TESTS 29 1435 37580800 2100
56268925 kobae964 G June 29, 2019, 11:15 a.m. OK Rust TESTS 29 171 7168000 2100
56272702 Peaupote G June 29, 2019, 12:47 p.m. OK Rust TESTS 29 1840 7577600 2100

remove filters

Back to search problems