# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
595125 | LastRonin | Detecting Molecules (IOI16_molecules) | C++14 | 51 ms | 8224 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 <bits/stdc++.h>
//#include <molecules.h>
#include "molecules.h"
#define ll long long
#define pb push_back
#define pill pair<ll, ll>
#define mp make_pair
#define f first
#define s second
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
ll n = w.size();
vector<pill> x;
for(int i = 0; i < w.size(); i++)
x.pb(mp(w[i], i));
sort(x.begin(), x.end());
ll sum = 0;
deque<ll> zn;
vector<int> ans;
for(int i = 0; i < n; i++) {
zn.push_back(x[i].s);
sum += x[i].f;
while(sum > u) {
sum -= w[zn[0]];
zn.pop_front();
}
if(sum >= l && sum <= u) {
for(auto u : zn)ans.pb(u);
return ans;
}
}
return ans;
}
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... |