Submission #737813

#TimeUsernameProblemLanguageResultExecution timeMemory
737813Elvin_FritlDetecting Molecules (IOI16_molecules)C++17
31 / 100
1078 ms40124 KiB
#include <bits/stdc++.h> using namespace std; #include "molecules.h" const int MN=1e5+5; vector<vector<int>>res(MN); vector<int>dp(MN); vector<int> find_subset(int l, int u, vector<int> w){ int n=w.size(); dp[0]=1; for(int i=0;i<n;i++){ for(int j=MN;j>=0;j--){ if(j>=w[i] && dp[j-w[i]]==true){ res[j]=res[j-w[i]]; dp[j]=true; res[j].push_back(i); } } } for(int i=l;i<=u;i++){ if(dp[i]){ return res[i]; } } return vector<int>(0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...