結果

問題 No.139 交差点
ユーザー tktk_snsn
提出日時 2020-12-27 15:18:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 279 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-10-01 13:30:29
合計ジャッジ時間 2,567 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
pos = 0
for _ in range(N):
    x, w, t = map(int, input().split())

    ans += x - pos  # 横断歩道前まで移動
    pos = x

    tmp = ans % (t * 2)
    if tmp > t - w:
        ans += t * 2 - tmp

ans += L - pos
print(ans)
0