Submission #230556

#TimeUsernameProblemLanguageResultExecution timeMemory
230556syyKing of Chairs (FXCUP4_chairs)C++17
100 / 100
138 ms13108 KiB
#include "king.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for(int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

ll SendInfo(vector<int> W, vector<int> C) {
	return 0;
}
#include "vassal.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for(int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

set<pi> c;

void Init(long long B, vector<int> C){
	FOR(i, 0, C.size()-1) c.insert(pi(C[i], i));
}

int Maid(int w){
	auto it = c.lower_bound(pi(w, -1));
	if (it == c.end()) return -1;
	int res = it->s; c.erase(it);
	return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...