# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
827477 | caganyanmaz | Detecting Molecules (IOI16_molecules) | C++11 | 50 ms | 8220 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 int int64_t
#define pb push_back
#include "molecules.h"
using namespace std;
vector<int32_t> find_subset(int32_t d, int32_t u, vector<int32_t> ww)
{
int sum = 0;
vector<array<int, 2>> w;
for (int i = 0; i < ww.size(); i++)
w.pb({ww[i], i});
sort(w.begin(), w.end());
int l = 0, r = 0;
bool found = false;
while (r < w.size())
{
sum += w[r++][0];
while (sum > u) sum -= w[l++][0];
if (sum >= d)
{
found = true;
break;
}
}
vector<int32_t> res;
if (found)
while (r > l) res.pb(w[l++][1]);
return res;
}
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... |