Submission #124196

#TimeUsernameProblemLanguageResultExecution timeMemory
124196HassenAissaIce Hockey World Championship (CEOI15_bobek)C++14
40 / 100
76 ms396 KiB
#include <bits/stdc++.h> #define int long long unsigned using namespace std; int32_t main() { int n,m,d; scanf("%llu%llu",&n,&m); vector<int> tab; int pluss=0; int moins=0; for(int i=0; i<n; i++) { scanf("%llu",&d); if(d<=m) tab.push_back(d); } int res=0; for(int i=0; i<(1<<tab.size()); i++) { int total=0; int nomb=0; for(int j=0; j<tab.size(); j++) { if((i&(1llu<<j))==0) { total+=tab[j]; } } if(total<=m) { res++; } } printf("%llu\n",res); return 0; }

Compilation message (stderr)

bobek.cpp: In function 'int32_t main()':
bobek.cpp:20:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i=0; i<(1<<tab.size()); i++)
                      ~^~~~~~~~~~~~~~~~
bobek.cpp:23:17: warning: unused variable 'nomb' [-Wunused-variable]
             int nomb=0;
                 ^~~~
bobek.cpp:10:13: warning: unused variable 'pluss' [-Wunused-variable]
         int pluss=0;
             ^~~~~
bobek.cpp:11:13: warning: unused variable 'moins' [-Wunused-variable]
         int moins=0;
             ^~~~~
bobek.cpp:8:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%llu%llu",&n,&m);
         ~~~~~^~~~~~~~~~~~~~~~~~
bobek.cpp:14:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%llu",&d);
             ~~~~~^~~~~~~~~~~
#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...