Submission #66040

#TimeUsernameProblemLanguageResultExecution timeMemory
66040bazsi700Ice Hockey World Championship (CEOI15_bobek)C++14
40 / 100
91 ms824 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long //14:20 int n; ll m; ll c[45]; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> n >> m; for(int i = 0; i < n; i++) { cin >> c[i]; } if(n <= 21) { ll ways = 0; for(int mask = 0; mask < (1<<n); mask++) { ll money = m; for(int i = 0; i < n; i++) { if(mask&(1<<i)) { money-= c[i]; } } if(money >= 0) { ways++; } } cout << ways; } 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...