# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148601 | 욱방켜!! (twitch.tv/wookje) (#200) | King of Chairs (FXCUP4_chairs) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "king.h"
#include <bits/stdc++.h>
long long SendInfo(std::vector<int> W, std::vector<int> C) {
int N = W.size();
std::multiset<int> CC(C.begin(),C.end());
std::sort(W.begin(),W.end());
for(int i=0;i<N;i++) {
auto it=CC.lower_bound(W[i]);
if(it==CC.end()) return W[i]-1;
CC.erase(it);
}
return W[N-1];
}
#include "vassal.h"
#include <bits/stdc++.h>
long long BB;
std::set<pair<int,int>> S;
void Init(long long B, std::vector<int> C){
int N = C.size();
BB = B;
for(int i=0;i<N;i++) S.insert({C[i],i});
}
int Maid(int W){
int ret;
if(W>BB) return -1;
auto it=S.lower_bound(make_pair(W,-1));
ret=it->second;
S.erase(it);
return ret;
}