# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156542 | 2019-10-06T12:01:17 Z | a_player | Detecting Molecules (IOI16_molecules) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> #define f first #define s second #define mp make_pair #define pb push_back using namespace std; typedef long long ll; int diff[10001]; vector<int> find_subset(int l,int u,vector<int> w){ int N=w.size(); sort(w.begin(),w.end()); for(int i=0;i<N;i++)diff[i]=w[i]-w[0]; int h=(u-w[0]+w[N-1])/w[N-1]; int s=h*v[0]; vector<int> sol; for(int i=N-1;i>=N-h+1;i--){ s+=diff[i]; sol.push_back(i); } for(int i=N-h;i>=0;i--)if(s+diff[i]<=u&&s+diff[i]>=l){ sol.push_back(i); return sol; } vector<int> err; return err; }