Submission #879253

#TimeUsernameProblemLanguageResultExecution timeMemory
879253dilshod9890Bootfall (IZhO17_bootfall)Cpython 3
6 / 100
1016 ms18828 KiB
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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...