Submission #233560

#TimeUsernameProblemLanguageResultExecution timeMemory
233560pere_gilDetecting Molecules (IOI16_molecules)C++14
0 / 100
5 ms256 KiB
#include <iostream> #include "molecules.h" using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w){ int tot=1<<w.size(); std::vector<int> pos; for(int i=0;i<tot;i++){ int sum=0; pos.clear(); for(int j=0;j<w.size();j++){ if((i&(1<<j)) % w[j]<=u){ sum+=w[j]; pos.push_back(w[j]); } if(sum<=u and sum>=l){ break; } } } return pos; }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:12:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<w.size();j++){
                     ~^~~~~~~~~
#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...