Submission #19561347


Source Code Expand

Copy
k = int(input())
n = int(input())
lst = []
for i in range(n):
    a, d = map(int, input().split())
    lst += list(range(a, a + (k + 1) * d, d))
lst.sort()
print(sum(lst[:k]))

Submission Info

Submission Time
Task C - 増築王高橋君
User ncrpy
Language Python (3.8.2)
Score 30
Code Size 184 Byte
Status TLE
Exec Time 2308 ms
Memory 3108288 KB

Judge Result

Set Name Sample Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 0 / 0 30 / 30 0 / 10 0 / 15 0 / 45
Status
AC × 2
AC × 14
AC × 19
TLE × 7
AC × 22
TLE × 16
AC × 22
TLE × 29
MLE × 1
Set Name Test Cases
Sample subtask0_sample-01.txt, subtask0_sample-02.txt
Subtask1 subtask0_sample-01.txt, subtask0_sample-02.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
Subtask2 subtask0_sample-01.txt, subtask0_sample-02.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, 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
Subtask3 subtask0_sample-01.txt, subtask0_sample-02.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, 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, subtask3_01.txt, subtask3_02.txt, subtask3_03.txt, subtask3_04.txt, subtask3_05.txt, subtask3_06.txt, subtask3_07.txt, subtask3_08.txt, subtask3_09.txt, subtask3_10.txt, subtask3_11.txt, subtask3_12.txt
Subtask4 subtask0_sample-01.txt, subtask0_sample-02.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, 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, subtask3_01.txt, subtask3_02.txt, subtask3_03.txt, subtask3_04.txt, subtask3_05.txt, subtask3_06.txt, subtask3_07.txt, subtask3_08.txt, subtask3_09.txt, subtask3_10.txt, subtask3_11.txt, subtask3_12.txt, subtask4_01.txt, subtask4_02.txt, subtask4_03.txt, subtask4_04.txt, subtask4_05.txt, subtask4_06.txt, subtask4_07.txt, subtask4_08.txt, subtask4_09.txt, subtask4_10.txt, subtask4_11.txt, subtask4_12.txt, subtask4_13.txt, subtask4_14.txt
Case Name Status Exec Time Memory
subtask0_sample-01.txt AC 29 ms 8952 KB
subtask0_sample-02.txt AC 19 ms 8936 KB
subtask1_01.txt AC 25 ms 8816 KB
subtask1_02.txt AC 23 ms 8808 KB
subtask1_03.txt AC 23 ms 9180 KB
subtask1_04.txt AC 18 ms 9084 KB
subtask1_05.txt AC 19 ms 10088 KB
subtask1_06.txt AC 28 ms 9044 KB
subtask1_07.txt AC 26 ms 9132 KB
subtask1_08.txt AC 29 ms 10676 KB
subtask1_09.txt AC 24 ms 10688 KB
subtask1_10.txt AC 37 ms 12936 KB
subtask1_11.txt AC 38 ms 12624 KB
subtask1_12.txt AC 20 ms 8808 KB
subtask2_01.txt AC 18 ms 9236 KB
subtask2_02.txt AC 100 ms 38048 KB
subtask2_03.txt AC 108 ms 29992 KB
subtask2_04.txt AC 38 ms 13008 KB
subtask2_05.txt AC 187 ms 51496 KB
subtask2_06.txt TLE 2226 ms 548668 KB
subtask2_07.txt TLE 2229 ms 662684 KB
subtask2_08.txt TLE 2223 ms 470664 KB
subtask2_09.txt TLE 2235 ms 845272 KB
subtask2_10.txt TLE 2240 ms 1028276 KB
subtask2_11.txt TLE 2240 ms 1028096 KB
subtask2_12.txt TLE 2223 ms 486280 KB
subtask3_01.txt AC 51 ms 19680 KB
subtask3_02.txt AC 26 ms 13420 KB
subtask3_03.txt TLE 2229 ms 652520 KB
subtask3_04.txt TLE 2237 ms 834860 KB
subtask3_05.txt AC 83 ms 19720 KB
subtask3_06.txt TLE 2285 ms 2654124 KB
subtask3_07.txt TLE 2289 ms 2755828 KB
subtask3_08.txt TLE 2285 ms 2678224 KB
subtask3_09.txt TLE 2286 ms 2670436 KB
subtask3_10.txt TLE 2287 ms 2711284 KB
subtask3_11.txt TLE 2285 ms 2671400 KB
subtask3_12.txt TLE 2285 ms 2652912 KB
subtask4_01.txt TLE 2285 ms 2665748 KB
subtask4_02.txt TLE 2308 ms 3108288 KB
subtask4_03.txt TLE 2273 ms 2377692 KB
subtask4_04.txt TLE 2279 ms 2417400 KB
subtask4_05.txt TLE 2299 ms 2863972 KB
subtask4_06.txt TLE 2254 ms 1522548 KB
subtask4_07.txt TLE 2299 ms 2832452 KB
subtask4_08.txt MLE 888 ms 441344 KB
subtask4_09.txt TLE 2301 ms 2845724 KB
subtask4_10.txt TLE 2302 ms 2831552 KB
subtask4_11.txt TLE 2302 ms 2831920 KB
subtask4_12.txt TLE 2301 ms 2837472 KB
subtask4_13.txt TLE 2301 ms 2841092 KB
subtask4_14.txt TLE 2301 ms 2841208 KB