Submission #879253

# Submission time Handle Problem Language Result Execution time Memory
879253 2023-11-27T04:33:34 Z dilshod9890 Bootfall (IZhO17_bootfall) Python 3
6 / 100
1000 ms 18828 KB
n = int(input())
a = list(map(int,input().split()))

def rec(b,i):
    
    if i==len(a):
        c.append(abs(sum(a)-2*sum(b)))
        return
    b.append(a[i])
    rec(b,i+1)
    
    b.pop()
    rec(b,i+1)


c = []
for i in range(n):
    rec([],0)
if min(c) != 0:
    print(0)
else:
    c = []
    g = []
    for i in range(n):
        d = a[i]
        a.pop(i)
        rec([],0)
        a.insert(i,d)
        c.sort()
        g.append(set(c))
        c = []
    c = g[0]
    for i in g:
        c = c.intersection(i)
    c = list(c)
    c.sort()
    print(len(c))
    for i in c:
        print(i,end=" ")

# Verdict Execution time Memory Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 11 ms 2908 KB Output is correct
3 Correct 11 ms 2908 KB Output is correct
4 Correct 11 ms 2908 KB Output is correct
5 Correct 71 ms 4124 KB Output is correct
6 Correct 12 ms 2908 KB Output is correct
7 Correct 13 ms 2908 KB Output is correct
8 Correct 74 ms 4440 KB Output is correct
9 Correct 22 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 11 ms 2908 KB Output is correct
3 Correct 11 ms 2908 KB Output is correct
4 Correct 11 ms 2908 KB Output is correct
5 Correct 71 ms 4124 KB Output is correct
6 Correct 12 ms 2908 KB Output is correct
7 Correct 13 ms 2908 KB Output is correct
8 Correct 74 ms 4440 KB Output is correct
9 Correct 22 ms 3164 KB Output is correct
10 Execution timed out 1016 ms 18828 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 11 ms 2908 KB Output is correct
3 Correct 11 ms 2908 KB Output is correct
4 Correct 11 ms 2908 KB Output is correct
5 Correct 71 ms 4124 KB Output is correct
6 Correct 12 ms 2908 KB Output is correct
7 Correct 13 ms 2908 KB Output is correct
8 Correct 74 ms 4440 KB Output is correct
9 Correct 22 ms 3164 KB Output is correct
10 Execution timed out 1016 ms 18828 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 11 ms 2908 KB Output is correct
3 Correct 11 ms 2908 KB Output is correct
4 Correct 11 ms 2908 KB Output is correct
5 Correct 71 ms 4124 KB Output is correct
6 Correct 12 ms 2908 KB Output is correct
7 Correct 13 ms 2908 KB Output is correct
8 Correct 74 ms 4440 KB Output is correct
9 Correct 22 ms 3164 KB Output is correct
10 Execution timed out 1016 ms 18828 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 11 ms 2908 KB Output is correct
3 Correct 11 ms 2908 KB Output is correct
4 Correct 11 ms 2908 KB Output is correct
5 Correct 71 ms 4124 KB Output is correct
6 Correct 12 ms 2908 KB Output is correct
7 Correct 13 ms 2908 KB Output is correct
8 Correct 74 ms 4440 KB Output is correct
9 Correct 22 ms 3164 KB Output is correct
10 Execution timed out 1016 ms 18828 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 11 ms 2908 KB Output is correct
3 Correct 11 ms 2908 KB Output is correct
4 Correct 11 ms 2908 KB Output is correct
5 Correct 71 ms 4124 KB Output is correct
6 Correct 12 ms 2908 KB Output is correct
7 Correct 13 ms 2908 KB Output is correct
8 Correct 74 ms 4440 KB Output is correct
9 Correct 22 ms 3164 KB Output is correct
10 Execution timed out 1016 ms 18828 KB Time limit exceeded
11 Halted 0 ms 0 KB -