結果

問題 No.139 交差点
ユーザー roiti46
提出日時 2015-01-30 01:16:00
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 272 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 7,196 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-06-23 04:23:35
合計ジャッジ時間 1,731 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

N,L = map(int,raw_input().split())
t = l = 0
for loop in range(N):
    X,W,T = map(int,raw_input().split())
    t += X-l
    if t/T%2 == 0:
            if (t+W-1)/T-t/T > 0:
                    t += (T-t%T)+T
    else:
        t += T-t%T
    t += W
    l = X+W
print t+L-l
0