제출 #403305

#제출 시각아이디문제언어결과실행 시간메모리
403305MDarioDetecting Molecules (IOI16_molecules)C++11
0 / 100
1 ms204 KiB
#include "molecules.h" #include<bits/stdc++.h> using namespace std; #define F first #define S second std::vector<int> find_subset(int l, int u, vector<int> z){ vector<int> v; vector<pair<int, int>> w; int c=0, s=0, n=z.size(); for(int i=0; i<n; i++){ w.push_back({z[i], i}); } sort(w.begin(), w.end()); reverse(w.begin(), w.end()); for(int i=0; i<n; i++){ while(s<l&&c<n){ s+=w[c].F; c++; } if(l<=s&&s<=u){ for(int t=i; t<c; t++)v.push_back(w[t].S); break; } s-=w[i].F; } while(s<l&&c<n){ s+=w[c].F; c++; } if(l<=s&&s<=u){ for(int t=n-1; t<c; t++)v.push_back(w[t].S); } return v; }
#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...