n, m = map(int, input().split())
arr = [int(i) for i in input().split()]
c = 0
for b in range(1<<n):
s = 0
for i in range(n):
if b&(1<<i): s+=arr[i]
if s > m: break
if s <= m:c+=1
print(c)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
2764 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
2764 KB |
Output is correct |
2 |
Correct |
17 ms |
2788 KB |
Output is correct |
3 |
Correct |
16 ms |
2784 KB |
Output is correct |
4 |
Correct |
19 ms |
2764 KB |
Output is correct |
5 |
Correct |
20 ms |
2764 KB |
Output is correct |
6 |
Correct |
19 ms |
2768 KB |
Output is correct |
7 |
Correct |
17 ms |
2764 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
864 ms |
2808 KB |
Output is correct |
2 |
Correct |
365 ms |
2796 KB |
Output is correct |
3 |
Correct |
686 ms |
2804 KB |
Output is correct |
4 |
Correct |
15 ms |
2764 KB |
Output is correct |
5 |
Correct |
406 ms |
2764 KB |
Output is correct |
6 |
Execution timed out |
1083 ms |
2804 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1084 ms |
2764 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1071 ms |
2764 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1077 ms |
2764 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1083 ms |
2776 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1077 ms |
2764 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1088 ms |
2764 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1088 ms |
2764 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |