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 |
|---|---|---|---|---|---|---|
| 553 | Codeforces Round 309 (Div. 1) | FINISHED | False | 7800 | 341242223 | June 24, 2015, 4:30 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 620 ) | E | Kyoya and Train | PROGRAMMING | dp fft graphs math probabilities | 3300 |
Kyoya Ootori wants to take the train to get to school. There are n train stations and m one-way train lines going between various stations. Kyoya is currently at train station 1 , and the school is at station n . To take a train, he must pay for a ticket, and the train also takes a certain amount of time. However, the trains are not perfect and take random amounts of time to arrive at their destination. If Kyoya arrives at school strictly after t time units, he will have to pay a fine of x . Each train line is described by a ticket price, and a probability distribution on the time the train takes. More formally, train line i has ticket cost c i , and a probability distribution p i , k which denotes the probability that this train will take k time units for all 1 ≤ k ≤ t . Amounts of time that each of the trains used by Kyouya takes are mutually independent random values (moreover, if Kyoya travels along the same train more than once, it is possible for the train to take different amounts of time and those amounts are also independent one from another). Kyoya wants to get to school by spending the least amount of money in expectation (for the ticket price plus possible fine for being late). Of course, Kyoya has an optimal plan for how to get to school, and every time he arrives at a train station, he may recalculate his plan based on how much time he has remaining. What is the expected cost that Kyoya will pay to get to school if he moves optimally? The first line of input contains four integers n , m , t , x ( 2 ≤ n ≤ 50 , 1 ≤ m ≤ 100 , 1 ≤ t ≤ 20 000 , 0 ≤ x ≤ 10 6 ). The next 2 m lines contain the description of the trains. The 2 i -th line will have 3 integers a i , b i , c i , representing a one way train from station a i to b i with ticket cost c i ( 1 ≤ a i , b i ≤ n , a i ≠ b i , 0 ≤ c i ≤ 10 6 ). There will always be at least one path from any station to the school. The (2 i + 1) -th line will contain t integers, p i , 1 , p i , 2 , ..., p i , t wh |
| Codeforces Round #309 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 21754559 | vintage_Vlad_Makeev | E | Oct. 24, 2016, 4:32 p.m. | OK | GNU C | TESTS | 56 | 3759 | 242176000 | 3300 | |
| 21754750 | vintage_Vlad_Makeev | E | Oct. 24, 2016, 4:42 p.m. | OK | GNU C | TESTS | 56 | 3774 | 242176000 | 3300 | |
| 28383280 | 248926 | E | July 9, 2017, 8:13 a.m. | OK | GNU C++ | TESTS | 56 | 982 | 179097600 | 3300 | |
| 28383199 | 248926 | E | July 9, 2017, 8:07 a.m. | OK | GNU C++ | TESTS | 56 | 1153 | 179097600 | 3300 | |
| 40986444 | ReaLNero1 | E | July 30, 2018, 8:33 p.m. | OK | GNU C++ | TESTS | 56 | 1154 | 176947200 | 3300 | |
| 28380165 | 248926 | E | July 9, 2017, 4:04 a.m. | OK | GNU C++ | TESTS | 56 | 1403 | 414105600 | 3300 | |
| 28380529 | MarkF | E | July 9, 2017, 4:43 a.m. | OK | GNU C++ | TESTS | 56 | 1606 | 414105600 | 3300 | |
| 28380527 | stneng | E | July 9, 2017, 4:42 a.m. | OK | GNU C++ | TESTS | 56 | 1716 | 197324800 | 3300 | |
| 28380119 | Chloe_fan | E | July 9, 2017, 4:01 a.m. | OK | GNU C++ | TESTS | 56 | 2433 | 182067200 | 3300 | |
| 27749937 | tbw1033 | E | June 13, 2017, 6:18 a.m. | OK | GNU C++ | TESTS | 56 | 2729 | 124928000 | 3300 | |
| 27749983 | tbw1033 | E | June 13, 2017, 6:21 a.m. | OK | GNU C++ | TESTS | 56 | 2869 | 124928000 | 3300 | |
| 37343581 | zhouzhendong | E | April 15, 2018, 4:50 a.m. | OK | GNU C++ | TESTS | 56 | 3073 | 47718400 | 3300 | |
| 66087530 | Hazyknight | E | Dec. 1, 2019, 5:45 a.m. | OK | GNU C++11 | TESTS | 56 | 1107 | 138035200 | 3300 | |
| 21112389 | MohanLau | E | Oct. 2, 2016, 10:55 a.m. | OK | GNU C++11 | TESTS | 56 | 1700 | 412057600 | 3300 | |
| 28380495 | stneng | E | July 9, 2017, 4:38 a.m. | OK | GNU C++11 | TESTS | 56 | 1747 | 197324800 | 3300 | |
| 64741699 | ilnil | E | Nov. 12, 2019, 12:12 p.m. | OK | GNU C++11 | TESTS | 56 | 1965 | 58163200 | 3300 | |
| 64556111 | cuizhuyefei | E | Nov. 9, 2019, 3:49 a.m. | OK | GNU C++11 | TESTS | 56 | 2214 | 64512000 | 3300 | |
| 51113654 | Lagoon_ | E | March 10, 2019, 5:53 a.m. | OK | GNU C++11 | TESTS | 56 | 2215 | 279859200 | 3300 | |
| 65027392 | cjy2003 | E | Nov. 15, 2019, 8:20 a.m. | OK | GNU C++11 | TESTS | 56 | 2262 | 53657600 | 3300 | |
| 12340453 | krijgertje | E | Aug. 4, 2015, 3:37 p.m. | OK | GNU C++11 | TESTS | 56 | 2401 | 179916800 | 3300 | |
| 35906059 | cxt | E | March 4, 2018, 3:30 a.m. | OK | GNU C++11 | TESTS | 56 | 2402 | 43008000 | 3300 | |
| 21112315 | MohanLau | E | Oct. 2, 2016, 10:52 a.m. | OK | GNU C++11 | TESTS | 56 | 2464 | 144179200 | 3300 | |
| 68152173 | nealchen | E | Jan. 4, 2020, 7:22 a.m. | OK | GNU C++14 | TESTS | 56 | 1092 | 357273600 | 3300 | |
| 35328751 | superguymj | E | Feb. 16, 2018, 6:44 a.m. | OK | GNU C++14 | TESTS | 56 | 1777 | 51404800 | 3300 | |
| 28382879 | Trixie | E | July 9, 2017, 7:42 a.m. | OK | GNU C++14 | TESTS | 56 | 1871 | 417280000 | 3300 | |
| 68434575 | lyx_cjz | E | Jan. 9, 2020, 8:26 a.m. | OK | GNU C++14 | TESTS | 56 | 2230 | 98304000 | 3300 | |
| 69219914 | BJpers3 | E | Jan. 21, 2020, 3:51 a.m. | OK | GNU C++14 | TESTS | 56 | 2402 | 76185600 | 3300 | |
| 63131283 | Cyanic | E | Oct. 22, 2019, 2:18 p.m. | OK | GNU C++14 | TESTS | 56 | 2448 | 136294400 | 3300 | |
| 66614851 | mayaohua2003 | E | Dec. 11, 2019, 2:45 a.m. | OK | GNU C++14 | TESTS | 56 | 2558 | 36454400 | 3300 | |
| 35827971 | orbitingflea | E | March 2, 2018, 7:25 a.m. | OK | GNU C++14 | TESTS | 56 | 2636 | 134553600 | 3300 | |
| 63130708 | Cyanic | E | Oct. 22, 2019, 2:06 p.m. | OK | GNU C++14 | TESTS | 56 | 2651 | 136192000 | 3300 | |
| 50768303 | qiqi20021026 | E | March 4, 2019, 1:17 a.m. | OK | GNU C++14 | TESTS | 56 | 2776 | 324300800 | 3300 | |
| 69833403 | gongsuidashen | E | Jan. 30, 2020, 11:11 a.m. | OK | GNU C++17 | TESTS | 56 | 1201 | 177152000 | 3300 | |
| 69422059 | skip1978 | E | Jan. 23, 2020, 2:41 p.m. | OK | GNU C++17 | TESTS | 56 | 2168 | 164761600 | 3300 | |
| 69422623 | skip1978 | E | Jan. 23, 2020, 2:50 p.m. | OK | GNU C++17 | TESTS | 56 | 2183 | 90726400 | 3300 | |
| 69422197 | skip1978 | E | Jan. 23, 2020, 2:43 p.m. | OK | GNU C++17 | TESTS | 56 | 2199 | 90726400 | 3300 | |
| 69421777 | skip1978 | E | Jan. 23, 2020, 2:36 p.m. | OK | GNU C++17 | TESTS | 56 | 2480 | 147865600 | 3300 | |
| 66760584 | CN_zwang2002 | E | Dec. 13, 2019, 6:47 a.m. | OK | GNU C++17 | TESTS | 56 | 2605 | 178176000 | 3300 | |
| 67712396 | Elegia | E | Dec. 27, 2019, 3 p.m. | OK | GNU C++17 | TESTS | 56 | 2807 | 102604800 | 3300 | |
| 60051486 | Zory | E | Sept. 5, 2019, 12:50 a.m. | OK | GNU C++17 | TESTS | 56 | 2854 | 265830400 | 3300 | |
| 60657027 | Zory | E | Sept. 16, 2019, 12:55 a.m. | OK | GNU C++17 | TESTS | 56 | 2916 | 265830400 | 3300 | |
| 60051720 | Zory | E | Sept. 5, 2019, 1 a.m. | OK | GNU C++17 | TESTS | 56 | 2948 | 265830400 | 3300 | |
| 11772840 | krigan | E | June 26, 2015, 1:12 p.m. | OK | Java 7 | TESTS | 56 | 7971 | 521420800 | 3300 | |
| 11767579 | Lewin | E | June 26, 2015, 2:23 a.m. | OK | Java 8 | TESTS | 56 | 4024 | 326860800 | 3300 | |
| 33816421 | camypaper | E | Dec. 30, 2017, 5:38 p.m. | OK | MS C# | TESTS | 56 | 7768 | 110284800 | 3300 |
Back to search problems