Submission #481174

#TimeUsernameProblemLanguageResultExecution timeMemory
481174glomeDetecting Molecules (IOI16_molecules)C++17
9 / 100
139 ms588 KiB
#include "molecules.h" #include<bits/stdc++.h> using namespace std; struct S { int b = 0; vector<int> ind; }; std::vector<int> find_subset(int l, int u, std::vector<int> w) { int s = 0; for (int i : w) { s += i; } vector<S> ok(s+1); ok[0].b = 1; int cnt = 0; for (int i : w) { for (int j = s; j>=i; j--) { if(ok[j-i].b) { ok[j].ind = ok[j-i].ind; ok[j].b = 1; (ok[j].ind).push_back(cnt); } } cnt++; } vector<int> ans; for (int i = l; i<=u; i++) { if(ok[i].b) { return ok[i].ind; } } return ans; }
#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...