Submission #1104530

#TimeUsernameProblemLanguageResultExecution timeMemory
1104530ngano_upat_naDetecting Molecules (IOI16_molecules)C++17
9 / 100
72 ms504 KiB
#pragma GCC optimize("O1,O2,O3,Ofast,unroll-loops") #include "bits/stdc++.h" #include "molecules.h" using namespace std; using ll = long long; vector<int> find_subset(int l, int u, vector<int> w) { srand(time(0)); int n = (int)w.size(); ll sum = 0; for (int i=0; i<n; i++) { sum += (ll)w[i]; } if (sum == u) { vector<int> res; for (int i=0; i<n; i++) { res.push_back(i); } return res; } if (sum < l) { vector<int> ans; return ans; } for (int i=0; i<10000; i++) { set<int> s; for (int j=0; j<n; j++) { int r = rand()%n; s.insert(r); } sum = 0; for (auto &e:s) { sum += (ll)w[e]; } if (l <= sum && sum <= u) { vector<int> res; for (auto &e:s) { res.push_back(e); } return res; } } vector<int> emp; return emp; }
#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...