| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 139428 | quotitquot | Detecting Molecules (IOI16_molecules) | C++14 | 2 ms | 504 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "molecules.h"
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define fr first
#define se second
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
    vector<int>res;
    ll now = 0, p = 0;
    vector<pair<ll,ll>>V;
    for( int i = 0; i < w.size(); i ++ )
        V.pb( { w[i], i } );
    sort( V.begin(), V.end() );
    if( V[0].fr <= u )
    {
        for( int i = 0; i < V.size(); i ++ )
        {
            now += V[i].fr;
            while( now > u )
                now -= V[p ++].fr;
            if( now >= l )
            {
                for( int j = p; j <= i; j ++ )
                    res.pb( V[j].se + 1 );
                sort( res.begin(), res.end() );
                return res;
            }
        }
    }
    res.pb( 0 );
    return res;
}
Compilation message (stderr)
| # | 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... | ||||
