Submission #1121495

#TimeUsernameProblemLanguageResultExecution timeMemory
1121495vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
40 / 100
1067 ms508 KiB
#include <bits/stdc++.h> using namespace std; # define int long long void solve() { int n, k, cnt = 0; cin >> n >> k; vector < int > a(n); for(int i = 0; i < n; i++) cin >> a[i]; for(int i = 1; i <= pow(2, n); i++) { int ans = 0; for(int j = 0; j < n; j++) { if(i & (1 << j)) ans += a[j]; } if(ans <= k) cnt++; } cout << cnt << endl; } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int tt = 1; // cin >> tt; while(tt--) solve(); }
#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...