結果
問題 | No.139 交差点 |
ユーザー |
|
提出日時 | 2018-08-26 22:42:20 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 12 ms / 5,000 ms |
コード長 | 370 bytes |
コンパイル時間 | 123 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 04:01:05 |
合計ジャッジ時間 | 1,399 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
n,l = map(int,raw_input().split())arr = [map(int,raw_input().split()) for i in range(n)]wait_time = 0for i in range(n):x, w, t = arr[i]arrive_time = x + wait_timerest = t - (arrive_time%t)signal_color = (arrive_time/t)%2 # 0..blue 1..redif signal_color == 0 :if rest < w:wait_time += rest + telse :wait_time += restprint l + wait_time