結果
問題 | No.139 交差点 |
ユーザー |
![]() |
提出日時 | 2024-12-30 22:10:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 50 ms / 5,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 624 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 52,608 KB |
最終ジャッジ日時 | 2024-12-30 22:31:11 |
合計ジャッジ時間 | 2,970 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
N, L = map(int, input().split())XWT = [list(map(int, input().split())) for _ in range(N)]nowt = 0nowp = 0for x, w, t in XWT:t2 = t * 2nowt += x - nowpnowp = xif nowt % t2 <= t and (nowt + w) % t2 <= t and nowt // t2 == (nowt + w) // t2:continueelse:nowt = - (-nowt // (2 * t)) * (2 * t)nowt += L - nowpprint(nowt)