Submission #409596

#TimeUsernameProblemLanguageResultExecution timeMemory
409596pliamDetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms272 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector<int> res; vector<pair<ll,int>> w_sort; int n=w.size(); for(int i=0;i<n;i++){ w_sort.push_back({w[i],i}); } sort(w_sort.begin(),w_sort.end(),greater<pair<ll,int>>()); ll sum=0; for(auto p:w_sort){ if(sum+p.first<u){ sum+=p.first; res.push_back(p.second); } } return (sum>=l)?res:(std::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...