from bisect import *
n,m = map(int, input().split())
lis = list(map(int, input().split()))
a = n//2
b = (n-1)//2 + 1
aa = dict()
bb = dict()
#meet in middle prep
for i in range(2**a):
cur = 0
temp = 0
tempi = i
while tempi:
if tempi&1:
temp += lis[cur]
cur +=1
tempi//=2
if temp in aa:
aa[temp] += 1
else:
aa[temp] = 1
for i in range(2**b):
cur = a
temp = 0
tempi = i
while tempi:
if tempi&1:
temp += lis[cur]
cur +=1
tempi//=2
if temp in bb:
bb[temp] += 1
else:
bb[temp] = 1
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
34 ms |
18220 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
34 ms |
18176 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
44 ms |
19284 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
49 ms |
19376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
83 ms |
22484 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
100 ms |
24868 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
190 ms |
37140 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
614 ms |
100848 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
99 ms |
31464 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
828 ms |
122808 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |