Submission #1062005

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