Submission #867279

#TimeUsernameProblemLanguageResultExecution timeMemory
867279AtabayRajabliDetecting Molecules (IOI16_molecules)C++17
19 / 100
1 ms600 KiB
#include "molecules.h" std::vector<int> find_subset(int L, int U, std::vector<int> w) { std::vector<int> v = w; int n = w.size(); int l = 0, r = 0, sum = 0; std::vector<int> ans; while(r < n) { sum += v[r]; while(sum > U) { sum -= w[l]; l++; } if(L <= sum && sum <= U) { for(int i = l; i<=r; i++)ans.push_back(i); return ans; } r++; } return std::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...