# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
259731 | lani1akea | Detecting Molecules (IOI16_molecules) | C++17 | 189 ms | 65540 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>
#define F first
#define S second
#define ll long long
#define pb push_back
#define endl '\n'
#define rep(x) cerr<<#x<<"="<<x<<endl
#define OK cerr<<"OK"<<endl<<flush
using namespace std;
const int MOD = 1e9 + 7;
const int N = 510;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<pair<vector<int>, ll>> v;
vector<int> ans;
for (int i = 0; i < w.size(); ++i) {
int x = v.size();
for (int j = 0; j < x; ++j) {
vector<int> up = v[j].F;
ll sum = v[j].S;
up.pb(i);
sum += w[i] * 1LL;
v.pb({up, sum});
if (sum >= (ll)l and sum <= (ll)u) {
ans = up;
goto loop1;
}
}
vector<int> p;
p.pb(i);
if (w[i] >= l and w[i] <= u) {
ans = p;
goto loop1;
}
v.pb({p, w[i]});
}
loop1:
return ans;
}
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... |