VK Cup 2018 - Wild-card Round 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
926 VK Cup 2018 - Wild-card Round 1 FINISHED False 7200 210522299 March 17, 2018, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 219 ) H Endless Roses Most Beautiful PROGRAMMING 2300

B"Arkady decided to buy roses for his girlfriend. A flower shop has white, orange and red roses, and the total amount of them is n. Arkady thinks that red roses are not good together with white roses, so he won't buy a bouquet containing both red and white roses. Also, Arkady won't buy a bouquet where all roses have the same color. Arkady wants to buy exactly k roses. For each rose in the shop he knows its beauty and color: the beauty of the i-th rose is bi, and its color is ci ('W' for a white rose, 'O' for an orange rose and 'R' for a red rose). Compute the maximum possible total beauty of a bouquet of k roses satisfying the constraints above or determine that it is not possible to make such a bouquet. The first line contains two integers n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200 xe2 x80 x89000) -- the number of roses in the show and the number of roses Arkady wants to buy. The second line contains a sequence of integers b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8910 xe2 x80 x89000), where bi equals the beauty of the i-th rose. The third line contains a string c of length n, consisting of uppercase English letters 'W', 'O' and 'R', where ci denotes the color of the i-th rose: 'W' denotes white, 'O' -- orange, 'R' -- red. Print the maximum possible total beauty of a bouquet of k roses that satisfies the constraints above. If it is not possible to make a single such bouquet, print -1. In the first example Arkady wants to buy 3 roses. He can, for example, buy both red roses (their indices are 1 and 2, and their total beauty is 7) and the only orange rose (its index is 3, its beauty is 4). This way the total beauty of the bouquet is 11. In the second example Arkady can not buy a bouquet because all roses have the same color. "...

Tutorials

