# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151625 | thebes | 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 <bits/stdc++.h>
#include "king.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
multiset<int> s;
vi id[1000006];
ll SendInfo(vi W,vi C){return 0;}
#include <bits/stdc++.h>
#include "vassal.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define pb push_back
multiset<int> s;
vi id[1000006];
void Init(ll B,vi C){
for(auto v : C) s.insert(v);
for(int i=0;i<C.size();i++)
id[C[i]].pb(i);
}
int maid(int w){
auto it = s.lower_bound(w);
if(it==s.end()) return -1;
int idd = *it; s.erase(s.find(*it));
int r = id[idd][0];
id[idd].erase(id[idd].begin());
return r;
}