Submission #229256

#TimeUsernameProblemLanguageResultExecution timeMemory
229256534351King of Chairs (FXCUP4_chairs)C++17
100 / 100
134 ms13220 KiB
#include "king.h"
#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
    if (a > b) a = b;
}

template<class T, class U>
void ckmax(T &a, U b)
{
    if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define SZ(x) ((int) (x).size())
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

ll SendInfo(vi w, vi c)
{
    return 0;
	// int N = W.size();
	// return W[0]*100 + W[1]*10 + W[2]*1;
}
#include "vassal.h"
#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
    if (a > b) a = b;
}

template<class T, class U>
void ckmax(T &a, U b)
{
    if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define SZ(x) ((int) (x).size())
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

const int MAXN = 100013;

int N;
set<pii> rem;

void Init(long long B, std::vector<int> C)
{
    N = SZ(C);
    FOR(i, 0, N)
    {
        int x = C[i];
        rem.insert({x, i});
    }
	// int N = C.size();
	// BB = B;
	// ToDo
}

int Maid(int w)
{
    auto it = rem.LB({w, -1});
    if (it == rem.end()) return -1;
    int res = it -> se;
    rem.erase(it);
    return res;
	// if(W == BB%10) return 2;
	// if(W == BB/100) return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...