Submission #1178296


Source Code Expand

# coding: utf-8

num_N, num_M = map(int, input().split())
l_item = [list(map(int, input().split())) for __ in range(num_N)]

l_all = [[] for __ in range(num_M + 1)]

for index, item in enumerate(l_item):
    for i in range(item[0], item[1] + 1):
        l_all[i].append(index)

for d in range(1, num_M + 1):
    count = 0
    ans = 0
    l_counter = []

    while True:
        count += 1
        num_sta = d * count
        if num_sta > num_M:
            break

        if len(l_all[num_sta]) != 0:
            for i in l_all[num_sta]:
                if i in l_counter:
                    continue
                else:
                    l_counter.append(i)
                    ans += 1

    print(ans)

Submission Info

Submission Time
Task E - Snuke Line
User ch000k111
Language Python (3.4.3)
Score 0
Code Size 738 Byte
Status TLE
Exec Time 2113 ms
Memory 148192 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 700
Status
AC × 2
AC × 14
TLE × 25
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 30.txt, 31.txt, 32.txt, 33.txt, 34.txt, 35.txt, 36.txt, 37.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 17 ms 3064 KB
00_example_02.txt AC 17 ms 3064 KB
01.txt AC 17 ms 3064 KB
02.txt AC 423 ms 3696 KB
03.txt AC 167 ms 3316 KB
04.txt AC 17 ms 3064 KB
05.txt AC 20 ms 3188 KB
06.txt AC 38 ms 3316 KB
07.txt AC 17 ms 3064 KB
08.txt AC 446 ms 3572 KB
09.txt AC 33 ms 3188 KB
10.txt AC 17 ms 3064 KB
11.txt TLE 2112 ms 135500 KB
12.txt TLE 2112 ms 133100 KB
13.txt TLE 2112 ms 129996 KB
14.txt TLE 2111 ms 127960 KB
15.txt TLE 2112 ms 138676 KB
16.txt TLE 2112 ms 130440 KB
17.txt TLE 2112 ms 136608 KB
18.txt TLE 2112 ms 144516 KB
19.txt TLE 2112 ms 135076 KB
20.txt TLE 2112 ms 131008 KB
21.txt TLE 2112 ms 136732 KB
22.txt TLE 2112 ms 142584 KB
23.txt TLE 2112 ms 139636 KB
24.txt TLE 2113 ms 143924 KB
25.txt TLE 2113 ms 146136 KB
26.txt TLE 2113 ms 148192 KB
27.txt TLE 2112 ms 141416 KB
28.txt TLE 2112 ms 138944 KB
29.txt TLE 2112 ms 140352 KB
30.txt TLE 2112 ms 140912 KB
31.txt TLE 2112 ms 144076 KB
32.txt TLE 2111 ms 137096 KB
33.txt TLE 2112 ms 130508 KB
34.txt TLE 2112 ms 139160 KB
35.txt TLE 2113 ms 140636 KB
36.txt AC 17 ms 3064 KB
37.txt AC 783 ms 15636 KB