Submission #18135323


Source Code Expand

import sys
from itertools import permutations


def IN_I(): return int(sys.stdin.readline().rstrip())
def IN_LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def IN_S(): return sys.stdin.readline().rstrip()
def IN_LS(): return list(sys.stdin.readline().rstrip().split())
INF = float('inf')
MOD = 10**9 + 7


N, W = IN_LI()
x = [0] * (2*10**5+1)
for i in range(N):
    s, t, p = IN_LI()
    x[s] += p
    x[t] -= p

if x[0] > W:
    print('No')
    exit()

for i in range(1, 2*10**5+1):
    x[i] += x[i-1]
    if x[i] > W:
        print('No')
        exit()
print('Yes')

Submission Info

Submission Time
Task D - Water Heater
User okayuki
Language PyPy3 (7.3.0)
Score 400
Code Size 617 Byte
Status AC
Exec Time 213 ms
Memory 78924 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 18
Set Name Test Cases
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
Case Name Status Exec Time Memory
hand_01.txt AC 213 ms 70204 KiB
hand_02.txt AC 154 ms 78920 KiB
hand_03.txt AC 186 ms 70084 KiB
hand_04.txt AC 156 ms 78924 KiB
hand_05.txt AC 53 ms 63604 KiB
random_01.txt AC 204 ms 70044 KiB
random_02.txt AC 200 ms 69992 KiB
random_03.txt AC 192 ms 69728 KiB
random_04.txt AC 197 ms 69976 KiB
random_05.txt AC 202 ms 70028 KiB
random_06.txt AC 192 ms 70088 KiB
random_07.txt AC 197 ms 69728 KiB
random_08.txt AC 177 ms 69964 KiB
random_09.txt AC 191 ms 69932 KiB
random_10.txt AC 188 ms 70084 KiB
sample_01.txt AC 56 ms 63672 KiB
sample_02.txt AC 58 ms 65080 KiB
sample_03.txt AC 59 ms 65220 KiB