Submission #448476

#TimeUsernameProblemLanguageResultExecution timeMemory
448476fuad27Ice Hockey World Championship (CEOI15_bobek)C++14
40 / 100
78 ms296 KiB
#include<bits/stdc++.h> using namespace std; #define int long long int32_t main () { int n, m, c = 0; cin >> n >> m; int v[n]; for(int i = 0;i<n;i++) { cin >> v[i]; } for (int b = 0; b < (1<<n); b++) { int sum = m; for (int i = 0; i < n; i++) { if (b&(1<<i)) sum-=v[i]; if(sum < 0)break; } if(sum >= 0)c++; } cout<<c<<"\n"<<endl; }
#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...