제출 #599188

#제출 시각아이디문제언어결과실행 시간메모리
599188JomnoiDetecting Molecules (IOI16_molecules)C++17
0 / 100
0 ms212 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; vector <int> find_subset(int L, int U, vector <int> w) { int n = w.size(); vector <pair <int, int>> weights; for(int i = 0; i < n; i++) { weights.emplace_back(w[i], i); } sort(weights.begin(), weights.end()); long long sum = 0; int l = 0, r = -1; while(r < n) { if(sum < L) { sum += weights[++r].first; } else if(sum > U) { sum -= weights[l++].first; } else { vector <int> ans; for(int i = l; i < r; i++) { ans.push_back(weights[i].second); } return ans; } } return vector <int> (); }
#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...