Разбор VK Cup 2018 — Уайлд-кард Раунд 1

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
36382788 magnickolas H March 18, 2018, 8:56 a.m. OK D TESTS 98 93 14950400 2300
36382693 magnickolas H March 18, 2018, 8:53 a.m. OK D TESTS 98 93 14950400 2300
36364397 dmitriyklebanov gepardo H March 17, 2018, 4:54 p.m. OK FPC TESTS 98 78 8601600 2300
36364532 dmitriyklebanov gepardo H March 17, 2018, 4:55 p.m. OK FPC TESTS 98 93 8601600 2300
36365272 belesprit 0xFED H March 17, 2018, 5:05 p.m. OK GNU C++ TESTS 98 124 10137600 2300
36426140 droidlyx86 H March 20, 2018, 6:48 a.m. OK GNU C++ TESTS 98 405 7987200 2300
36433397 DeaphetS H March 20, 2018, 1:01 p.m. OK GNU C++11 TESTS 98 78 7168000 2300
39013347 zhouyuyang H June 7, 2018, 8:46 a.m. OK GNU C++11 TESTS 98 93 4505600 2300
54895703 cheetose H June 1, 2019, 2:29 a.m. OK GNU C++11 TESTS 98 93 6553600 2300
36442048 _Otabek H March 20, 2018, 8:33 p.m. OK GNU C++11 TESTS 98 109 5632000 2300
36621496 RccHD H March 25, 2018, 3:54 p.m. OK GNU C++11 TESTS 98 140 10035200 2300
36361925 DenisPushkin heimdall H March 17, 2018, 4:24 p.m. OK GNU C++11 TESTS 98 155 7475200 2300
62754302 gabe H Oct. 17, 2019, 3:33 a.m. OK GNU C++11 TESTS 98 155 13312000 2300
36530514 kadNaN H March 23, 2018, 12:41 p.m. OK GNU C++11 TESTS 98 156 7782400 2300
36394577 stefdasca H March 18, 2018, 3:58 p.m. OK GNU C++11 TESTS 98 171 9932800 2300
36399658 SergeyYakovlev H March 18, 2018, 9:47 p.m. OK GNU C++11 TESTS 98 436 7168000 2300
36381604 denison7111 H March 18, 2018, 8:14 a.m. OK GNU C++14 TESTS 98 78 6758400 2300
49809279 rareone0602 H Feb. 11, 2019, 10:23 p.m. OK GNU C++14 TESTS 98 93 3993600 2300
36371965 strizh78 H March 17, 2018, 9:24 p.m. OK GNU C++14 TESTS 98 93 5734400 2300
36395469 fofao_funk H March 18, 2018, 4:47 p.m. OK GNU C++14 TESTS 98 93 7372800 2300
36366151 JustLive H March 17, 2018, 5:18 p.m. OK GNU C++14 TESTS 98 93 7475200 2300
36364263 Husayn_Hasanov Jamesbond_007 H March 17, 2018, 4:52 p.m. OK GNU C++14 TESTS 98 93 8396800 2300
45160528 aayush13 H Nov. 1, 2018, 8:49 a.m. OK GNU C++14 TESTS 98 93 10137600 2300
36365897 lukomskiy Daryusz H March 17, 2018, 5:14 p.m. OK GNU C++14 TESTS 98 93 10444800 2300
36366662 applese Samsara_Karma H March 17, 2018, 5:26 p.m. OK GNU C++14 TESTS 98 109 7577600 2300
36395128 andreumat H March 18, 2018, 4:27 p.m. OK GNU C++14 TESTS 98 109 13004800 2300
36368295 vertrue H March 17, 2018, 6:01 p.m. OK GNU C++17 TESTS 98 93 7372800 2300
36365953 Qumeric H March 17, 2018, 5:15 p.m. OK GNU C++17 TESTS 98 93 9728000 2300
36367019 vertrue VladProg H March 17, 2018, 5:30 p.m. OK GNU C++17 TESTS 98 93 10547200 2300
36399951 Lollipop H March 18, 2018, 10:21 p.m. OK GNU C++17 TESTS 98 342 5222400 2300
36366780 Eva crusty H March 17, 2018, 5:27 p.m. OK GNU C++17 TESTS 98 342 11878400 2300
36363249 MForest IgorI H March 17, 2018, 4:40 p.m. OK GNU C++17 TESTS 98 343 31948800 2300
36362708 nepoklonov ark1 H March 17, 2018, 4:34 p.m. OK Java 8 TESTS 98 202 27033600 2300
36364595 drunya H March 17, 2018, 4:56 p.m. OK Java 8 TESTS 98 265 26521600 2300
36368812 lokofan46 H March 17, 2018, 6:23 p.m. OK Java 8 TESTS 98 280 26726400 2300
36365905 khazhix 4mda4mda H March 17, 2018, 5:14 p.m. OK Java 8 TESTS 98 295 28160000 2300
36468634 Wavator H March 22, 2018, 4:17 a.m. OK Java 8 TESTS 98 311 29388800 2300
36400897 PavelChadnov H March 19, 2018, 12:21 a.m. OK Java 8 TESTS 98 576 26624000 2300
36366421 XRater a-n-cl-r-e-y H March 17, 2018, 5:22 p.m. OK Java 8 TESTS 98 623 31129600 2300
36368764 48683 H March 17, 2018, 6:21 p.m. OK JavaScript TESTS 98 233 35942400 2300
36366707 Avonazhrets DoomzGay H March 17, 2018, 5:26 p.m. OK Kotlin TESTS 98 639 25088000 2300
40006591 Scampish H July 5, 2018, 6:48 p.m. OK Python 2 TESTS 98 717 13824000 2300
36367671 STAJIKER H March 17, 2018, 5:40 p.m. OK Python 3 TESTS 98 374 20787200 2300
36361237 RubenAshughyan sparik H March 17, 2018, 4:16 p.m. OK Python 3 TESTS 98 483 20582400 2300
36367182 miagkov Tira H March 17, 2018, 5:32 p.m. OK Python 3 TESTS 98 529 20582400 2300
36771893 MassterMax H March 31, 2018, 11:16 a.m. OK Python 3 TESTS 98 545 20992000 2300
36368412 CurtizJ H March 17, 2018, 6:06 p.m. OK Python 3 TESTS 98 701 20889600 2300
36363049 Art Dimasichek H March 17, 2018, 4:37 p.m. OK Python 3 TESTS 98 811 21299200 2300
36399021 Mad_Andrei H March 18, 2018, 8:49 p.m. OK Python 3 TESTS 98 904 22528000 2300

remove filters

Back to search problems