結果

問題 No.139 交差点
ユーザー Mr.Fuku
提出日時 2018-08-12 17:35:30
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 221 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-24 07:28:59
合計ジャッジ時間 2,063 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

N,L = map(int,input().split())

s=l=0
for i in range(N):
    x,w,t = map(int,input().split())
    s,l = s+x-l,x+w
    if not (s/t%2<1 and (s+w)/t%2<=1):
        a = (2*t-s%(2*t))
        s += a
    s += w
s+= L-l
print(s)
0