結果
| 問題 | No.139 交差点 |
| コンテスト | |
| ユーザー |
JunOnuma
|
| 提出日時 | 2017-06-02 13:36:08 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 374 bytes |
| 記録 | |
| コンパイル時間 | 142 ms |
| コンパイル使用メモリ | 77,720 KB |
| 最終ジャッジ日時 | 2025-12-03 23:54:10 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 28 |
ソースコード
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
JunOnuma