Submission #1926612


Source Code Expand

Copy
N=int(input())
C,S,F=[0]*(N-1),[0]*(N-1),[0]*(N-1)
for i in range(N-1):
    C[i],S[i],F[i]=map(int,input().split())
for i in range(N-1): #一周につき一つの駅([0]..[N-3])から[N-1]までの計算
    arrivalTime=S[i]+C[i]#最初発車駅の次の駅に着く時間
    for j in range(i+1,N-1):
        leaveTime=S[j]#現在考慮中の駅から初めて発車する時間
        while arrivalTime > leaveTime:
            leaveTime+=F[j]
        arrivalTime=leaveTime+C[j]
    print(arrivalTime)
print(0)#[N-1]駅

Submission Info

Submission Time
Task C - Special Trains
User Yodadayo
Language Python (3.4.3)
Score 0
Code Size 534 Byte
Status TLE
Exec Time 3156 ms
Memory 3064 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 6
TLE × 9
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt TLE 3156 ms 3064 KB
02.txt TLE 3156 ms 3064 KB
03.txt TLE 3155 ms 3064 KB
04.txt TLE 3156 ms 3064 KB
05.txt TLE 3156 ms 3064 KB
06.txt AC 2756 ms 3064 KB
07.txt TLE 3156 ms 3064 KB
08.txt TLE 3156 ms 3064 KB
09.txt AC 17 ms 3064 KB
10.txt TLE 3156 ms 3060 KB
11.txt TLE 3155 ms 3064 KB
12.txt AC 2706 ms 3064 KB
sample_01.txt AC 17 ms 3064 KB
sample_02.txt AC 17 ms 3064 KB
sample_03.txt AC 17 ms 3060 KB