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 |
|---|---|---|---|---|---|---|
| 536 | Codeforces Round 299 (Div. 1) | FINISHED | False | 7200 | 347462685 | April 14, 2015, 4:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 788 ) | D | Tavas in Kansas | PROGRAMMING | dp games | 2800 |
Tavas lives in Kansas. Kansas has n cities numbered from 1 to n connected with m bidirectional roads. We can travel from any city to any other city via these roads. Kansas is as strange as Tavas. So there may be a road between a city and itself or more than one road between two cities. Tavas invented a game and called it "Dashti". He wants to play Dashti with his girlfriends, Nafas. In this game, they assign an arbitrary integer value to each city of Kansas. The value of i -th city equals to p i . During the game, Tavas is in city s and Nafas is in city t . They play in turn and Tavas goes first. A player in his/her turn, must choose a non-negative integer x and his/her score increases by the sum of values of all cities with (shortest) distance no more than x from his/her city. Each city may be used once, or in the other words, after first time a player gets score from a city, city score becomes zero. There is an additional rule: the player must choose x such that he/she gets the point of at least one city that was not used before. Note that city may initially have value 0, such city isn't considered as been used at the beginning of the game, i. e. each player may use it to fullfill this rule. The game ends when nobody can make a move. A player's score is the sum of the points he/she earned during the game. The winner is the player with greater score, or there is a draw if players score the same value. Both players start game with zero points. If Tavas wins, he'll break his girlfriend's heart, and if Nafas wins, Tavas will cry. But if their scores are equal, they'll be happy and Tavas will give Nafas flowers. They're not too emotional after all, so they'll play optimally. Your task is to tell Tavas what's going to happen after the game ends. The first line of input contains two integers n and m ( 2 ≤ n ≤ 2000 , n - 1 ≤ m ≤ 10 5 ). The second line of input contains two integers s and t ( 1 ≤ s , t ≤ n , s ≠ t ). The next line contains n integers p 1 , p 2 , |
| Codeforces Round #299 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 30318034 | laofudasuan | D | Sept. 14, 2017, 12:25 a.m. | OK | GNU C++ | TESTS | 85 | 77 | 147046400 | 2800 | |
| 41647702 | Scut82 | D | Aug. 16, 2018, 9:40 a.m. | OK | GNU C++ | TESTS | 85 | 140 | 119705600 | 2800 | |
| 30549369 | jiyutian | D | Sept. 20, 2017, 2:50 p.m. | OK | GNU C++ | TESTS | 85 | 140 | 133222400 | 2800 | |
| 41657436 | Scut82 | D | Aug. 16, 2018, 3:38 p.m. | OK | GNU C++ | TESTS | 85 | 140 | 143769600 | 2800 | |
| 11255208 | hq9907 | D | May 24, 2015, 2:07 p.m. | OK | GNU C++ | TESTS | 85 | 155 | 115404800 | 2800 | |
| 17288259 | 065583 | D | April 12, 2016, 10:23 a.m. | OK | GNU C++ | TESTS | 85 | 155 | 132300800 | 2800 | |
| 10807953 | Logic_zys | D | April 21, 2015, 9:14 a.m. | OK | GNU C++ | TESTS | 85 | 155 | 156262400 | 2800 | |
| 10807931 | Logic_zys | D | April 21, 2015, 9:12 a.m. | OK | GNU C++ | TESTS | 85 | 155 | 156262400 | 2800 | |
| 10736147 | waterfalls | D | April 15, 2015, 9:20 p.m. | OK | GNU C++ | TESTS | 85 | 156 | 144998400 | 2800 | |
| 10992151 | bdep__ | D | May 4, 2015, 2:42 a.m. | OK | GNU C++ | TESTS | 85 | 171 | 136294400 | 2800 | |
| 65466789 | yasugongshang | D | Nov. 21, 2019, 6:26 a.m. | OK | GNU C++11 | TESTS | 85 | 108 | 118067200 | 2800 | |
| 55392179 | RedStar_13 | D | June 10, 2019, 10:15 a.m. | OK | GNU C++11 | TESTS | 85 | 108 | 123494400 | 2800 | |
| 70001383 | hjsjhn | D | Feb. 2, 2020, 1:54 a.m. | OK | GNU C++11 | TESTS | 85 | 108 | 139980800 | 2800 | |
| 46355521 | luogu_bot4 | D | Nov. 29, 2018, 8:03 a.m. | OK | GNU C++11 | TESTS | 85 | 108 | 215142400 | 2800 | |
| 69831468 | luogu_bot4 | D | Jan. 30, 2020, 10:36 a.m. | OK | GNU C++11 | TESTS | 85 | 109 | 147763200 | 2800 | |
| 69830656 | luogu_bot5 | D | Jan. 30, 2020, 10:22 a.m. | OK | GNU C++11 | TESTS | 85 | 109 | 147763200 | 2800 | |
| 55074282 | KMAASZRAA | D | June 4, 2019, 7:48 a.m. | OK | GNU C++11 | TESTS | 85 | 124 | 118476800 | 2800 | |
| 66083319 | AnnieCai | D | Dec. 1, 2019, 2:23 a.m. | OK | GNU C++11 | TESTS | 85 | 124 | 131686400 | 2800 | |
| 64776382 | luogu_bot2 | D | Nov. 13, 2019, 4:38 a.m. | OK | GNU C++11 | TESTS | 85 | 124 | 150220800 | 2800 | |
| 12040522 | DBradac | D | July 14, 2015, 11:12 a.m. | OK | GNU C++11 | TESTS | 85 | 124 | 166400000 | 2800 | |
| 35886608 | ______u______ | D | March 3, 2018, 1:50 p.m. | OK | GNU C++14 | TESTS | 85 | 124 | 75776000 | 2800 | |
| 35885384 | _____i_____ | D | March 3, 2018, 1:27 p.m. | OK | GNU C++14 | TESTS | 85 | 124 | 75776000 | 2800 | |
| 35874452 | ______h______ | D | March 3, 2018, 7:51 a.m. | OK | GNU C++14 | TESTS | 85 | 124 | 75776000 | 2800 | |
| 35874239 | ______k______ | D | March 3, 2018, 7:46 a.m. | OK | GNU C++14 | TESTS | 85 | 124 | 75776000 | 2800 | |
| 35873862 | ______i______ | D | March 3, 2018, 7:40 a.m. | OK | GNU C++14 | TESTS | 85 | 124 | 75776000 | 2800 | |
| 35871865 | ______M______ | D | March 3, 2018, 6:58 a.m. | OK | GNU C++14 | TESTS | 85 | 124 | 75776000 | 2800 | |
| 23219618 | Batman | D | Dec. 22, 2016, 7:53 a.m. | OK | GNU C++14 | TESTS | 85 | 124 | 75776000 | 2800 | |
| 54854172 | Neroast | D | May 30, 2019, 6:20 p.m. | OK | GNU C++14 | TESTS | 85 | 139 | 73830400 | 2800 | |
| 34047639 | vjudge2 | D | Jan. 9, 2018, 11:59 a.m. | OK | GNU C++14 | TESTS | 85 | 140 | 72089600 | 2800 | |
| 63116250 | zsyzsy | D | Oct. 22, 2019, 9:27 a.m. | OK | GNU C++14 | TESTS | 85 | 140 | 118169600 | 2800 | |
| 44746908 | anpans | D | Oct. 23, 2018, 5:22 p.m. | OK | GNU C++17 | TESTS | 85 | 124 | 9420800 | 2800 | |
| 66262653 | luogu_bot1 | D | Dec. 4, 2019, 9:04 a.m. | OK | GNU C++17 | TESTS | 85 | 124 | 76800000 | 2800 | |
| 66262390 | luogu_bot1 | D | Dec. 4, 2019, 8:59 a.m. | OK | GNU C++17 | TESTS | 85 | 140 | 76697600 | 2800 | |
| 69324592 | CMXRYNP | D | Jan. 22, 2020, 3:02 p.m. | OK | GNU C++17 | TESTS | 85 | 155 | 118169600 | 2800 | |
| 68683404 | alan_cty | D | Jan. 13, 2020, 1:20 a.m. | OK | GNU C++17 | TESTS | 85 | 155 | 132198400 | 2800 | |
| 66089739 | luogu_bot2 | D | Dec. 1, 2019, 6:49 a.m. | OK | GNU C++17 | TESTS | 85 | 170 | 133324800 | 2800 | |
| 66262359 | luogu_bot1 | D | Dec. 4, 2019, 8:58 a.m. | OK | GNU C++17 | TESTS | 85 | 171 | 76697600 | 2800 | |
| 66262273 | luogu_bot4 | D | Dec. 4, 2019, 8:56 a.m. | OK | GNU C++17 | TESTS | 85 | 171 | 79155200 | 2800 | |
| 66228773 | shurongwang | D | Dec. 3, 2019, 1:36 p.m. | OK | GNU C++17 | TESTS | 85 | 171 | 99430400 | 2800 | |
| 64292439 | ruo | D | Nov. 5, 2019, 7:31 a.m. | OK | GNU C++17 | TESTS | 85 | 171 | 166502400 | 2800 | |
| 10818775 | jcomputer000 | D | April 22, 2015, 4:45 a.m. | OK | Java 7 | TESTS | 85 | 982 | 383897600 | 2800 | |
| 10815494 | edorundo | D | April 21, 2015, 7:43 p.m. | OK | Java 7 | TESTS | 85 | 1325 | 432332800 | 2800 | |
| 10726361 | TomConerly | D | April 15, 2015, 4:48 a.m. | OK | Java 8 | TESTS | 85 | 733 | 224358400 | 2800 | |
| 10923349 | fmoraes | D | April 28, 2015, 8:13 p.m. | OK | Java 8 | TESTS | 85 | 748 | 373555200 | 2800 | |
| 10719606 | mmaxio | D | April 14, 2015, 6:27 p.m. | OK | Java 8 | TESTS | 85 | 1341 | 520806400 | 2800 | |
| 11916612 | IgorKoval | D | July 3, 2015, 10:38 p.m. | OK | Java 8 | TESTS | 85 | 1669 | 107724800 | 2800 | |
| 11916629 | IgorKoval | D | July 3, 2015, 10:41 p.m. | OK | Java 8 | TESTS | 85 | 1684 | 107827200 | 2800 | |
| 11916557 | IgorKoval | D | July 3, 2015, 10:32 p.m. | OK | Java 8 | TESTS | 85 | 1824 | 180736000 | 2800 | |
| 10903528 | azukun | D | April 27, 2015, 7:42 a.m. | OK | MS C# | TESTS | 85 | 389 | 136089600 | 2800 | |
| 11050797 | MrDindows | D | May 9, 2015, 12:22 a.m. | OK | MS C++ | TESTS | 85 | 358 | 229683200 | 2800 | |
| 11050853 | SlavaSSU | D | May 9, 2015, 12:47 a.m. | OK | MS C++ | TESTS | 85 | 373 | 229683200 | 2800 | |
| 11050851 | SlavaSSU | D | May 9, 2015, 12:46 a.m. | OK | MS C++ | TESTS | 85 | 951 | 229785600 | 2800 |
Back to search problems