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.
Problems
In the last war of PMP, he defeated all his opponents and advanced to the final round. But after the end of semi-final round evil attacked him from behind and killed him! God bless him. Before his death, PMP signed a contract with the bus rapid transit (BRT) that improves public transportations by optimizing time of travel estimation. You should help PMP finish his last contract. Each BRT line is straight line that passes n intersecting on its ways. At each intersection there is traffic light that periodically cycles between green and red. It starts illuminating green at time zero. During the green phase which lasts for g seconds, traffic is allowed to proceed. After the green phase the light changes to red and remains in this color for r seconds. During the red phase traffic is prohibited from proceeding. If a vehicle reaches the intersection exactly at a time when the light changes to red, it should stop, but the vehicle is clear to proceed if the light has just changed to green. All traffic lights have the same timing and are synchronized. In other words the period of red (and green) phase is the same for all of traffic lights and they all start illuminating green at time zero. The BRT Company has calculated the time that a bus requires to pass each road segment. A road segment is the distance between two consecutive traffic lights or between a traffic light and source (or destination) station. More precisely BRT specialists provide n + 1 positive integers l i , the time in seconds that a bus needs to traverse i -th road segment in the path from source to destination. The l 1 value denotes the time that a bus needs to pass the distance between source and the first intersection. The l n + 1 value denotes the time between the last intersection and destination. In one day q buses leave the source station. The i -th bus starts from source at time t i (in seconds). Decision makers of BRT Company want to know what time a bus gets to destination? The bus is co |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
1697538 |
con_nha_ngheo |
D |
May 17, 2012, 5:13 a.m. |
OK |
FPC |
TESTS |
62 |
530 |
6860800 |
|
2700 |
|
1703506 |
whitetooth |
D |
May 19, 2012, 9:12 a.m. |
OK |
FPC |
TESTS |
62 |
580 |
12595200 |
|
2700 |
|
2876830 |
luogan |
D |
Jan. 6, 2013, 6:26 a.m. |
OK |
FPC |
TESTS |
62 |
640 |
45260800 |
|
2700 |
|
1687295 |
blackapple |
D |
May 14, 2012, 8:27 a.m. |
OK |
FPC |
TESTS |
62 |
690 |
29286400 |
|
2700 |
|
1701058 |
jtc172 |
D |
May 18, 2012, 10:33 a.m. |
OK |
FPC |
TESTS |
62 |
690 |
46284800 |
|
2700 |
|
2926020 |
dogcpp |
D |
Jan. 15, 2013, 4:58 a.m. |
OK |
GNU C++ |
TESTS |
62 |
250 |
30924800 |
|
2700 |
|
2587454 |
CMHJT |
D |
Nov. 19, 2012, 8:03 a.m. |
OK |
GNU C++ |
TESTS |
62 |
281 |
4608000 |
|
2700 |
|
2827526 |
Seasons |
D |
Dec. 26, 2012, 2:49 a.m. |
OK |
GNU C++ |
TESTS |
62 |
296 |
9728000 |
|
2700 |
|
14143069 |
130705009 |
D |
Nov. 8, 2015, 3:22 p.m. |
OK |
GNU C++ |
TESTS |
62 |
312 |
4505600 |
|
2700 |
|
2753567 |
zcwwzdjn |
D |
Dec. 12, 2012, 7:48 a.m. |
OK |
GNU C++ |
TESTS |
62 |
312 |
11980800 |
|
2700 |
|
2756206 |
zcwwzdjn |
D |
Dec. 13, 2012, 12:18 a.m. |
OK |
GNU C++ |
TESTS |
62 |
328 |
3993600 |
|
2700 |
|
2828570 |
qiandichen |
D |
Dec. 26, 2012, 10:47 a.m. |
OK |
GNU C++ |
TESTS |
62 |
328 |
28876800 |
|
2700 |
|
2857219 |
dogcpp |
D |
Dec. 30, 2012, 2:32 p.m. |
OK |
GNU C++ |
TESTS |
62 |
328 |
51404800 |
|
2700 |
|
1680459 |
rowdark |
D |
May 11, 2012, 5:42 a.m. |
OK |
GNU C++ |
TESTS |
62 |
330 |
5222400 |
|
2700 |
|
33759186 |
djqtxdy |
D |
Dec. 29, 2017, 12:12 p.m. |
OK |
GNU C++ |
TESTS |
62 |
342 |
16486400 |
|
2700 |
|
2857218 |
dogcpp |
D |
Dec. 30, 2012, 2:31 p.m. |
OK |
GNU C++0x |
TESTS |
62 |
296 |
51404800 |
|
2700 |
|
2789391 |
moreD |
D |
Dec. 18, 2012, 3:49 a.m. |
OK |
GNU C++0x |
TESTS |
62 |
312 |
12902400 |
|
2700 |
|
2857173 |
dogcpp |
D |
Dec. 30, 2012, 2:14 p.m. |
OK |
GNU C++0x |
TESTS |
62 |
328 |
54169600 |
|
2700 |
|
2857180 |
dogcpp |
D |
Dec. 30, 2012, 2:16 p.m. |
OK |
GNU C++0x |
TESTS |
62 |
359 |
51097600 |
|
2700 |
|
2855622 |
bakabakashyoshyo |
D |
Dec. 30, 2012, 5:22 a.m. |
OK |
GNU C++0x |
TESTS |
62 |
514 |
43212800 |
|
2700 |
|
2749906 |
roosephu |
D |
Dec. 11, 2012, 7:12 a.m. |
OK |
GNU C++0x |
TESTS |
62 |
578 |
41472000 |
|
2700 |
|
9807880 |
Pudge123 |
D |
Feb. 12, 2015, 1:20 p.m. |
OK |
GNU C++0x |
TESTS |
62 |
622 |
9625600 |
|
2700 |
|
1680093 |
Edvard |
D |
May 10, 2012, 10:44 p.m. |
OK |
GNU C++0x |
TESTS |
62 |
860 |
7065600 |
|
2700 |
|
1679755 |
watashi |
D |
May 10, 2012, 7:37 p.m. |
OK |
GNU C++0x |
TESTS |
62 |
1760 |
13414400 |
|
2700 |
|
17087269 |
freebsdx |
D |
April 1, 2016, 9:02 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
342 |
6656000 |
|
2700 |
|
18165063 |
vjudge3 |
D |
May 31, 2016, 7:18 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
342 |
6758400 |
|
2700 |
|
33801234 |
FlappyFish |
D |
Dec. 30, 2017, 5:23 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
374 |
4915200 |
|
2700 |
|
33456809 |
hawkomg |
D |
Dec. 20, 2017, 1:39 p.m. |
OK |
GNU C++11 |
TESTS |
62 |
374 |
4915200 |
|
2700 |
|
18165486 |
vjudge3 |
D |
May 31, 2016, 8:02 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
374 |
6656000 |
|
2700 |
|
54902810 |
SoiMae |
D |
June 1, 2019, 7:30 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
374 |
8499200 |
|
2700 |
|
33758318 |
ohweonfire |
D |
Dec. 29, 2017, 11:30 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
374 |
9728000 |
|
2700 |
|
54902612 |
SoiMae |
D |
June 1, 2019, 7:24 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
404 |
8499200 |
|
2700 |
|
18165184 |
vjudge5 |
D |
May 31, 2016, 7:29 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
434 |
6656000 |
|
2700 |
|
18165495 |
newbeginBKB |
D |
May 31, 2016, 8:03 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
436 |
6656000 |
|
2700 |
|
34472278 |
Cyanic |
D |
Jan. 23, 2018, 7:30 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
404 |
13312000 |
|
2700 |
|
33141491 |
AbstractKangaroo |
D |
Dec. 12, 2017, 12:34 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
436 |
33996800 |
|
2700 |
|
33141448 |
AbstractKangaroo |
D |
Dec. 12, 2017, 12:29 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
436 |
33996800 |
|
2700 |
|
67271081 |
ElangBondol |
D |
Dec. 20, 2019, 8:19 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
466 |
13926400 |
|
2700 |
|
46920076 |
yhx-12243 |
D |
Dec. 12, 2018, 3:39 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
468 |
8192000 |
|
2700 |
|
39745698 |
ppavic |
D |
June 28, 2018, 2:23 p.m. |
OK |
GNU C++14 |
TESTS |
62 |
468 |
13824000 |
|
2700 |
|
35166542 |
vjudge4 |
D |
Feb. 12, 2018, 1:47 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
468 |
48537600 |
|
2700 |
|
28478507 |
sherlock_holms |
D |
July 12, 2017, 3:50 p.m. |
OK |
GNU C++14 |
TESTS |
62 |
498 |
7168000 |
|
2700 |
|
35166624 |
vjudge3 |
D |
Feb. 12, 2018, 1:54 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
498 |
27750400 |
|
2700 |
|
36942661 |
wh2001_ZY |
D |
April 4, 2018, 7:37 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
498 |
41472000 |
|
2700 |
|
35141142 |
LiChenKoh |
D |
Feb. 11, 2018, 2:40 a.m. |
OK |
GNU C++17 |
TESTS |
62 |
310 |
11366400 |
|
2700 |
|
61554673 |
Kuroni |
D |
Sept. 30, 2019, 1:39 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
436 |
5836800 |
|
2700 |
|
35649001 |
vjudge5 |
D |
Feb. 24, 2018, 2:40 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
530 |
6041600 |
|
2700 |
|
35648274 |
vjudge2 |
D |
Feb. 24, 2018, 2:20 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
592 |
6041600 |
|
2700 |
|
35648271 |
vjudge5 |
D |
Feb. 24, 2018, 2:20 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
592 |
6041600 |
|
2700 |
|
35649299 |
vjudge5 |
D |
Feb. 24, 2018, 2:48 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
624 |
6041600 |
|
2700 |
|
66226445 |
hjk1030 |
D |
Dec. 3, 2019, 12:47 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
748 |
194355200 |
|
2700 |
|
36942258 |
whzzt |
D |
April 4, 2018, 7:16 a.m. |
OK |
GNU C++17 |
TESTS |
62 |
1122 |
61849600 |
|
2700 |
|
44739418 |
ruo |
D |
Oct. 23, 2018, 2:03 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
1714 |
44544000 |
|
2700 |
|
1678718 |
Egor |
D |
May 10, 2012, 5:28 p.m. |
OK |
Java 6 |
TESTS |
62 |
840 |
56115200 |
|
2700 |
|
1876835 |
ilyakor |
D |
July 8, 2012, 6:04 p.m. |
OK |
Java 6 |
TESTS |
62 |
1060 |
43622400 |
|
2700 |
|
1846772 |
mmaxio |
D |
June 30, 2012, 5:43 p.m. |
OK |
Java 7 |
TESTS |
62 |
700 |
51200000 |
|
2700 |
|
1679033 |
pperm |
D |
May 10, 2012, 6:08 p.m. |
OK |
MS C++ |
TESTS |
62 |
420 |
11059200 |
|
2700 |
remove filters
Back to search problems