제출 #774570

#제출 시각아이디문제언어결과실행 시간메모리
774570MatblubeDetecting Molecules (IOI16_molecules)C++17
69 / 100
34 ms4956 KiB
#include "molecules.h" #include <iostream> #include <iomanip> #include <math.h> #include <algorithm> #include <cstring> #include <numeric> #include <vector> #include <map> #include <set> #include <deque> #include <unordered_map> #include <unordered_set> typedef long long ll; using namespace std; #define fr(i, x) for(ll i=0 ; i<x ; i++) #define fra(x, v) for(auto x:v) #define fra1(x, v) for(auto &x:v) #define all(v) v.begin(), v.end() vector<int> find_subset(int l, int u, vector<int> w){ int n=w.size(); vector<pair<int, int>>v(n); vector<int>ans; int pos=0; fra(x, w){ v[pos].first=x; v[pos].second=pos; pos++; } sort(all(v)); int i=-1, j=-1, cc=0; while(1){ if(cc<l){ j++; if(j>=n) break; cc+=v[j].first; }else if(cc>u){ i++; if(i>=j) break; cc-=v[i].first; }else{ for(ll a=i+1 ; a<=j ; a++){ ans.push_back(v[a].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...