제출 #773376

#제출 시각아이디문제언어결과실행 시간메모리
773376MatblubeDetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms300 KiB
#include "molecules.h" #include <iostream> #include <vector> #include <map> #include <deque> #include <algorithm> using namespace std; vector<int> find_subset(int l, int u, vector<int> w) { int pos=1; map<int, deque<int>>mp; for(auto x:w){ mp[x].push_back(pos++); } sort(w.begin(), w.end()); int n=w.size(); int a, b, cc; vector<int>result; a=b=cc=0; while(1){ if(b>=n || a>=n) break; if(cc<l){ if(a>=n) break; cc+=w[a++]; continue; } if(cc>u){ if(b>=n) break; cc-=w[b++]; continue; } for(int i=b; i<a ; i++){ result.push_back(mp[w[i]][0]); mp[w[i]].pop_front(); } return result; } return std::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...