Submission #1062010

#TimeUsernameProblemLanguageResultExecution timeMemory
1062010Hectorungo_18Detecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; // #define int long long vector<int> find_subset(int l, int r, vector<int> w){ int n = w.size(); vector<pair<int, int>> v(n); for(int i = 0; i < n; i++){ v[i]={w[i], i}; } sort(v.begin(), v.end()); vector<int> sol; for(int i = n-1; i >= 0; i--){ int aux = v[i].first; vector<int> pos; pos.push_back(v[i].second); for(int j = i-1; i >= 0; j--){ if(aux+v[j].first > r) continue; else{ aux+=v[j].first; pos.push_back(v[j].second); } if(aux >= l) break; } if(aux >= l && aux <= r){ sol = pos; reverse(sol.begin(), sol.end()); break; } } return sol; }
#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...