Submission #19724336


Source Code Expand

Copy
N, C = map(int, input().split())
a = [0] * N
b = [0] * N
c = [0] * N
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())

data=[]
for i in range(N):
    data.append([a[i]-1,c[i]])
    data.append([b[i],-c[i]])
data2 = sorted(data)

ans=0
t=0
fee=0
for x, y in data2:
    #print(x,y,t,fee,ans)
    if x != t:
        ans = min(C,fee)*(x-t)
        t=x
    fee += y
    #print(x,y,t,fee,ans)
print(ans)

Submission Info

Submission Time
Task D - Snuke Prime
User BSchlink
Language Python (3.8.2)
Score 0
Code Size 441 Byte
Status WA
Exec Time 1934 ms
Memory 84744 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
WA × 3
AC × 1
WA × 27
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 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, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
random_01.txt WA 27 ms 8904 KB
random_02.txt WA 21 ms 9076 KB
random_03.txt WA 25 ms 9116 KB
random_04.txt WA 22 ms 9000 KB
random_05.txt WA 18 ms 8912 KB
random_06.txt WA 20 ms 9048 KB
random_07.txt WA 19 ms 9032 KB
random_08.txt WA 23 ms 8916 KB
random_09.txt WA 23 ms 8992 KB
random_10.txt WA 25 ms 8916 KB
random_11.txt WA 19 ms 8996 KB
random_12.txt WA 21 ms 9036 KB
random_13.txt WA 20 ms 8904 KB
random_14.txt WA 27 ms 9044 KB
random_15.txt WA 24 ms 9036 KB
random_16.txt WA 408 ms 29712 KB
random_17.txt WA 950 ms 50956 KB
random_18.txt WA 785 ms 45508 KB
random_19.txt WA 702 ms 42348 KB
random_20.txt WA 1865 ms 84052 KB
random_21.txt WA 1318 ms 63476 KB
random_22.txt WA 125 ms 15620 KB
random_23.txt WA 1934 ms 84744 KB
random_24.txt WA 1856 ms 84672 KB
random_25.txt AC 776 ms 71108 KB
sample_01.txt WA 27 ms 9156 KB
sample_02.txt WA 18 ms 9132 KB
sample_03.txt WA 19 ms 9116 KB