제출 #706774

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