結果
問題 | No.139 交差点 |
ユーザー |
|
提出日時 | 2022-06-21 19:35:30 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 352 bytes |
コンパイル時間 | 98 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-14 14:05:18 |
合計ジャッジ時間 | 1,888 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
n,l=map(int,input().split())now=time=0for _ in range(n):x,w,t=map(int,input().split())diff=x-nownow=x+wtime+=diffif (time//t)%2:#着いた時点で赤信号rem=t-time%ttime+=rem+welse:rem=t-time%tif rem>=w:time+=welse:time+=rem+t+wprint(time+l-now)