제출 #770739

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