結果

問題 No.139 交差点
ユーザー takakin
提出日時 2020-06-11 21:45:52
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-24 03:21:54
合計ジャッジ時間 2,147 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

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+w-1)//t//2+1)*2*t
print(ans+l-cur)
0