# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
961209 | raspy | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 600 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 "molecules.h"
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w)
{
sort(w.begin(), w.end());
int lf = 0, rg = 0;
int trs = 0;
while (rg <= w.size() && (lf < rg || rg == 0))
{
// cout << lf << " " << rg << " " << trs << "\n";
if (trs > u)
{
trs -= w[lf];
lf++;
}
else if (trs < l)
{
trs += w[rg];
rg++;
}
else
{
vector<int> rez;
for (int i = lf; i < rg; i++)
rez.push_back(i);
return rez;
}
}
return vector<int>(0);
}
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... |