# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
138282 | arthurconmy | Detecting Molecules (IOI16_molecules) | C++14 | 2 ms | 376 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>
#ifndef ARTHUR_LOCAL
#include "molecules.h"
#endif
using namespace std;
vector<int> find_subset(int l, int u, vector<int> W)
{
vector<int> use;
int cur = 0;
for(int i=0; i<W.size(); i++)
{
int w = W[i];
if(w>=l && w<=u)
{
return {w};
}
if(w<l)
{
use.push_back(i);
cur += w;
if(cur > u) break;
}
}
while(cur>u)
{
if(use.empty()) return {};
cur -= W[use.back()];
use.pop_back();
}
if(use.empty()) return {};
else return use;
}
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... |