Submission #19564792


Source Code Expand

Copy
n,t=map(int,input().split())
cnt=0
pre=0
A=[int(input()) for i in range(n)]
for i in range(n-1):
        if A[i]+t<=A[i+1]:
                cnt+=t+pre
                pre=0
        else: pre+=A[i+1]-A[i]
print(cnt+t+pre)

Submission Info

Submission Time
Task B - 自動ドア
User hashi_
Language Python (3.8.2)
Score 100
Code Size 229 Byte
Status AC
Exec Time 171 ms
Memory 13116 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 50 / 50 50 / 50
Status
AC × 2
AC × 31
AC × 61
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
Subtask1 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask1_21.txt, subtask1_22.txt, subtask1_23.txt, subtask1_24.txt, subtask1_25.txt, subtask1_26.txt, subtask1_27.txt, subtask1_28.txt, subtask1_29.txt, sample_01.txt, sample_02.txt
Subtask2 sample_01.txt, sample_02.txt, sample_23.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask1_21.txt, subtask1_22.txt, subtask1_23.txt, subtask1_24.txt, subtask1_25.txt, subtask1_26.txt, subtask1_27.txt, subtask1_28.txt, subtask1_29.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt, subtask2_16.txt, subtask2_17.txt, subtask2_18.txt, subtask2_19.txt, subtask2_20.txt, subtask2_21.txt, subtask2_22.txt, subtask2_23.txt, subtask2_24.txt, subtask2_25.txt, subtask2_26.txt, subtask2_27.txt, subtask2_28.txt, subtask2_29.txt
Case Name Status Exec Time Memory
sample_01.txt AC 18 ms 9044 KB
sample_02.txt AC 24 ms 9044 KB
sample_23.txt AC 25 ms 8888 KB
subtask1_01.txt AC 148 ms 12192 KB
subtask1_02.txt AC 54 ms 9600 KB
subtask1_03.txt AC 141 ms 11952 KB
subtask1_04.txt AC 80 ms 10108 KB
subtask1_05.txt AC 52 ms 9416 KB
subtask1_06.txt AC 54 ms 9424 KB
subtask1_07.txt AC 150 ms 12080 KB
subtask1_08.txt AC 135 ms 11968 KB
subtask1_09.txt AC 91 ms 10908 KB
subtask1_10.txt AC 30 ms 9100 KB
subtask1_11.txt AC 95 ms 10796 KB
subtask1_12.txt AC 148 ms 12184 KB
subtask1_13.txt AC 135 ms 11912 KB
subtask1_14.txt AC 118 ms 11564 KB
subtask1_15.txt AC 165 ms 13116 KB
subtask1_16.txt AC 169 ms 12808 KB
subtask1_17.txt AC 169 ms 12972 KB
subtask1_18.txt AC 170 ms 12984 KB
subtask1_19.txt AC 168 ms 13112 KB
subtask1_20.txt AC 168 ms 13108 KB
subtask1_21.txt AC 170 ms 12812 KB
subtask1_22.txt AC 166 ms 13112 KB
subtask1_23.txt AC 171 ms 12812 KB
subtask1_24.txt AC 165 ms 12912 KB
subtask1_25.txt AC 167 ms 12808 KB
subtask1_26.txt AC 169 ms 12864 KB
subtask1_27.txt AC 168 ms 12744 KB
subtask1_28.txt AC 171 ms 12908 KB
subtask1_29.txt AC 169 ms 12908 KB
subtask2_01.txt AC 114 ms 11128 KB
subtask2_02.txt AC 100 ms 10992 KB
subtask2_03.txt AC 102 ms 11032 KB
subtask2_04.txt AC 38 ms 9204 KB
subtask2_05.txt AC 147 ms 12080 KB
subtask2_06.txt AC 67 ms 9992 KB
subtask2_07.txt AC 97 ms 10828 KB
subtask2_08.txt AC 53 ms 9528 KB
subtask2_09.txt AC 109 ms 11432 KB
subtask2_10.txt AC 163 ms 12648 KB
subtask2_11.txt AC 82 ms 10360 KB
subtask2_12.txt AC 112 ms 11412 KB
subtask2_13.txt AC 70 ms 9984 KB
subtask2_14.txt AC 52 ms 9588 KB
subtask2_15.txt AC 167 ms 12808 KB
subtask2_16.txt AC 168 ms 12912 KB
subtask2_17.txt AC 168 ms 12984 KB
subtask2_18.txt AC 169 ms 12912 KB
subtask2_19.txt AC 171 ms 12908 KB
subtask2_20.txt AC 166 ms 13032 KB
subtask2_21.txt AC 168 ms 12980 KB
subtask2_22.txt AC 169 ms 13040 KB
subtask2_23.txt AC 168 ms 12808 KB
subtask2_24.txt AC 170 ms 13116 KB
subtask2_25.txt AC 167 ms 12976 KB
subtask2_26.txt AC 166 ms 12736 KB
subtask2_27.txt AC 168 ms 12752 KB
subtask2_28.txt AC 170 ms 12904 KB
subtask2_29.txt AC 169 ms 12868 KB