Submission #469897

#TimeUsernameProblemLanguageResultExecution timeMemory
469897IvnFDetecting Molecules (IOI16_molecules)C++14
19 / 100
1 ms252 KiB
#include "molecules.h" std::vector<int> find_subset(int l, int u, std::vector<int> w) { long long n=w.size(), kiri=0, sums=0, i=0; std::vector<int>ans; for(;i<n;++i){ sums+=w[i]; while(sums > u) sums-=w[kiri++]; if(sums>=l && sums<=u){ for(long long j=kiri;j<=i;++j) ans.push_back(j); return ans; } } return ans; }
#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...