Submission #448500

#TimeUsernameProblemLanguageResultExecution timeMemory
448500fuad27Ice Hockey World Championship (CEOI15_bobek)C++14
40 / 100
80 ms288 KiB
#include<bits/stdc++.h> using namespace std; #define int unsigned long long int32_t main () { int n, m, c = 0; cin >> n >> m; vector<int> v; for(int i = 0;i<n;i++) { int p;cin >> p; if(p <= m)v.push_back(p); } n = v.size(); for (int b = 0; b < (1<<n); b++) { int sum = 0; for (int i = 0; i < n; i++) { if (b&(1<<i)) sum+=v[i]; if(sum > m)break; } if(sum <= m)c++; } cout<<c<<"\n"<<endl; }

Compilation message (stderr)

bobek.cpp: In function 'int32_t main()':
bobek.cpp:13:24: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'int' [-Wsign-compare]
   13 |      for (int b = 0; b < (1<<n); b++) {
      |                      ~~^~~~~~~~
#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...