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 |
|---|---|---|---|---|---|---|
| 626 | 8VC Venture Cup 2016 - Elimination Round | FINISHED | False | 9000 | 321020723 | Feb. 13, 2016, 5:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 606 ) | G | Raffles | PROGRAMMING | data structures dp greedy math | 3000 |
Johnny is at a carnival which has n raffles. Raffle i has a prize with value p i . Each participant can put tickets in whichever raffles they choose (they may have more than one ticket in a single raffle). At the end of the carnival, one ticket is selected at random from each raffle, and the owner of the ticket wins the associated prize. A single person can win multiple prizes from different raffles. However, county rules prevent any one participant from owning more than half the tickets in a single raffle, i.e. putting more tickets in the raffle than all the other participants combined. To help combat this (and possibly win some prizes), the organizers started by placing a single ticket in each raffle, which they will never remove. Johnny bought t tickets and is wondering where to place them. Currently, there are a total of l i tickets in the i -th raffle. He watches as other participants place tickets and modify their decisions and, at every moment in time, wants to know how much he can possibly earn. Find the maximum possible expected value of Johnny's winnings at each moment if he distributes his tickets optimally. Johnny may redistribute all of his tickets arbitrarily between each update, but he may not place more than t tickets total or have more tickets in a single raffle than all other participants combined. The first line contains two integers n , t , and q ( 1 ≤ n , t , q ≤ 200 000 ) — the number of raffles, the number of tickets Johnny has, and the total number of updates, respectively. The second line contains n space-separated integers p i ( 1 ≤ p i ≤ 1000 ) — the value of the i -th prize. The third line contains n space-separated integers l i ( 1 ≤ l i ≤ 1000 ) — the number of tickets initially in the i -th raffle. The last q lines contain the descriptions of the updates. Each description contains two integers t k , r k ( 1 ≤ t k ≤ 2 , 1 ≤ r k ≤ n ) — the type of the update and the raffle number. An update of type 1 represents another partici |
| 23522 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 27824229 | laofudasuan | G | June 16, 2017, 11:58 a.m. | OK | GNU C++ | TESTS | 82 | 358 | 48128000 | 3000 | |
| 27836003 | jiyutian | G | June 17, 2017, 1:52 a.m. | OK | GNU C++ | TESTS | 82 | 373 | 11878400 | 3000 | |
| 31631349 | vjudge4 | G | Oct. 23, 2017, 1:56 p.m. | OK | GNU C++ | TESTS | 82 | 389 | 30105600 | 3000 | |
| 16002054 | LayCurse | G | Feb. 13, 2016, 7:01 p.m. | OK | GNU C++ | TESTS | 82 | 389 | 80793600 | 3000 | |
| 17829783 | Owaski | G | May 10, 2016, 9:48 a.m. | OK | GNU C++ | TESTS | 82 | 390 | 50380800 | 3000 | |
| 40985164 | ReaLNero1 | G | July 30, 2018, 7:47 p.m. | OK | GNU C++ | TESTS | 82 | 405 | 11878400 | 3000 | |
| 16830000 | Zarxdy34 | G | March 20, 2016, 2:18 a.m. | OK | GNU C++ | TESTS | 82 | 405 | 14848000 | 3000 | |
| 17871928 | luoyuchu | G | May 12, 2016, 8:05 a.m. | OK | GNU C++ | TESTS | 82 | 405 | 29696000 | 3000 | |
| 17186630 | Arturia | G | April 6, 2016, 12:44 p.m. | OK | GNU C++ | TESTS | 82 | 420 | 14028800 | 3000 | |
| 18910984 | AkaneSasu | G | July 6, 2016, 3:48 a.m. | OK | GNU C++ | TESTS | 82 | 421 | 11878400 | 3000 | |
| 65573602 | XieRujian | G | Nov. 23, 2019, 8:39 a.m. | OK | GNU C++11 | TESTS | 82 | 296 | 35942400 | 3000 | |
| 56073672 | dyxg | G | June 26, 2019, 11:47 a.m. | OK | GNU C++11 | TESTS | 82 | 327 | 11878400 | 3000 | |
| 44547032 | luogu_bot1 | G | Oct. 19, 2018, 1:52 p.m. | OK | GNU C++11 | TESTS | 82 | 358 | 28057600 | 3000 | |
| 44424212 | jzqjzq | G | Oct. 17, 2018, 2:43 a.m. | OK | GNU C++11 | TESTS | 82 | 374 | 28057600 | 3000 | |
| 44525397 | nn020701 | G | Oct. 19, 2018, 1:46 a.m. | OK | GNU C++11 | TESTS | 82 | 389 | 34508800 | 3000 | |
| 44338545 | q234rty | G | Oct. 15, 2018, 12:38 a.m. | OK | GNU C++11 | TESTS | 82 | 389 | 51712000 | 3000 | |
| 44346204 | luogu_bot4 | G | Oct. 15, 2018, 7:28 a.m. | OK | GNU C++11 | TESTS | 82 | 390 | 72192000 | 3000 | |
| 16427557 | krijgertje | G | Feb. 29, 2016, 2:27 p.m. | OK | GNU C++11 | TESTS | 82 | 405 | 8806400 | 3000 | |
| 53005569 | LJC00118 | G | April 19, 2019, 9:24 a.m. | OK | GNU C++11 | TESTS | 82 | 405 | 18432000 | 3000 | |
| 64719173 | boshi | G | Nov. 12, 2019, 1:55 a.m. | OK | GNU C++11 | TESTS | 82 | 405 | 34508800 | 3000 | |
| 65402912 | nqiiii | G | Nov. 20, 2019, 12:28 a.m. | OK | GNU C++14 | TESTS | 82 | 452 | 24268800 | 3000 | |
| 69604242 | orbitingflea | G | Jan. 27, 2020, 9:06 a.m. | OK | GNU C++14 | TESTS | 82 | 483 | 17100800 | 3000 | |
| 66577242 | Created_equal | G | Dec. 10, 2019, 7:53 a.m. | OK | GNU C++14 | TESTS | 82 | 498 | 38707200 | 3000 | |
| 69603999 | orbitingflea | G | Jan. 27, 2020, 9:01 a.m. | OK | GNU C++14 | TESTS | 82 | 499 | 17100800 | 3000 | |
| 68038981 | nealchen | G | Jan. 1, 2020, 1:26 p.m. | OK | GNU C++14 | TESTS | 82 | 514 | 11059200 | 3000 | |
| 63911593 | Jayce132 | G | Oct. 31, 2019, 8:30 a.m. | OK | GNU C++14 | TESTS | 82 | 545 | 19660800 | 3000 | |
| 64731193 | Cyanic | G | Nov. 12, 2019, 8:30 a.m. | OK | GNU C++14 | TESTS | 82 | 545 | 22425600 | 3000 | |
| 31678834 | q234rty | G | Oct. 24, 2017, 11:19 a.m. | OK | GNU C++14 | TESTS | 82 | 545 | 53657600 | 3000 | |
| 68397099 | wucstdio | G | Jan. 8, 2020, 11:33 a.m. | OK | GNU C++14 | TESTS | 82 | 546 | 26419200 | 3000 | |
| 31678884 | vjudge1 | G | Oct. 24, 2017, 11:21 a.m. | OK | GNU C++14 | TESTS | 82 | 546 | 53657600 | 3000 | |
| 66277255 | HirasawaaYui | G | Dec. 4, 2019, 3:13 p.m. | OK | GNU C++17 | TESTS | 82 | 483 | 28057600 | 3000 | |
| 45683840 | Pakalns | G | Nov. 13, 2018, 4:50 p.m. | OK | GNU C++17 | TESTS | 82 | 530 | 31948800 | 3000 | |
| 67267406 | vjudge4 | G | Dec. 20, 2019, 6:45 a.m. | OK | GNU C++17 | TESTS | 82 | 733 | 35328000 | 3000 | |
| 69649236 | ruo | G | Jan. 28, 2020, 4:03 a.m. | OK | GNU C++17 | TESTS | 82 | 795 | 37683200 | 3000 | |
| 66899618 | vjudge4 | G | Dec. 15, 2019, 4:41 a.m. | OK | GNU C++17 | TESTS | 82 | 842 | 11161600 | 3000 | |
| 66899589 | LJZ_C | G | Dec. 15, 2019, 4:40 a.m. | OK | GNU C++17 | TESTS | 82 | 888 | 11161600 | 3000 | |
| 64879814 | AprilGrimoire | G | Nov. 14, 2019, 11:16 a.m. | OK | GNU C++17 | TESTS | 82 | 888 | 13516800 | 3000 | |
| 57883953 | Kmcode | G | July 28, 2019, 9 a.m. | OK | GNU C++17 | TESTS | 82 | 951 | 32870400 | 3000 | |
| 68340215 | Elegia | G | Jan. 7, 2020, 2:48 a.m. | OK | GNU C++17 | TESTS | 82 | 1154 | 12800000 | 3000 | |
| 61075085 | Rzepa | G | Sept. 22, 2019, 2:07 p.m. | OK | GNU C++17 | TESTS | 82 | 1216 | 58368000 | 3000 | |
| 16006435 | Egor | G | Feb. 13, 2016, 7:52 p.m. | OK | Java 8 | TESTS | 82 | 842 | 0 | 3000 | |
| 16010949 | winger | G | Feb. 14, 2016, 12:26 a.m. | OK | Java 8 | TESTS | 82 | 1123 | 15769600 | 3000 | |
| 16268902 | 2oo7 | G | Feb. 21, 2016, 10:40 p.m. | OK | Java 8 | TESTS | 82 | 1902 | 37683200 | 3000 | |
| 16319135 | edorundo | G | Feb. 25, 2016, 2:26 a.m. | OK | Java 8 | TESTS | 82 | 2293 | 44953600 | 3000 | |
| 16319139 | edorundo | G | Feb. 25, 2016, 2:27 a.m. | OK | Java 8 | TESTS | 82 | 2464 | 44953600 | 3000 | |
| 16003848 | Petr | G | Feb. 13, 2016, 7:22 p.m. | OK | Java 8 | TESTS | 82 | 2901 | 42803200 | 3000 | |
| 16068884 | Milanin | G | Feb. 17, 2016, 10:18 a.m. | OK | MS C++ | TESTS | 82 | 1481 | 21708800 | 3000 | |
| 16009288 | izban | G | Feb. 13, 2016, 9:01 p.m. | OK | MS C++ | TESTS | 82 | 1481 | 27750400 | 3000 |
Back to search problems