제출 #915259

#제출 시각아이디문제언어결과실행 시간메모리
915259SmuggingSpunDetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms856 KiB
#include "molecules.h" #include<bits/stdc++.h> using namespace std; vector<int>find_subset(int l, int u, vector<int>w) { int index = int(w.size()) - 1, sum = 0; while(index > -1 && sum < l){ sum += w[index--]; } int length = int(w.size()) - index - 1; while(index > -1 && sum > u){ sum -= w[index + length] - w[index]; index--; } if(sum > u){ return vector<int>{}; } vector<int>ans(length); iota(ans.begin(), ans.end(), index + 1); 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...