提出 #22275973


ソースコード 拡げる

import itertools
N,W = map(int, input().split())
TABLE = [0]*(2*10**5+1)#出入り口の計算
for i in range(N):
    S,T,P = map(int, input().split())
    TABLE[S]+=P
    TABLE[T]-=P
TIME = list(itertools.accumulate(TABLE))#累積和をとることで、時間ごとの使用量が分かる
if max(TIME)<=W:
    print('Yes')
else:
    print('No')

提出情報

提出日時
問題 D - Water Heater
ユーザ H20
言語 PyPy3 (7.3.0)
得点 400
コード長 358 Byte
結果 AC
実行時間 325 ms
メモリ 86800 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 3
AC × 18
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 325 ms 85036 KiB
hand_02.txt AC 293 ms 86800 KiB
hand_03.txt AC 312 ms 84916 KiB
hand_04.txt AC 292 ms 86784 KiB
hand_05.txt AC 67 ms 76560 KiB
random_01.txt AC 310 ms 84616 KiB
random_02.txt AC 313 ms 85176 KiB
random_03.txt AC 321 ms 84712 KiB
random_04.txt AC 307 ms 85104 KiB
random_05.txt AC 318 ms 85112 KiB
random_06.txt AC 312 ms 85068 KiB
random_07.txt AC 312 ms 84916 KiB
random_08.txt AC 313 ms 84984 KiB
random_09.txt AC 309 ms 85100 KiB
random_10.txt AC 311 ms 84404 KiB
sample_01.txt AC 65 ms 76372 KiB
sample_02.txt AC 69 ms 76612 KiB
sample_03.txt AC 67 ms 76676 KiB