Submission #72936

#TimeUsernameProblemLanguageResultExecution timeMemory
72936FedericoSDetecting Molecules (IOI16_molecules)C++14
100 / 100
86 ms6484 KiB
#include <algorithm> #include "molecules.h" using namespace std; typedef long long int ll; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector<int> V; ll N=w.size(); ll S=0; vector<pair<ll,int>> W; for(ll i=0;i<N;i++) W.push_back({w[i],i}); sort(W.begin(), W.end()); for(ll a=0,b=0;a<N;a++){ S-=a?W[a-1].first:0; while(l>S and b<N) S+=W[b++].first; if(l<=S and S<=u){ for(ll i=a;i<b;i++) V.push_back(W[i].second); return V; } } return V; }
#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...