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