이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <algorithm>
using namespace std;
typedef long long ll;
vector<int> find_subset(int l, int u, vector<int> w) {
int n = int(w.size());
vector <pair <int, int> > v;
for (int i = 0; i < n; ++i)
v.push_back(make_pair(w[i], i));
sort(v.begin(), v.end());
ll sum = v[0].first, lft = 0, rgt = 1;
while (lft < n) {
while (rgt < n && sum < l)
sum += v[rgt++].first;
if (sum >= l && sum <= u)
break;
sum -= v[lft++].first;
}
vector <int> res;
res.clear();
for (int i = lft; i < rgt; ++i)
res.push_back(v[i].second);
return res;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |