Submission #866924

#TimeUsernameProblemLanguageResultExecution timeMemory
866924maks007Detecting Molecules (IOI16_molecules)C++14
19 / 100
1 ms600 KiB
#include "molecules.h" //#include "grader.cpp" #include "bits/stdc++.h" using namespace std; vector<int> find_subset(int L, int R, vector <int> a) { vector <int> ans; int sum = a[0], l = 0, r = 0, n = a.size(); while(1) { if(sum < L) { r ++; if(r == n) return ans; sum += a[r]; }else if(sum > R) { if(l == n) return ans; sum -= a[l]; l ++; }else break; } if(sum >= L && sum <= R) { for(int i = l; i <= r; i ++) ans.push_back(i); 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...