제출 #468408

#제출 시각아이디문제언어결과실행 시간메모리
468408pluto_ishDetecting Molecules (IOI16_molecules)C++14
19 / 100
1 ms292 KiB
#include <bits/stdc++.h> #define pb push_back #define ff first #define ss second using namespace std; typedef long long ll; typedef unsigned long long ull; const ll INF = (ll)1<<62; const ll MOD = 1e9+7; const int iINF = 1<<30; const double PI = 3.14159265359; vector<int> find_subset(int l, int u, vector<int> w){ vector<pair<int, int> > wd; for(int i=0;i<(int)w.size();i++) wd.pb({w[i], i}); sort(wd.begin(), wd.end()); deque<int> ans; int i = 0, s = 0; while(i<(int)w.size()){ s += wd[i].ff; ans.pb(wd[i].ss); while(s > u){ s -= wd[ans.front()].ff; ans.pop_front(); } i++; if(s >= l && s <= u){ vector<int> ret; for(int v : ans) ret.pb(v); return ret; } } return {}; }
#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...