Submission #890188

#TimeUsernameProblemLanguageResultExecution timeMemory
890188MercubytheFirstDetecting Molecules (IOI16_molecules)C++17
0 / 100
0 ms348 KiB
#include "molecules.h" #include<algorithm> #include<assert.h> #include<numeric> using namespace std; using ll = long long; vector<int> find_subset(int weight_low, int weight_hi, vector<int> w) { vector<ll> v(w.begin(), w.end()); sort(v.begin(), v.end()); sort(w.begin(), w.end()); int n = v.size(); for(int l = 0; l < n; ++l){ for(int r = l; r < n; ++r){ ll sum = accumulate(v.begin() + l, v.begin() + r + 1, 0ll); if(weight_low <= sum and sum <= weight_hi){ return vector<int>(w.begin() + l, w.begin() + r + 1); } } } return vector<int>(); }
#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...