結果
問題 | No.139 交差点 |
ユーザー |
![]() |
提出日時 | 2019-12-24 17:15:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 799 bytes |
コンパイル時間 | 267 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-09-22 05:43:31 |
合計ジャッジ時間 | 2,098 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 7 |
ソースコード
from collections import * from heapq import * import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def MF(): return map(float, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LF(): return list(map(float, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): n,l=MI() xwt=[LI() for _ in range(n)] time=0 pos=0 for x,w,t in xwt: time+=x-pos if time//t%2 or (time+w)//t%2: time=(time//t+1)*t if time//t%2:time+=t time += w pos=x+w time+=l-pos print(time) main()