| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1232031 | cpdreamer | Detecting Molecules (IOI16_molecules) | C++20 | 1 ms | 328 KiB | 
#include "molecules.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
const long long INF = 1e17;
typedef long long ll;
const ll MOD = 1000002022;
#define F first
#define P pair
#define S second
#define pb push_back
#define V vector
#define all(v) v.begin(), v.end()
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
    int n=(int)w.size();
    for (int i=0;i<n;i++) {
        if (w[i]>=l && w[i]<=u) {
            return {i};
        }
    }
    V<P<int,int>>vp(n);
    for (int i=0;i<n;i++) {
        vp[i]={w[i],i};
    }
    sort(all(vp));
    V<int>id;
    ll s=0;
    for (int i=n-1;i>=0;i--) {
        if (s+vp[i].F<=u) {
            s+=vp[i].F;
            id.pb(vp[i].S);
        }
    }
    if (s>=l) {
        return id;
    }
    return  {};
}
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... | ||||
