# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102734 | bert30702 | Detecting Molecules (IOI16_molecules) | C++17 | 69 ms | 6224 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>
#define pii pair<int, int>
#define F first
#define S second
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<pii> v;
for(long long i = 0; i < w.size(); i ++) {
v.push_back({w[i], i});
}
sort(v.begin(), v.end());
long long p = -1, sum = 0;
for(long long i = 0; i < v.size(); i ++) {
while(sum < l and p + 1 < v.size()) {
p ++; sum += v[p].F;
}
if(sum <= u and sum >= l and v[p].F - v[i].F <= u - l) {
vector<int> ans;
for(long long j = i; j <= p; j ++) {
ans.push_back(v[j].S);
}
return ans;
}
sum -= v[i].F;
}
return vector<int>();
}
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... |