# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
369109 | flappybird | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 492 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 <bits/stdc++.h>
using namespace std;
typedef int ll;
#define MAX 505050
#define pb push_back
ll arr[MAX];
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
sort(w.begin(), w.end());
ll i, j;
ll N = w.size();
arr[0] = N;
ll c;
for (i = N - 1; i >= 0; i--) {
c = 0;
for (j = l - 1; j >= 0; j--) {
if (arr[j] && j + w[i] <= u) {
arr[j + w[i]] = i;
if (j + w[i] >= l) {
j += w[i];
c = 1;
break;
}
}
}
if (c) break;
}
vector<ll> v;
if (j != -1) {
while (j) {
v.pb(arr[j]);
j -= w[arr[j]];
}
}
return v;
}
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... |