Submission #138280

#TimeUsernameProblemLanguageResultExecution timeMemory
138280arthurconmyDetecting Molecules (IOI16_molecules)C++14
0 / 100
2 ms380 KiB
#include <bits/stdc++.h> #ifndef ARTHUR_LOCAL #include "molecules.h" #endif using namespace std; vector<int> find_subset(int l, int u, vector<int> W) { vector<int> use; int cur = 0; for(auto w:W) { if(w>=l && w<=u) { return {w}; } if(w<l) { use.push_back(w); cur += w; if(cur > u) break; } } while(cur>u) { if(use.empty()) return {}; cur -= use.back(); use.pop_back(); } if(use.empty()) return {}; else return use; }
#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...