# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
206343 | autumn_eel | Detecting Molecules (IOI16_molecules) | C++14 | 8 ms | 888 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 rep(i,n)for(int i=0;i<(n);i++)
#include "molecules.h"
using namespace std;
bitset<500001>bit;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
bit[0]=1;
rep(i,w.size()){
bit|=bit<<w[i];
}
for(int i=l;i<=u;i++){
if(bit[i]==1){
int x=w.size(),y=i;
vector<int>ans;
while(x){
x--;
if(y>=w[x]&&bit[y-w[x]]){
ans.push_back(x);
y-=w[x];
}
}
assert(y==0);
reverse(ans.begin(),ans.end());
return ans;
}
}
return {};
}
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... |