# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
751059 | KN200711 | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 304 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;
vector<int> find_subset(int l, int u, vector<int> w) {
int ans = 0;
vector<int> sp;
sp.clear();
for(int k=0;k<w.size();k++) {
if(ans + w[k] <= u) {
ans += w[k];
sp.push_back(k);
}
}
if(ans >= l) return sp;
int V1 = sp.size() - 1, W = w.size() - 1;
while(ans < l && V1 >= 0 && W >= 0) {
ans += w[W] - w[sp[V1]];
sp[V1] = W;
V1--;
W--;
}
if(ans >= l) return sp;
sp.clear();
return sp;
}
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... |