結果

問題 No.139 交差点
ユーザー JunOnuma
提出日時 2017-06-02 13:36:08
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 374 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-09-21 22:11:13
合計ジャッジ時間 1,519 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

n,l = map(int, raw_input().split())
ls = [map(int, raw_input().split()) for _ in range(n)]
time = 0
pos = 0
for [x,w,t] in ls:
    reach = time + (x-pos)
    cycle = reach / (2*t)
    if cycle * 2 * t <= reach and reach+w <= cycle * 2 * t + t:
        time = reach + w
    else:
        time = (cycle+1)*2*t + w
    pos = x + w
    print time,pos
time += l - pos
print time
0