제출 #502118

#제출 시각아이디문제언어결과실행 시간메모리
502118MurotYDetecting Molecules (IOI16_molecules)C++14
9 / 100
1 ms292 KiB
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #include "molecules.h" using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector <pair <ll,ll> > a(w.size()); int n=w.size(); for (int i=0;i<n;i++) a[i].first=w[i], a[i].second=i; sort(a.begin(),a.end()); for (int i=0;i<n;i++){ long long sum=0, q=0; while (q < n && sum < l) sum+=a[q].first, q++; if (sum >= l && sum <= u){ vector <int> ans; for (int i=0;i<q;i++) ans.push_back(a[i].second); return ans; } } return vector <int> (); }
#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...