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 |
|---|---|---|---|---|---|---|
| 865 | MemSQL Start[c]UP 3.0 - Round 2 (onsite finalists) | FINISHED | False | 10800 | 269614523 | Sept. 30, 2017, 5:05 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 936 ) | C | Gotta Go Fast | PROGRAMMING | binary search dp | 2500 |
You're trying to set the record on your favorite video game. The game consists of N levels, which must be completed sequentially in order to beat the game. You usually complete each level as fast as possible, but sometimes finish a level slower. Specifically, you will complete the i -th level in either F i seconds or S i seconds, where F i < S i , and there's a P i percent chance of completing it in F i seconds. After completing a level, you may decide to either continue the game and play the next level, or reset the game and start again from the first level. Both the decision and the action are instant. Your goal is to complete all the levels sequentially in at most R total seconds. You want to minimize the expected amount of time playing before achieving that goal. If you continue and reset optimally, how much total time can you expect to spend playing? The first line of input contains integers N and R , the number of levels and number of seconds you want to complete the game in, respectively. N lines follow. The i th such line contains integers F i , S i , P i (1 ≤ F i < S i ≤ 100, 80 ≤ P i ≤ 99) , the fast time for level i , the slow time for level i , and the probability (as a percentage) of completing level i with the fast time. Print the total expected time. Your answer must be correct within an absolute or relative error of 10 - 9 . Formally, let your answer be a , and the jury's answer be b . Your answer will be considered correct, if . In the first example, you never need to reset. There's an 81% chance of completing the level in 2 seconds and a 19% chance of needing 8 seconds, both of which are within the goal time. The expected time is 0.81·2 + 0.19·8 = 3.14 . In the second example, you should reset after the first level if you complete it slowly. On average it will take 0.25 slow attempts before your first fast attempt. Then it doesn't matter whether you complete the second level fast or slow. The expected time is 0.25·30 + 20 + 0.85·3 + 0.15· |
| MemSQL Start[c]UP 3.0 Round 2 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 30960971 | asaveljevs | C | Oct. 3, 2017, 7:34 a.m. | OK | GNU C++ | TESTS | 40 | 46 | 1843200 | 2500 | |
| 31059883 | FoolPerson | C | Oct. 6, 2017, 8:31 a.m. | OK | GNU C++ | TESTS | 40 | 46 | 2252800 | 2500 | |
| 36656859 | Allunlimited | C | March 27, 2018, 1:49 a.m. | OK | GNU C++ | TESTS | 40 | 46 | 6348800 | 2500 | |
| 31213627 | newCEA | C | Oct. 11, 2017, 10:43 a.m. | OK | GNU C++ | TESTS | 40 | 61 | 2560000 | 2500 | |
| 36656863 | Allunlimited | C | March 27, 2018, 1:49 a.m. | OK | GNU C++ | TESTS | 40 | 62 | 6348800 | 2500 | |
| 32372833 | vjudge5 | C | Nov. 17, 2017, 8:31 a.m. | OK | GNU C++ | TESTS | 40 | 77 | 2048000 | 2500 | |
| 32531060 | DS-K | C | Nov. 21, 2017, 4:39 p.m. | OK | GNU C++ | TESTS | 40 | 78 | 2048000 | 2500 | |
| 40543427 | OYZYWIN | C | July 19, 2018, 10:08 a.m. | OK | GNU C++ | TESTS | 40 | 93 | 3584000 | 2500 | |
| 31686053 | vjudge4 | C | Oct. 24, 2017, 2:58 p.m. | OK | GNU C++ | TESTS | 40 | 93 | 4300800 | 2500 | |
| 31484865 | Renaissanceharry | C | Oct. 18, 2017, 3:10 p.m. | OK | GNU C++ | TESTS | 40 | 109 | 7168000 | 2500 | |
| 40979625 | ReaLNero1 | C | July 30, 2018, 5:10 p.m. | OK | GNU C++11 | TESTS | 40 | 31 | 102400 | 2500 | |
| 57482310 | vjudge1 | C | July 22, 2019, 3:04 a.m. | OK | GNU C++11 | TESTS | 40 | 46 | 1945600 | 2500 | |
| 59070424 | luogu_bot2 | C | Aug. 19, 2019, 4:24 a.m. | OK | GNU C++11 | TESTS | 40 | 46 | 2048000 | 2500 | |
| 59070366 | luogu_bot5 | C | Aug. 19, 2019, 4:22 a.m. | OK | GNU C++11 | TESTS | 40 | 46 | 2048000 | 2500 | |
| 57252845 | vjudge3 | C | July 18, 2019, 12:49 a.m. | OK | GNU C++11 | TESTS | 40 | 46 | 2048000 | 2500 | |
| 57252844 | rqbqbqb | C | July 18, 2019, 12:49 a.m. | OK | GNU C++11 | TESTS | 40 | 46 | 2048000 | 2500 | |
| 57188276 | vjudge3 | C | July 17, 2019, 9:29 a.m. | OK | GNU C++11 | TESTS | 40 | 46 | 2048000 | 2500 | |
| 57188146 | zztao | C | July 17, 2019, 9:26 a.m. | OK | GNU C++11 | TESTS | 40 | 46 | 2048000 | 2500 | |
| 57187156 | zztao | C | July 17, 2019, 9:02 a.m. | OK | GNU C++11 | TESTS | 40 | 46 | 2048000 | 2500 | |
| 55113065 | luogu_bot3 | C | June 5, 2019, 7:21 a.m. | OK | GNU C++11 | TESTS | 40 | 46 | 2048000 | 2500 | |
| 30902027 | wtw | C | Oct. 1, 2017, 7:39 a.m. | OK | GNU C++14 | TESTS | 40 | 46 | 2150400 | 2500 | |
| 57176035 | vjudge5 | C | July 17, 2019, 5:34 a.m. | OK | GNU C++14 | TESTS | 40 | 46 | 2252800 | 2500 | |
| 30878419 | Belonogov | C | Sept. 30, 2017, 6 p.m. | OK | GNU C++14 | TESTS | 40 | 46 | 2457600 | 2500 | |
| 30955014 | FwP | C | Oct. 3, 2017, 12:18 a.m. | OK | GNU C++14 | TESTS | 40 | 46 | 3174400 | 2500 | |
| 33959186 | CQzhangyu | C | Jan. 6, 2018, 8:37 a.m. | OK | GNU C++14 | TESTS | 40 | 46 | 4198400 | 2500 | |
| 30896588 | Aviously | C | Oct. 1, 2017, 2:21 a.m. | OK | GNU C++14 | TESTS | 40 | 61 | 2457600 | 2500 | |
| 57193906 | Peter_Z | C | July 17, 2019, 11:34 a.m. | OK | GNU C++14 | TESTS | 40 | 62 | 2457600 | 2500 | |
| 55114084 | vjudge4 | C | June 5, 2019, 7:49 a.m. | OK | GNU C++14 | TESTS | 40 | 62 | 2457600 | 2500 | |
| 30896707 | Aviously | C | Oct. 1, 2017, 2:31 a.m. | OK | GNU C++14 | TESTS | 40 | 62 | 2457600 | 2500 | |
| 37142704 | shaochengxi | C | April 10, 2018, 11:36 a.m. | OK | GNU C++14 | TESTS | 40 | 62 | 5734400 | 2500 | |
| 42610474 | vjudge4 | C | Sept. 7, 2018, 10:41 a.m. | OK | GNU C++17 | TESTS | 40 | 46 | 2150400 | 2500 | |
| 47280596 | luogu_bot3 | C | Dec. 20, 2018, 12:08 a.m. | OK | GNU C++17 | TESTS | 40 | 46 | 2252800 | 2500 | |
| 50704920 | vjudge2 | C | March 3, 2019, 2:53 a.m. | OK | GNU C++17 | TESTS | 40 | 46 | 2457600 | 2500 | |
| 36656892 | nkwhy | C | March 27, 2018, 1:53 a.m. | OK | GNU C++17 | TESTS | 40 | 46 | 7168000 | 2500 | |
| 55119908 | vjudge2 | C | June 5, 2019, 10:34 a.m. | OK | GNU C++17 | TESTS | 40 | 61 | 2252800 | 2500 | |
| 57263680 | vjudge1 | C | July 18, 2019, 6:19 a.m. | OK | GNU C++17 | TESTS | 40 | 61 | 2969600 | 2500 | |
| 55119818 | somuch | C | June 5, 2019, 10:32 a.m. | OK | GNU C++17 | TESTS | 40 | 62 | 2252800 | 2500 | |
| 53731252 | luogu_bot4 | C | May 4, 2019, 7:19 a.m. | OK | GNU C++17 | TESTS | 40 | 62 | 2252800 | 2500 | |
| 58470563 | 1351593868 | C | Aug. 8, 2019, 11:37 p.m. | OK | GNU C++17 | TESTS | 40 | 62 | 2457600 | 2500 | |
| 57266439 | vjudge1 | C | July 18, 2019, 7:20 a.m. | OK | GNU C++17 | TESTS | 40 | 77 | 2252800 | 2500 | |
| 30876696 | Lewin | C | Sept. 30, 2017, 5:34 p.m. | OK | Java 8 | TESTS | 40 | 343 | 0 | 2500 | |
| 32826707 | R.coder | C | Dec. 1, 2017, 10:19 a.m. | OK | Java 8 | TESTS | 40 | 592 | 21913600 | 2500 | |
| 30877438 | xiaowuc1 | C | Sept. 30, 2017, 5:44 p.m. | OK | Java 8 | TESTS | 40 | 655 | 0 | 2500 | |
| 58915207 | vjudge1 | C | Aug. 16, 2019, 2:41 p.m. | OK | MS C++ | TESTS | 40 | 46 | 2560000 | 2500 | |
| 58477970 | vjudge1 | C | Aug. 9, 2019, 3:58 a.m. | OK | MS C++ | TESTS | 40 | 62 | 2150400 | 2500 | |
| 58864914 | vjudge1 | C | Aug. 15, 2019, 12:59 p.m. | OK | MS C++ | TESTS | 40 | 78 | 2252800 | 2500 | |
| 58911886 | vjudge5 | C | Aug. 16, 2019, 1:24 p.m. | OK | MS C++ | TESTS | 40 | 78 | 2457600 | 2500 | |
| 52309540 | chinmay0906 | C | April 4, 2019, 1:58 p.m. | OK | MS C++ 2017 | TESTS | 40 | 62 | 2048000 | 2500 |
Back to search problems