Submission #967709

#TimeUsernameProblemLanguageResultExecution timeMemory
967709vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
40 / 100
1097 ms348 KiB
#include<bits/stdc++.h> #define int long long using namespace std; int n, k, arr[44], ans; void solve(int i, int sum){ if(i == n+1){ if(sum <= k) ans++; return; } if(sum > k) return; solve(i+1, sum); solve(i+1, sum+arr[i]); } signed main(){ cin.tie(nullptr)->sync_with_stdio(false); cin >> n >> k; for(int i = 1; i<=n; ++i) cin >> arr[i]; solve(1, 0); cout << ans; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...