# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156528 | a_player | Detecting Molecules (IOI16_molecules) | C++14 | 2 ms | 412 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 f first
#define s second
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
int dp[10001];
vector<int> find_subset(int l,int u,vector<int> w){
dp[0]=1;
for(int i=0;i<w.size();i++)
for(int j=u;j>=w[i];j--)if(dp[j-w[i]])dp[j]=1;
int pos=-1;
for(int i=l;i<=u;i++)if(dp[i])pos=i;
vector<int> sol;
if(pos==-1){
return sol;
}
for(int i=w.size()-1;i>=0;i--)if(pos-w[i]>=0)if(dp[pos-w[i]]){
pos-=w[i];
sol.push_back(i);
}
return sol;
}
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... |