Submission #1111550


Source Code Expand

import itertools
n,x,m=map(int,input().split())
t=[list(map(int,input().split()))for _ in [0]*m]
a=[-1]
for b in itertools.product(range(x+1),repeat=n):
    for l,r,s in t:
        if s!=sum(b[l-1:r]):break
    else:
        if sum(a)<sum(b):a=b
print(*a)

Submission Info

Submission Time
Task B - ライオン
User cima
Language Python (3.4.3)
Score 200
Code Size 264 Byte
Status AC
Exec Time 931 ms
Memory 3188 KB

Judge Result

Set Name All
Score / Max Score 200 / 200
Status
AC × 76
Set Name Test Cases
All 00_test_00.txt, 00_test_01.txt, 00_test_02.txt, 00_test_03.txt, 00_test_04.txt, 00_test_05.txt, 10_random_00.txt, 10_random_01.txt, 10_random_02.txt, 10_random_03.txt, 10_random_04.txt, 10_random_05.txt, 10_random_06.txt, 10_random_07.txt, 10_random_08.txt, 10_random_09.txt, 10_small_10.txt, 10_small_11.txt, 10_small_12.txt, 10_small_13.txt, 10_small_14.txt, 10_small_15.txt, 10_small_16.txt, 10_small_17.txt, 10_small_18.txt, 10_small_19.txt, 10_test_00.txt, 10_test_01.txt, 10_test_02.txt, 10_test_03.txt, 10_test_04.txt, 10_test_05.txt, 10_test_06.txt, 10_test_07.txt, 10_test_08.txt, 10_test_09.txt, 10_test_10.txt, 10_test_11.txt, 10_test_12.txt, 10_test_13.txt, 10_test_14.txt, 10_test_15.txt, 10_test_16.txt, 10_test_17.txt, 10_test_18.txt, 10_test_19.txt, 10_test_20.txt, 10_test_21.txt, 10_test_22.txt, 10_test_23.txt, 10_test_24.txt, 10_test_25.txt, 10_test_26.txt, 10_test_27.txt, 10_test_28.txt, 10_test_29.txt, 10_test_30.txt, 10_test_31.txt, 10_test_32.txt, 10_test_33.txt, 10_test_34.txt, 10_test_35.txt, 10_test_36.txt, 10_test_37.txt, 10_test_38.txt, 10_test_39.txt, 20_random_20.txt, 20_random_21.txt, 20_random_22.txt, 20_random_23.txt, 20_random_24.txt, 20_random_25.txt, 20_random_26.txt, 20_random_27.txt, 20_random_28.txt, 20_random_29.txt
Case Name Status Exec Time Memory
00_test_00.txt AC 814 ms 3060 KB
00_test_01.txt AC 18 ms 3060 KB
00_test_02.txt AC 18 ms 3060 KB
00_test_03.txt AC 18 ms 3060 KB
00_test_04.txt AC 820 ms 3060 KB
00_test_05.txt AC 860 ms 3060 KB
10_random_00.txt AC 18 ms 3060 KB
10_random_01.txt AC 19 ms 3060 KB
10_random_02.txt AC 18 ms 3060 KB
10_random_03.txt AC 19 ms 3060 KB
10_random_04.txt AC 18 ms 3064 KB
10_random_05.txt AC 18 ms 3060 KB
10_random_06.txt AC 17 ms 3064 KB
10_random_07.txt AC 19 ms 3060 KB
10_random_08.txt AC 18 ms 3060 KB
10_random_09.txt AC 33 ms 3060 KB
10_small_10.txt AC 17 ms 3060 KB
10_small_11.txt AC 18 ms 3064 KB
10_small_12.txt AC 18 ms 3064 KB
10_small_13.txt AC 18 ms 3060 KB
10_small_14.txt AC 17 ms 3060 KB
10_small_15.txt AC 17 ms 3064 KB
10_small_16.txt AC 17 ms 3060 KB
10_small_17.txt AC 17 ms 3060 KB
10_small_18.txt AC 18 ms 3060 KB
10_small_19.txt AC 18 ms 3060 KB
10_test_00.txt AC 17 ms 3060 KB
10_test_01.txt AC 17 ms 3060 KB
10_test_02.txt AC 17 ms 3060 KB
10_test_03.txt AC 17 ms 3060 KB
10_test_04.txt AC 17 ms 3060 KB
10_test_05.txt AC 18 ms 3060 KB
10_test_06.txt AC 18 ms 3064 KB
10_test_07.txt AC 18 ms 3064 KB
10_test_08.txt AC 18 ms 3060 KB
10_test_09.txt AC 17 ms 3064 KB
10_test_10.txt AC 22 ms 3064 KB
10_test_11.txt AC 60 ms 3060 KB
10_test_12.txt AC 17 ms 3064 KB
10_test_13.txt AC 18 ms 3060 KB
10_test_14.txt AC 17 ms 3060 KB
10_test_15.txt AC 75 ms 3060 KB
10_test_16.txt AC 21 ms 3060 KB
10_test_17.txt AC 21 ms 3060 KB
10_test_18.txt AC 17 ms 3060 KB
10_test_19.txt AC 18 ms 3060 KB
10_test_20.txt AC 797 ms 3060 KB
10_test_21.txt AC 824 ms 3060 KB
10_test_22.txt AC 840 ms 3060 KB
10_test_23.txt AC 739 ms 3060 KB
10_test_24.txt AC 815 ms 3060 KB
10_test_25.txt AC 868 ms 3060 KB
10_test_26.txt AC 852 ms 3060 KB
10_test_27.txt AC 845 ms 3060 KB
10_test_28.txt AC 836 ms 3060 KB
10_test_29.txt AC 907 ms 3060 KB
10_test_30.txt AC 830 ms 3060 KB
10_test_31.txt AC 829 ms 3060 KB
10_test_32.txt AC 931 ms 3064 KB
10_test_33.txt AC 889 ms 3060 KB
10_test_34.txt AC 888 ms 3060 KB
10_test_35.txt AC 828 ms 3060 KB
10_test_36.txt AC 815 ms 3060 KB
10_test_37.txt AC 915 ms 3060 KB
10_test_38.txt AC 819 ms 3064 KB
10_test_39.txt AC 891 ms 3060 KB
20_random_20.txt AC 869 ms 3060 KB
20_random_21.txt AC 847 ms 3060 KB
20_random_22.txt AC 790 ms 3060 KB
20_random_23.txt AC 814 ms 3060 KB
20_random_24.txt AC 827 ms 3060 KB
20_random_25.txt AC 855 ms 3064 KB
20_random_26.txt AC 866 ms 3060 KB
20_random_27.txt AC 856 ms 3060 KB
20_random_28.txt AC 864 ms 3060 KB
20_random_29.txt AC 784 ms 3188 KB