Submission #715625

#TimeUsernameProblemLanguageResultExecution timeMemory
715625ovidiush11Detecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w) { int n = w.size(); sort(w.begin(),w.end()); vector<int> result; while(n != 0 && w[n-1] < l) { result.push_back(n-1); l -= w[n-1];u -= w[n-1]; n--; } result.push_back(n-1); if(w[n-1] <= u)return result; for(int i = 0;i < n-1;i++) { if(w[i] + w[n-1] >= l + result[0] && w[i] + w[n-1] <= u + w[w.size()-1]) { result[0] = i; return result; } } return {}; }
#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...