Submission #404901

#TimeUsernameProblemLanguageResultExecution timeMemory
404901salehIce Hockey World Championship (CEOI15_bobek)C++17
40 / 100
7 ms8496 KiB
#include <bits/stdc++.h> #define int long long #define lowval(x) (x & (-x)) #define lowind __builtin_ctzll using namespace std; const int MAXN = 20 + 3; int n, m, c[MAXN], dp[(1 << MAXN)], ans; int32_t main() { cin >> n >> m; if (n >= MAXN) return 0; for (int i = 0; i < n; i++) cin >> c[i]; for (int i = 1; i < (1 << n); i++) if ((dp[i] = c[lowind(i)] + dp[i - lowval(i)]) <= m) ans++; cout << ans + 1; return 0; }
#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...