Submission #870249

#TimeUsernameProblemLanguageResultExecution timeMemory
870249vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
40 / 100
1069 ms600 KiB
#include <iostream> #include <vector> #define int long long using namespace std; int n, m, res = 0; vector<int> a; void dfs(int i, int sum) { if(i == n) { res++; return; } if(sum+a[i] <= m) dfs(i+1, sum+a[i]); dfs(i+1, sum); } signed main() { cin >> n >> m; a = vector<int>(n); for(int i = 0; i < n; i++) cin >> a[i]; dfs(0, 0); cout << res << "\n"; }
#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...