이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
//#include "molecules.h"
#define mp   make_pair
#define fi   first
#define se   second
using namespace std;
typedef pair<int, int> pii;
vector<int> find_subset(int l, int u, vector<int> w)
{
    vector<pii> _w;
    vector<int> ans; ans.clear();
    int n, pivot = -1;
    long long s = 0;
    n = w.size(); _w.resize(n);
    for(int i = 0; i < n; ++i) _w[i] = mp(w[i], i);
    sort(_w.begin(), _w.end());
    for(int i = 0; i < n; ++i)
        if(s + _w[i].fi <= u) s += _w[i].fi, pivot = i;
        else break;
    if(pivot == -1) return ans;
    for(int i = pivot; i < n; ++i) {
        if(s >= l && s <= u) {
            for(int j = i - pivot; j <= i; ++j) ans.push_back(_w[j].se);
            return ans;
        }
        if(i < n - 1) s += (_w[i + 1].fi - _w[i - pivot].fi);
    }
    return ans;
}
| # | 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... |