Submission #229209

#TimeUsernameProblemLanguageResultExecution timeMemory
229209tushar_2658Detecting Molecules (IOI16_molecules)C++14
9 / 100
5 ms384 KiB
#include "molecules.h" #include "bits/stdc++.h" using namespace std; using ll = long long; std::vector<int> find_subset(int l, int u, std::vector<int> w) { int N = w.size(); sort(w.begin(), w.end()); ll taken = 0; vector<int> v; for(int i = N - 1; i >= 0; --i){ if(taken + w[i] <= u){ taken += w[i]; v.push_back(i); } } sort(v.begin(), v.end()); if(taken < l or taken > u)v.clear(); return v; }
#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...