Submission #19724363


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 1853 ms
Memory 84872 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 28 ms 9092 KB
random_02.txt WA 19 ms 8924 KB
random_03.txt WA 25 ms 9096 KB
random_04.txt WA 19 ms 9176 KB
random_05.txt WA 19 ms 9168 KB
random_06.txt WA 25 ms 9104 KB
random_07.txt WA 20 ms 9088 KB
random_08.txt WA 23 ms 9096 KB
random_09.txt WA 20 ms 8932 KB
random_10.txt WA 20 ms 9224 KB
random_11.txt WA 19 ms 8936 KB
random_12.txt WA 21 ms 9164 KB
random_13.txt WA 25 ms 9096 KB
random_14.txt WA 22 ms 9092 KB
random_15.txt WA 19 ms 9040 KB
random_16.txt WA 410 ms 29556 KB
random_17.txt WA 921 ms 50920 KB
random_18.txt WA 798 ms 45460 KB
random_19.txt WA 707 ms 42364 KB
random_20.txt WA 1826 ms 84252 KB
random_21.txt WA 1248 ms 63632 KB
random_22.txt WA 121 ms 15940 KB
random_23.txt WA 1853 ms 84724 KB
random_24.txt WA 1830 ms 84872 KB
random_25.txt AC 747 ms 71232 KB
sample_01.txt WA 21 ms 9228 KB
sample_02.txt WA 24 ms 8940 KB
sample_03.txt WA 20 ms 9044 KB