Submission #870251

#TimeUsernameProblemLanguageResultExecution timeMemory
870251vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
40 / 100
69 ms600 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int n,m; cin >> n >> m; vector <int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; int cnt = 0; for (int i = 0; i < (1<<n); i++) { int sum = 0; for (int j = 0; j < n; j++) if ((1<<j)&i) sum+=a[j]; if (sum <= m) cnt++; } cout << cnt << '\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...