Submission #19724376


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:
    if x != t:
        ans = min(C,fee)*(x-t)
        t=x
    fee += y
print(ans)

Submission Info

Submission Time
Task D - Snuke Prime
User BSchlink
Language Python (3.8.2)
Score 0
Code Size 387 Byte
Status WA
Exec Time 1791 ms
Memory 84740 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 29 ms 8880 KB
random_02.txt WA 20 ms 9140 KB
random_03.txt WA 21 ms 9028 KB
random_04.txt WA 18 ms 8984 KB
random_05.txt WA 17 ms 8880 KB
random_06.txt WA 28 ms 8972 KB
random_07.txt WA 19 ms 8976 KB
random_08.txt WA 22 ms 9012 KB
random_09.txt WA 17 ms 9140 KB
random_10.txt WA 18 ms 8984 KB
random_11.txt WA 20 ms 9136 KB
random_12.txt WA 17 ms 8976 KB
random_13.txt WA 18 ms 8888 KB
random_14.txt WA 26 ms 8896 KB
random_15.txt WA 25 ms 9136 KB
random_16.txt WA 361 ms 29536 KB
random_17.txt WA 855 ms 51112 KB
random_18.txt WA 722 ms 45404 KB
random_19.txt WA 647 ms 42440 KB
random_20.txt WA 1725 ms 83900 KB
random_21.txt WA 1179 ms 63416 KB
random_22.txt WA 118 ms 15592 KB
random_23.txt WA 1791 ms 84740 KB
random_24.txt WA 1770 ms 84612 KB
random_25.txt AC 757 ms 71196 KB
sample_01.txt WA 21 ms 8876 KB
sample_02.txt WA 25 ms 9036 KB
sample_03.txt WA 26 ms 9036 KB