結果

問題 No.139 交差点
ユーザー mkawa2mkawa2
提出日時 2019-12-24 17:15:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 799 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,024 KB
実行使用メモリ 10,176 KB
最終ジャッジ日時 2023-10-22 04:23:13
合計ジャッジ時間 2,391 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,116 KB
testcase_01 AC 33 ms
10,116 KB
testcase_02 AC 31 ms
10,116 KB
testcase_03 AC 30 ms
10,116 KB
testcase_04 AC 30 ms
10,120 KB
testcase_05 AC 30 ms
10,120 KB
testcase_06 AC 30 ms
10,116 KB
testcase_07 AC 31 ms
10,128 KB
testcase_08 AC 30 ms
10,120 KB
testcase_09 AC 30 ms
10,120 KB
testcase_10 WA -
testcase_11 AC 30 ms
10,116 KB
testcase_12 AC 30 ms
10,128 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 29 ms
10,124 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 29 ms
10,120 KB
testcase_19 AC 30 ms
10,128 KB
testcase_20 AC 30 ms
10,116 KB
testcase_21 WA -
testcase_22 AC 29 ms
10,116 KB
testcase_23 AC 29 ms
10,136 KB
testcase_24 AC 29 ms
10,116 KB
testcase_25 AC 30 ms
10,116 KB
testcase_26 AC 29 ms
10,116 KB
testcase_27 AC 29 ms
10,116 KB
testcase_28 AC 29 ms
10,116 KB
testcase_29 AC 29 ms
10,120 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0