Submission #425979

#TimeUsernameProblemLanguageResultExecution timeMemory
425979ioiDetecting Molecules (IOI16_molecules)C++14
19 / 100
1 ms332 KiB
#include "molecules.h" #include<bits/stdc++.h> using namespace std ; vector<int> r(deque<int> ret){ vector <int> rret; for(auto it : ret) rret.push_back(it); return rret ; } std::vector<int> find_subset(int l, int u, std::vector<int> w) { int n = w.size(); deque<int> ret ; long long sum = 0 ; for(int i = 0 ; i < n ; i ++){ sum += w[i]; ret.push_back(i); while(sum > u ){ sum -= w[ret[0]] , ret.pop_front(); } if(sum >= l && sum <= u) return r(ret); } 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...