Codeforces Round 490 (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
999 Codeforces Round 490 (Div. 3) FINISHED False 7200 207933923 June 21, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2793 ) F Cards and Joy PROGRAMMING dp 2200

B'There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j -th player is f_j . There are k cdot n cards on the table. Each card contains a single integer: the i -th card contains number c_i . Also, you are given a sequence h_1, h_2, ... , h_k . Its meaning will be explained below. The players have to distribute all the cards in such a way that each of them will hold exactly k cards. After all the cards are distributed, each player counts the number of cards he has that contains his favorite number. The joy level of a player equals h_t if the player holds t cards containing his favorite number. If a player gets no cards with his favorite number (i.e., t=0 ), his joy level is 0 . Print the maximum possible total joy levels of the players after the cards are distributed. Note that the sequence h_1, ... , h_k is the same for all the players. The first line of input contains two integers n and k ( 1 <= n <= 500, 1 <= k <= 10 ) -- the number of players and the number of cards each player will get. The second line contains k cdot n integers c_1, c_2, ... , c_{k cdot n} ( 1 <= c_i <= 10^5 ) -- the numbers written on the cards. The third line contains n integers f_1, f_2, ... , f_n ( 1 <= f_j <= 10^5 ) -- the favorite numbers of the players. The fourth line contains k integers h_1, h_2, ... , h_k ( 1 <= h_t <= 10^5 ), where h_t is the joy level of a player if he gets exactly t cards with his favorite number written on them. It is guaranteed that the condition h_{t - 1} < h_t holds for each t in [2..k] . Print one integer -- the maximum possible total joy levels of the players among all possible card distributions. In the first example, one possible optimal card distribution is the following: Thus, the answer is 2 + 6 + 6 + 7 = 21 .'...

Tutorials

