# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
823534 | trucmai | Detecting Molecules (IOI16_molecules) | C++17 | 0 ms | 212 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>
using namespace std;
#define ll long long
#include "molecules.h"
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
sort(w.begin(),w.end());
vector<int>idx(w.size());
for(int i = 0;i < w.size();++i)
idx[i] = i;
sort(idx.begin(),idx.end(),[&](int x,int y){return w[x] < w[y];});
ll ptr = 0,sum = 0;
for(ll i = 0;i < w.size();++i){
sum += w[idx[i]];
while(sum > u) sum -= w[idx[++ptr]];
while(sum <= l){
vector<int>res;
for(ll j = ptr;j <= i;++j)
res.push_back(j);
return res;
}
}
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... |