結果
問題 |
No.139 交差点
|
ユーザー |
![]() |
提出日時 | 2020-06-11 21:48:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 36 ms / 5,000 ms |
コード長 | 280 bytes |
コンパイル時間 | 221 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-24 03:22:05 |
合計ジャッジ時間 | 2,204 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() n,l=map(int,input().split()) ans=0 cur=0 for _ in range(n): x,w,t=map(int,input().split()) ans+=x-cur cur=x if (ans//t)%2==0 and ((ans+w-1)//t)%2==0: continue else: ans=((ans-1)//t//2+1)*2*t print(ans+l-cur)