이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
    /*input
    10 20
    4
    15 17 16 18
    */
    /**
        Author: Kristopher Paul
        Date Created: 13-05-2019
        Contest Name:
                    _/    _/   _/_/_/_/   _/   _/_/_/_/
                   _/  _/     _/    _/   _/   _/
                  _/_/       _/_/_/_/   _/   _/_/_/_/
                 _/  _/     _/  _/     _/         _/
                _/    _/   _/    _/   _/   _/_/_/_/
    **/
    #include<bits/stdc++.h>
    #define ll long long
    //#define int ll
    #define pb push_back
    #define INF 0x3f3f3f3f //0x3f3f3f3f = 63
    #define MOD 1000000007
    #define mp make_pair
    const double PI=3.141592653589793238462643383279502884197169399375105820974944;
    #define REP(i,n) for (int i = 0; i < n; i++)
    #define FOR(i,a,b) for (int i = a; i < b; i++)
    #define REPD(i,n) for (int i = n-1; i >= 0; i--)
    #define FORD(i,a,b) for (int i = a; i >= b; i--)
    #define remax(a,b) a = max(a,b)
    #define remin(a,b) a = min(a,b)
    #define umap unordered_map
    #define pii pair<int,int>
    #define F first
    #define S second
    #define mii map<int,int>
    #define vi vector<int>
    #define vvi vector<vi>
    #define itr :: iterator it
    #define all(v) v.begin(),v.end()
    #define WL(t) while(t--)
    #define gcd(a,b) __gcd((a),(b))
    #define lcm(a,b) ((a)*(b))/gcd((a),(b))
    #define out(x) cout << #x << " is " << x << endl
    #define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    using namespace std;
    /*
    int ModExp(int x,int y,int m){
        int res = 1;
        x = x % m;
        while (y > 0)
        {
            if (y & 1)
                res = (res*x) % m;
     
            y = y>>1;
            x = (x*x) % m;
        }
        return res;
    }*/
     
    vector<int> find_subset(int l,int u,vector<int> w){
        int al,ar,len;
        al = ar = -1;
        len = -1;
        vector<pii> vec;
        FOR(i,0,w.size()){
            vec.pb({w[i],i});
        }
        sort(vec.begin(),vec.end());
        int i = 0,j = 0;
        bool vis[w.size()] = {};
        ll csum = 0;
        vector<int> ans;
        if(vec[0].first > u){
            return ans;
        }
        while(j < w.size()){
            if(!vis[j]){
                vis[j] = true;
                csum += vec[j].first;
            }
            if(csum >= l && csum <= u){
                if((j-i+1) > len){
                    len = (j-i+1);
                    al = i;
                    ar = j;
                }
                j++;
            }else if(csum < l){
                j++;
            }else{
                csum -= vec[i].first;
                i++;
            }
        }
        if(len == -1){
            return ans;
        }
        FOR(i,al,ar+1){
            ans.pb(vec[i].second);
        }
        return ans;
    }
    /*
    void solve(){
        vector<int> tst;
        int l,u;
        cin >> l >> u;
        int n;
        cin >> n;
        FOR(i,0,n){
            int x;
            cin >> x;
            tst.pb(x);
        }
        vector<int> ans = find_subset(l,u,tst);
        FOR(i,0,ans.size()){
            cout << ans[i] << " ";
        }
        cout << endl;
    }
     
    signed main(){
        FastIO;
        int t = 1;
    //    cin >> t;
        WL(t){
            solve();
        }
    }
    */
컴파일 시 표준 에러 (stderr) 메시지
molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:25:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     #define FOR(i,a,b) for (int i = a; i < b; i++)
molecules.cpp:65:13:
         FOR(i,0,w.size()){
             ~~~~~~~~~~~~                  
molecules.cpp:65:9: note: in expansion of macro 'FOR'
         FOR(i,0,w.size()){
         ^~~
molecules.cpp:76:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while(j < w.size()){
               ~~^~~~~~~~~~| # | 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... |