이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
#define MAXN 200010
#define pb push_back
using namespace std;
struct mol{
    int i, val;
};
bool cmp(mol a, mol b) { return a.val < b.val; }
mol a[MAXN];
vector<int> sol;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
    int n = w.size();
    for(int i = 0; i < n; i++) {
        a[i].val = w[i]; a[i].i = i;
    }
    sort(a, a+n, cmp);
    long long zbir =  a[0].val;
    int L = 0, R = 1;
    while(L < R && L < n && R <= n) {
        if(zbir < l) {
          zbir += a[R].val;
          R++;
        } else if(zbir > u) {
          zbir -= a[L].val;
          L++;
        } else {
            for(int k = L; k < R; k++) sol.push_back(a[k].i);
            return sol;
        }
    }
    return std::vector<int>(0);
}
| # | 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... |