Submission #967707

#TimeUsernameProblemLanguageResultExecution timeMemory
967707vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
20 / 100
1080 ms456 KiB
#include<bits/stdc++.h> using namespace std; int n, k, arr[44], ans; void solve(int i, int sum){ if(i == n+1){ if(sum <= k) ans++; return; } solve(i+1, sum); solve(i+1, sum+arr[i]); } int 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...