# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
153413 | phpark | King of Chairs (FXCUP4_chairs) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "king.h"
using namesoace std;
#include "king.h"
using namespace std;
long long SendInfo(vector <int> W, vector <int> C)
{
return 1;
}
#include <set>
#include <iostream>
#include <vector>
#include <algorithm>
#include "vassal.h"
using namespace std;
static multiset <int> sit;
static vector <int> chair;
static int N;
void Init(long long B, vector <int> C)
{
N = C.size();
chair.resize(N);
sort(C.begin(), C.end());
chair = C;
for (int i = 0; i < N; i++) sit.insert(chair[i]);
}
int Maid(int w)
{
auto itr = sit.lower_bound(w);
if (itr == sit.end()) {
return -1;
}
else {
int ans = *itr;
auto it = find(chair.begin(), chair.end(), ans);
auto index = distance(chair.begin(), it);
sit.erase(sit.find(ans));
return (int)index;
}
}