제출 #890157

#제출 시각아이디문제언어결과실행 시간메모리
890157MercubytheFirstDetecting Molecules (IOI16_molecules)C++17
0 / 100
0 ms348 KiB
#include "molecules.h" #include<algorithm> #include<assert.h> using namespace std; using ll = long long; vector<int> find_subset(int weight_low, int weight_hi, vector<int> w) { sort(w.begin(), w.end()); ll l = 0, r = 0, sum = 0, n = w.size(); while(sum < weight_low or weight_hi < sum){ if(sum < weight_low){ if(n <= r) return vector<int>(); sum += w[r]; ++r; } else if(sum > weight_hi){ assert(l <= r); sum -= w[l]; l++; } } vector<int> ans(w.begin() + l, w.begin() + r); 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...