Submission #562769

#TimeUsernameProblemLanguageResultExecution timeMemory
562769imtiyazrasool92Detecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms212 KiB
#include "molecules.h" #include<algorithm> #include<array> using namespace std; vector<int> find_subset(int l, int u, std::vector<int> w) { vector<array<int,2>> A((int)w.size()); for(int i = 0; i < (int)w.size();i++){ A[i][0] = w[i]; A[i][1] = i; } sort(A.begin(),A.end()); vector<int> result; int64_t sum = 0; for(int i = 0; i < (int)A.size() && sum < l;i++){ sum += A[i][0]; result.push_back(A[i][1]); } return (sum <= u ? result : vector<int>(0)); }
#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...