# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153534 | phpark | King of Chairs (FXCUP4_chairs) | C++17 | 149 ms | 10728 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"
using namespace std;
long long SendInfo(vector <int> W, vector <int> C)
{
return 0;
}
#include <set>
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include "vassal.h"
using namespace std;
static multiset <pair<int, int>> sit;
static vector <int> chair;
static int N;
typedef pair <int, int> pii;
pii p;
void Init(long long B, vector <int> C)
{
N = C.size();
chair = C;
for (int i = 0; i < N; i++) {
p.first = chair[i];
p.second = i;
sit.insert(p);
}
}
int Maid(int w)
{
int left = 0, right = N;
auto itr = sit.lower_bound(make_pair(w, 0));
if (itr == sit.end()) {
return -1;
}
else {
pair <int, int> ans = *itr; //고른 의자 무게
int answer = ans.second;
sit.erase(itr);
return answer;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |