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 |
---|---|---|---|---|---|---|
744 | Codeforces Round 385 (Div. 1) | FINISHED | False | 7200 | 255533124 | Dec. 17, 2016, 4:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1177 ) | C | Hongcow Buys a Deck of Cards | PROGRAMMING | bitmasks brute force dp | 2500 |
B"One day, Hongcow goes to the store and sees a brand new deck of n special cards. Each individual card is either red or blue. He decides he wants to buy them immediately. To do this, he needs to play a game with the owner of the store. This game takes some number of turns to complete. On a turn, Hongcow may do one of two things: The i-th card requires ri red resources and bi blue resources. Suppose Hongcow currently has A red cards and B blue cards. Then, the i-th card will require Hongcow to spend max(ri xe2 x80 x89- xe2 x80 x89A, xe2 x80 x890) red tokens, and max(bi xe2 x80 x89- xe2 x80 x89B, xe2 x80 x890) blue tokens. Note, only tokens disappear, but the cards stay with Hongcow forever. Each card can be bought only once. Given a description of the cards and their costs determine the minimum number of turns Hongcow needs to purchase all cards. The first line of input will contain a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8916). The next n lines of input will contain three tokens ci, ri and bi. ci will be 'R' or 'B', denoting the color of the card as red or blue. ri will be an integer denoting the amount of red resources required to obtain the card, and bi will be an integer denoting the amount of blue resources required to obtain the card (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ri, xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89107). Output a single integer, denoting the minimum number of turns needed to acquire all the cards. For the first sample, Hongcow's four moves are as follows: For the second sample, one optimal strategy is as follows: "... |
Codeforces Round #385 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
23062918 | Gassa | C | Dec. 17, 2016, 5:33 p.m. | OK | D | TESTS | 294 | 234 | 58163200 | 2500 | |
32986347 | sgtlaugh | C | Dec. 6, 2017, 7:59 p.m. | OK | GNU C | TESTS | 294 | 77 | 1843200 | 2500 | |
32457923 | sgtlaugh | C | Nov. 19, 2017, 1:26 p.m. | OK | GNU C | TESTS | 294 | 78 | 1843200 | 2500 | |
32457942 | sgtlaugh | C | Nov. 19, 2017, 1:27 p.m. | OK | GNU C | TESTS | 294 | 93 | 1843200 | 2500 | |
32457884 | sgtlaugh | C | Nov. 19, 2017, 1:25 p.m. | OK | GNU C | TESTS | 294 | 109 | 1843200 | 2500 | |
32457823 | sgtlaugh | C | Nov. 19, 2017, 1:22 p.m. | OK | GNU C | TESTS | 294 | 171 | 1843200 | 2500 | |
33023482 | sgtlaugh | C | Dec. 8, 2017, 1:24 p.m. | OK | GNU C | TESTS | 294 | 218 | 1843200 | 2500 | |
32457783 | sgtlaugh | C | Nov. 19, 2017, 1:19 p.m. | OK | GNU C | TESTS | 294 | 374 | 1843200 | 2500 | |
32457772 | sgtlaugh | C | Nov. 19, 2017, 1:19 p.m. | OK | GNU C | TESTS | 294 | 514 | 1843200 | 2500 | |
32441320 | sgtlaugh | C | Nov. 18, 2017, 8:17 p.m. | OK | GNU C | TESTS | 294 | 514 | 1843200 | 2500 | |
32442152 | sgtlaugh | C | Nov. 18, 2017, 8:49 p.m. | OK | GNU C | TESTS | 294 | 530 | 1843200 | 2500 | |
23071399 | amethyst0 | C | Dec. 17, 2016, 6:54 p.m. | OK | GNU C++ | TESTS | 294 | 46 | 2048000 | 2500 | |
34927722 | vjudge2 | C | Feb. 4, 2018, 5:25 p.m. | OK | GNU C++ | TESTS | 294 | 78 | 34201600 | 2500 | |
23066912 | dwjshift | C | Dec. 17, 2016, 6:03 p.m. | OK | GNU C++ | TESTS | 294 | 78 | 36556800 | 2500 | |
26777173 | jiyutian | C | May 1, 2017, 1:55 a.m. | OK | GNU C++ | TESTS | 294 | 78 | 38400000 | 2500 | |
34986856 | vjudge2 | C | Feb. 7, 2018, 3:12 a.m. | OK | GNU C++ | TESTS | 294 | 92 | 34406400 | 2500 | |
31968686 | vjudge4 | C | Nov. 2, 2017, 5:33 a.m. | OK | GNU C++ | TESTS | 294 | 93 | 31846400 | 2500 | |
31968646 | zhzh2001 | C | Nov. 2, 2017, 5:30 a.m. | OK | GNU C++ | TESTS | 294 | 93 | 31846400 | 2500 | |
31977758 | vjudge3 | C | Nov. 2, 2017, 11:31 a.m. | OK | GNU C++ | TESTS | 294 | 93 | 32358400 | 2500 | |
31966729 | vjudge2 | C | Nov. 2, 2017, 2:52 a.m. | OK | GNU C++ | TESTS | 294 | 93 | 33382400 | 2500 | |
34932614 | vjudge1 | C | Feb. 5, 2018, 1:22 a.m. | OK | GNU C++ | TESTS | 294 | 93 | 34406400 | 2500 | |
23355874 | Ali.Pi | C | Dec. 27, 2016, 9:09 a.m. | OK | GNU C++11 | TESTS | 294 | 77 | 2048000 | 2500 | |
63122479 | xhz | C | Oct. 22, 2019, 11:46 a.m. | OK | GNU C++11 | TESTS | 294 | 78 | 32358400 | 2500 | |
24628639 | King_George | C | Feb. 13, 2017, 1:29 p.m. | OK | GNU C++11 | TESTS | 294 | 78 | 37068800 | 2500 | |
69879886 | liuweih | C | Jan. 31, 2020, 5:56 a.m. | OK | GNU C++11 | TESTS | 294 | 93 | 32358400 | 2500 | |
31984223 | vjudge5 | C | Nov. 2, 2017, 3:08 p.m. | OK | GNU C++11 | TESTS | 294 | 93 | 32358400 | 2500 | |
31966681 | zhouyuyang | C | Nov. 2, 2017, 2:47 a.m. | OK | GNU C++11 | TESTS | 294 | 93 | 33382400 | 2500 | |
63122981 | Rainbow_sjy | C | Oct. 22, 2019, 11:56 a.m. | OK | GNU C++11 | TESTS | 294 | 93 | 33587200 | 2500 | |
23071209 | Twishkle.Aevdark | C | Dec. 17, 2016, 6:34 p.m. | OK | GNU C++11 | TESTS | 294 | 93 | 33894400 | 2500 | |
23063390 | KADR | C | Dec. 17, 2016, 5:36 p.m. | OK | GNU C++11 | TESTS | 294 | 93 | 33894400 | 2500 | |
23062926 | al13n | C | Dec. 17, 2016, 5:33 p.m. | OK | GNU C++11 | TESTS | 294 | 93 | 33894400 | 2500 | |
23806010 | dipta1010 | C | Jan. 14, 2017, 12:46 p.m. | OK | GNU C++14 | TESTS | 294 | 46 | 1945600 | 2500 | |
23358735 | Ali.Pi | C | Dec. 27, 2016, 12:18 p.m. | OK | GNU C++14 | TESTS | 294 | 46 | 1945600 | 2500 | |
40983012 | ReaLNero1 | C | July 30, 2018, 6:41 p.m. | OK | GNU C++14 | TESTS | 294 | 62 | 0 | 2500 | |
23169935 | NiroBC | C | Dec. 20, 2016, 5:21 a.m. | OK | GNU C++14 | TESTS | 294 | 62 | 34508800 | 2500 | |
23066040 | I_love_Hoang_Yen | C | Dec. 17, 2016, 5:56 p.m. | OK | GNU C++14 | TESTS | 294 | 78 | 31641600 | 2500 | |
34277574 | hjsjhn | C | Jan. 18, 2018, 1:55 p.m. | OK | GNU C++14 | TESTS | 294 | 78 | 34201600 | 2500 | |
34274868 | justin_cao | C | Jan. 18, 2018, 12:02 p.m. | OK | GNU C++14 | TESTS | 294 | 92 | 34201600 | 2500 | |
44404976 | Lynstery | C | Oct. 16, 2018, 2:27 p.m. | OK | GNU C++14 | TESTS | 294 | 93 | 32358400 | 2500 | |
23076941 | kzoacn | C | Dec. 18, 2016, 4:42 a.m. | OK | GNU C++14 | TESTS | 294 | 93 | 32358400 | 2500 | |
61398024 | _DYT | C | Sept. 28, 2019, 3:36 a.m. | OK | GNU C++14 | TESTS | 294 | 93 | 33382400 | 2500 | |
40687467 | chenyeyuan | C | July 24, 2018, 3:17 a.m. | OK | GNU C++17 | TESTS | 294 | 93 | 32256000 | 2500 | |
46957749 | xielinhan | C | Dec. 13, 2018, 5:48 a.m. | OK | GNU C++17 | TESTS | 294 | 93 | 64614400 | 2500 | |
67027812 | ZXyang HeRaNO krazy | C | Dec. 16, 2019, 2:54 p.m. | OK | GNU C++17 | TESTS | 294 | 108 | 63590400 | 2500 | |
67296037 | karasek | C | Dec. 20, 2019, 4:58 p.m. | OK | GNU C++17 | TESTS | 294 | 109 | 31846400 | 2500 | |
56046821 | pkgunboat | C | June 25, 2019, 5:01 p.m. | OK | GNU C++17 | TESTS | 294 | 109 | 68812800 | 2500 | |
43945880 | MazyCrazy | C | Oct. 7, 2018, 1:40 p.m. | OK | GNU C++17 | TESTS | 294 | 124 | 0 | 2500 | |
43945650 | MazyCrazy | C | Oct. 7, 2018, 1:35 p.m. | OK | GNU C++17 | TESTS | 294 | 124 | 0 | 2500 | |
40580502 | wangxvdong | C | July 20, 2018, 2:01 p.m. | OK | GNU C++17 | TESTS | 294 | 124 | 32358400 | 2500 | |
52310651 | Rzepa | C | April 4, 2019, 2:28 p.m. | OK | GNU C++17 | TESTS | 294 | 124 | 48947200 | 2500 | |
56599782 | kefaa2 | C | July 5, 2019, 10:27 p.m. | OK | GNU C++17 | TESTS | 294 | 124 | 68300800 | 2500 | |
23080428 | Musin | C | Dec. 18, 2016, 8:59 a.m. | OK | Java 8 | TESTS | 294 | 295 | 39219200 | 2500 | |
23074393 | darnley | C | Dec. 17, 2016, 11:18 p.m. | OK | Java 8 | TESTS | 294 | 296 | 39219200 | 2500 | |
23080478 | Musin | C | Dec. 18, 2016, 9:01 a.m. | OK | Java 8 | TESTS | 294 | 311 | 39219200 | 2500 | |
23080520 | Musin | C | Dec. 18, 2016, 9:04 a.m. | OK | Java 8 | TESTS | 294 | 327 | 39219200 | 2500 | |
23080370 | Musin | C | Dec. 18, 2016, 8:56 a.m. | OK | Java 8 | TESTS | 294 | 342 | 77824000 | 2500 | |
23060351 | Petr | C | Dec. 17, 2016, 5:16 p.m. | OK | Java 8 | TESTS | 294 | 343 | 27648000 | 2500 | |
23060778 | ilyakor | C | Dec. 17, 2016, 5:18 p.m. | OK | Java 8 | TESTS | 294 | 358 | 61747200 | 2500 | |
23075758 | Dukkha | C | Dec. 18, 2016, 2:28 a.m. | OK | Java 8 | TESTS | 294 | 374 | 38400000 | 2500 | |
23064633 | darnley | C | Dec. 17, 2016, 5:45 p.m. | OK | Java 8 | TESTS | 294 | 374 | 61747200 | 2500 | |
23059686 | qwerty787788 | C | Dec. 17, 2016, 5:12 p.m. | OK | Java 8 | TESTS | 294 | 436 | 56115200 | 2500 | |
27183137 | camypaper | C | May 17, 2017, 3:56 p.m. | OK | MS C# | TESTS | 294 | 218 | 36761600 | 2500 | |
23063044 | natalia | C | Dec. 17, 2016, 5:34 p.m. | OK | MS C++ | TESTS | 294 | 78 | 34918400 | 2500 | |
23067864 | Oleg_Smirnov | C | Dec. 17, 2016, 6:11 p.m. | OK | MS C++ | TESTS | 294 | 109 | 39424000 | 2500 | |
23280728 | BaturaDima | C | Dec. 24, 2016, 11:40 p.m. | OK | MS C++ | TESTS | 294 | 124 | 37171200 | 2500 | |
23280754 | BaturaDima | C | Dec. 24, 2016, 11:44 p.m. | OK | MS C++ | TESTS | 294 | 155 | 37376000 | 2500 | |
23236585 | Filyan | C | Dec. 22, 2016, 9:09 p.m. | OK | MS C++ | TESTS | 294 | 155 | 40140800 | 2500 | |
23280642 | BaturaDima | C | Dec. 24, 2016, 11:24 p.m. | OK | MS C++ | TESTS | 294 | 233 | 36864000 | 2500 | |
23280698 | BaturaDima | C | Dec. 24, 2016, 11:35 p.m. | OK | MS C++ | TESTS | 294 | 234 | 36864000 | 2500 | |
23280687 | BaturaDima | C | Dec. 24, 2016, 11:33 p.m. | OK | MS C++ | TESTS | 294 | 389 | 48537600 | 2500 | |
23064004 | Taube | C | Dec. 17, 2016, 5:40 p.m. | OK | MS C++ | TESTS | 294 | 546 | 88473600 | 2500 | |
23069773 | sdya | C | Dec. 17, 2016, 6:27 p.m. | OK | MS C++ | TESTS | 294 | 1981 | 39321600 | 2500 | |
26903076 | ASoboll | C | May 6, 2017, 2:07 p.m. | OK | Scala | TESTS | 294 | 1496 | 54374400 | 2500 | |
26903214 | ASoboll | C | May 6, 2017, 2:13 p.m. | OK | Scala | TESTS | 294 | 1871 | 54272000 | 2500 |
Back to search problems