이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e5+5;
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef pair<ll,ll>pii;
typedef pair<int,pii>piii;
#define  sf scanf
#define  pf printf
#define  input freopen("in.txt","r",stdin)
#define  output freopen("out.txt","w",stdout)
#define  inf 1e16
#define  ff first
#define  ss second
#define  MP make_pair
#define  pb push_back
#define  all(v) v.begin(), v.end()
#define  printcase(cases) printf("Case %d:", cases);
#define  Unique(a) a.erase(unique(a.begin(),a.end()),a.end())
#define  FAST  ios_base::sync_with_stdio(0);cout.tie(0)
//#define  endl printf("\n")
#define  __lcm(a, b) ((a*b)/__gcd(a, b))
vector<int> find_subset(int l, int u, vector<int> w)
{
    int n = w.size();
    vector<pii>arr;
    for(int i = 0; i < n; i++) arr.push_back({w[i], i});
    sort(all(arr));
    ll pre[n+10];
    pre[0] = arr[0].ff;
    for(int i = 1; i < n; i++) pre[i] = pre[i-1]+arr[i-1].ff;
    vector<int>res;
    for(int i = 0; i < n; i++)
    {
        for(int r = i; r < n; r++)
        {
            ll sum = 0;
            for(int j = i; j <= r; j++) sum+=arr[j].ff;
            if(sum>=l && sum<=u)
            {
                for(int j = i; j <= r; j++) res.push_back(arr[j].ss);
                return res;
            }
        }
    }
    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... |