Submission #19724288


Source Code Expand

Copy
N, M, T = map(int, input().split())

Z = N

xy = [map(int, input().split()) for _ in range(M)]
A, B = [list(i) for i in zip(*xy)]

A.insert(0, 0)
B.insert(0, 0)



for i in range(M):
    N = N - (A[i+1] - B[i])
    
    if N <= 0:
        print("No")
        exit()

    
    N = N + (B[i+1] - A[i+1])
    if N >= Z:
        N = Z

    
N = N - (T - B[-1])



if N <= 0:
    print("No")
else:
    print("Yes")

Submission Info

Submission Time
Task B - Smartphone Addiction
User Claus
Language Python (3.8.2)
Score 200
Code Size 441 Byte
Status AC
Exec Time 30 ms
Memory 9468 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 5
AC × 21
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt
All handmade_00.txt, handmade_01.txt, random_00.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, random_11.txt, random_12.txt, random_13.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt
Case Name Status Exec Time Memory
handmade_00.txt AC 18 ms 9032 KB
handmade_01.txt AC 20 ms 8904 KB
random_00.txt AC 27 ms 9292 KB
random_01.txt AC 28 ms 9352 KB
random_02.txt AC 21 ms 9468 KB
random_03.txt AC 22 ms 9184 KB
random_04.txt AC 26 ms 8980 KB
random_05.txt AC 18 ms 8904 KB
random_06.txt AC 21 ms 9156 KB
random_07.txt AC 18 ms 9036 KB
random_08.txt AC 22 ms 9332 KB
random_09.txt AC 25 ms 9284 KB
random_10.txt AC 19 ms 9160 KB
random_11.txt AC 22 ms 9296 KB
random_12.txt AC 24 ms 9176 KB
random_13.txt AC 30 ms 9216 KB
sample_01.txt AC 27 ms 9052 KB
sample_02.txt AC 22 ms 8904 KB
sample_03.txt AC 19 ms 9036 KB
sample_04.txt AC 22 ms 9048 KB
sample_05.txt AC 22 ms 8896 KB