60138

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
39658495 Arthur_Carmo F June 25, 2018, 7:09 p.m. OK GNU C TESTS 74 78 20480000 2200
40525918 mtcomscxstart F July 18, 2018, 8:32 p.m. OK GNU C TESTS 74 78 202444800 2200
39889616 zhongson2125 F July 3, 2018, 9:42 a.m. OK GNU C TESTS 74 93 101683200 2200
39513345 shuitiacji F June 22, 2018, 10:29 a.m. OK GNU C++ TESTS 74 31 819200 2200
39651193 CQUzbx F June 25, 2018, 1:44 p.m. OK GNU C++ TESTS 74 31 10240000 2200
40684216 vjudge2 F July 24, 2018, 12:18 a.m. OK GNU C++ TESTS 74 31 10752000 2200
40684020 vjudge4 F July 23, 2018, 11:57 p.m. OK GNU C++ TESTS 74 31 10752000 2200
40673976 vjudge3 F July 23, 2018, 2:14 p.m. OK GNU C++ TESTS 74 31 10752000 2200
40410674 Silver-Water F July 16, 2018, 12:17 p.m. OK GNU C++ TESTS 74 31 12595200 2200
40684110 vjudge1 F July 24, 2018, 12:06 a.m. OK GNU C++ TESTS 74 46 10649600 2200
40684046 vjudge5 F July 23, 2018, 11:59 p.m. OK GNU C++ TESTS 74 46 10649600 2200
39513801 tomaso F June 22, 2018, 10:46 a.m. OK GNU C++ TESTS 74 46 10649600 2200
40684263 vjudge3 F July 24, 2018, 12:21 a.m. OK GNU C++ TESTS 74 46 10752000 2200
45441014 vjudge4 F Nov. 8, 2018, 11:09 a.m. OK GNU C++11 TESTS 74 31 2048000 2200
39586990 Hamsterw F June 24, 2018, 2:35 a.m. OK GNU C++11 TESTS 74 31 12492800 2200
67355331 vjudge1 F Dec. 21, 2019, 12:18 p.m. OK GNU C++11 TESTS 74 46 819200 2200
51286318 IcEater F March 14, 2019, 7:30 a.m. OK GNU C++11 TESTS 74 46 819200 2200
45356082 yclrz F Nov. 6, 2018, 8:28 a.m. OK GNU C++11 TESTS 74 46 819200 2200
39514063 kirisame9 F June 22, 2018, 10:57 a.m. OK GNU C++11 TESTS 74 46 819200 2200
39634017 ruddy222 F June 24, 2018, 11:17 p.m. OK GNU C++11 TESTS 74 46 921600 2200
63421120 Frame233 F Oct. 26, 2019, 6:25 a.m. OK GNU C++11 TESTS 74 46 1228800 2200
39815981 luke0201 F July 1, 2018, 8:27 a.m. OK GNU C++11 TESTS 74 46 10240000 2200
39524596 16_CQU_HQH F June 22, 2018, 6:05 p.m. OK GNU C++11 TESTS 74 46 10240000 2200
54559138 tuan26397 F May 24, 2019, 1:06 p.m. OK GNU C++14 TESTS 74 31 409600 2200
39536338 MeePwn F June 23, 2018, 8:43 a.m. OK GNU C++14 TESTS 74 31 15667200 2200
39512704 dasper F June 22, 2018, 10:08 a.m. OK GNU C++14 TESTS 74 31 20992000 2200
61931364 pootis F Oct. 5, 2019, 4:25 p.m. OK GNU C++14 TESTS 74 46 307200 2200
54558514 tuan26397 F May 24, 2019, 12:47 p.m. OK GNU C++14 TESTS 74 46 409600 2200
39569669 tuan26397 F June 23, 2018, 4:49 p.m. OK GNU C++14 TESTS 74 46 409600 2200
51286567 IcEater F March 14, 2019, 7:39 a.m. OK GNU C++14 TESTS 74 46 819200 2200
39529489 fragusbot F June 22, 2018, 11:56 p.m. OK GNU C++14 TESTS 74 46 819200 2200
40596590 xiaolongbao F July 21, 2018, 5:57 a.m. OK GNU C++14 TESTS 74 46 921600 2200
49382836 cocktail F Feb. 3, 2019, 4:09 a.m. OK GNU C++14 TESTS 74 46 1228800 2200
42361284 Nicholasgcc F Sept. 2, 2018, 12:03 p.m. OK GNU C++17 TESTS 74 31 614400 2200
41421269 vjudge2 F Aug. 10, 2018, 7:15 a.m. OK GNU C++17 TESTS 74 31 10854400 2200
41421180 Johnsonx1141 F Aug. 10, 2018, 7:13 a.m. OK GNU C++17 TESTS 74 31 10854400 2200
39680557 anctartica F June 26, 2018, 4:12 p.m. OK GNU C++17 TESTS 74 31 10854400 2200
39701484 cjnwq F June 27, 2018, 12:34 p.m. OK GNU C++17 TESTS 74 46 204800 2200
39679031 cjnwq F June 26, 2018, 3 p.m. OK GNU C++17 TESTS 74 46 204800 2200
39678990 cjnwq F June 26, 2018, 2:59 p.m. OK GNU C++17 TESTS 74 46 204800 2200
62606525 _PortgasD.Ace_ F Oct. 15, 2019, 7:58 a.m. OK GNU C++17 TESTS 74 46 307200 2200
57766992 knight-erraunt F July 25, 2019, 9:09 p.m. OK GNU C++17 TESTS 74 46 307200 2200
57787392 vjudge3 F July 26, 2019, 8:17 a.m. OK GNU C++17 TESTS 74 46 409600 2200
67211210 WangJialei F Dec. 19, 2019, 2:06 p.m. OK Go TESTS 74 124 10547200 2200
67211399 vjudge5 F Dec. 19, 2019, 2:09 p.m. OK Go TESTS 74 140 10547200 2200
42661295 April828 F Sept. 8, 2018, 4:31 a.m. OK Go TESTS 74 545 35942400 2200
42664516 April828 F Sept. 8, 2018, 6:55 a.m. OK Go TESTS 74 576 35942400 2200
39578511 romit17 F June 23, 2018, 6:55 p.m. OK Java 8 TESTS 74 155 16998400 2200
59631131 Agnimandur F Aug. 28, 2019, 6:11 p.m. OK Java 8 TESTS 74 186 5836800 2200
49920060 mennafadali F Feb. 14, 2019, 6:21 p.m. OK Java 8 TESTS 74 187 3891200 2200
60647397 Samez F Sept. 15, 2019, 5:41 p.m. OK Java 8 TESTS 74 202 18739200 2200
39578477 harshpatel F June 23, 2018, 6:51 p.m. OK Java 8 TESTS 74 217 4505600 2200
55478279 satya26 F June 12, 2019, 2:43 a.m. OK Java 8 TESTS 74 233 5427200 2200
39626700 Hamada_ F June 24, 2018, 6:20 p.m. OK Java 8 TESTS 74 233 5529600 2200
39651574 reborn.chris F June 25, 2018, 1:57 p.m. OK Java 8 TESTS 74 234 0 2200
41463067 BaZ_ F Aug. 11, 2018, 9:28 a.m. OK Java 8 TESTS 74 249 5836800 2200
39654082 unicorn20141 F June 25, 2018, 3:48 p.m. OK Java 8 TESTS 74 249 5939200 2200
67960050 hibatibati F Dec. 30, 2019, 11:11 a.m. OK Mono C# TESTS 74 140 2969600 2200
39751012 sarim F June 28, 2018, 6:31 p.m. OK Mono C# TESTS 74 187 208793600 2200
39937108 Anastasiya_Andreevna F July 3, 2018, 10:12 p.m. OK Mono C# TESTS 74 218 14131200 2200
39937120 Anastasiya_Andreevna F July 3, 2018, 10:13 p.m. OK Mono C# TESTS 74 218 14131200 2200
57890275 vjudge4 F July 28, 2019, 11:34 a.m. OK MS C++ TESTS 74 46 819200 2200
39544044 MenOfPassion F June 23, 2018, 2:42 p.m. OK MS C++ TESTS 74 46 10547200 2200
39587863 j4357j F June 24, 2018, 3:22 a.m. OK MS C++ TESTS 74 61 11264000 2200
57824931 vjudge3 F July 27, 2019, 2:27 a.m. OK MS C++ TESTS 74 62 10956800 2200
49105528 vjudge1 F Jan. 28, 2019, 12:58 p.m. OK MS C++ TESTS 74 62 11366400 2200
50773574 vjudge2 F March 4, 2019, 6:51 a.m. OK MS C++ TESTS 74 78 3174400 2200
59857843 vjudge5 F Sept. 1, 2019, 2:11 p.m. OK MS C++ TESTS 74 78 10649600 2200
53121454 kz20182726kz F April 22, 2019, 11:33 a.m. OK MS C++ TESTS 74 78 10956800 2200
41505477 CrashMaster F Aug. 11, 2018, 8:12 p.m. OK MS C++ TESTS 74 78 10956800 2200
40847717 vjudge4 F July 27, 2018, 12:57 p.m. OK MS C++ TESTS 74 93 10956800 2200
50681733 work_hard. F March 2, 2019, 11:48 a.m. OK MS C++ 2017 TESTS 74 46 10956800 2200
50681867 work_hard. F March 2, 2019, 11:52 a.m. OK MS C++ 2017 TESTS 74 61 10956800 2200
62770852 AleksanderBalobanov F Oct. 17, 2019, 10:13 a.m. OK MS C++ 2017 TESTS 74 62 103116800 2200
56940286 CtrlAlt F July 12, 2019, 7:04 p.m. OK MS C++ 2017 TESTS 74 202 201420800 2200
49155224 vjudge4 F Jan. 29, 2019, 1:33 p.m. OK Node.js TESTS 74 1138 29798400 2200
39525365 MathisHammel F June 22, 2018, 6:40 p.m. OK PyPy 2 TESTS 74 607 11673600 2200
39520948 aeternalis1 F June 22, 2018, 3:43 p.m. OK PyPy 2 TESTS 74 654 11468800 2200
56938330 smirnovalX F July 12, 2019, 6:19 p.m. OK PyPy 2 TESTS 74 670 15052800 2200
53855325 yfo F May 7, 2019, 3:48 p.m. OK PyPy 3 TESTS 74 639 12697600 2200
52301246 aleonov F April 4, 2019, 9:19 a.m. OK PyPy 3 TESTS 74 686 12288000 2200
39679924 Ali_Pi F June 26, 2018, 3:44 p.m. OK PyPy 3 TESTS 74 686 12288000 2200
39541382 ldt116 F June 23, 2018, 12:30 p.m. OK PyPy 3 TESTS 74 733 12288000 2200
39541366 ldt116 F June 23, 2018, 12:29 p.m. OK PyPy 3 TESTS 74 748 12288000 2200
39540894 ldt116 F June 23, 2018, 12:05 p.m. OK PyPy 3 TESTS 74 748 12288000 2200
39540704 ldt116 F June 23, 2018, 11:58 a.m. OK PyPy 3 TESTS 74 748 12288000 2200
39540868 ldt116 F June 23, 2018, 12:04 p.m. OK PyPy 3 TESTS 74 779 12288000 2200
40025713 findingo F July 6, 2018, 9:32 a.m. OK Rust TESTS 74 77 10956800 2200
40025663 findingo F July 6, 2018, 9:30 a.m. OK Rust TESTS 74 77 10956800 2200

remove filters

Back to search problems