Submission #230672

#TimeUsernameProblemLanguageResultExecution timeMemory
230672jiahngKing of Chairs (FXCUP4_chairs)C++17
100 / 100
159 ms14788 KiB
#include "king.h" #include <bits/stdc++.h> using namespace std; long long SendInfo(std::vector<int> W, std::vector<int> C) { return 0; }
#include "vassal.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> pi; typedef vector <ll> vi; typedef vector <pi> vpi; #define f first #define s second #define FOR(i,s,e) for(ll i=s;i<=ll(e);++i) #define DEC(i,s,e) for(ll i=s;i>=ll(e);--i) #define pb push_back #define all(x) (x).begin(), (x).end() #define lbd(x, y) lower_bound(all(x), y) #define ubd(x, y) upper_bound(all(x), y) #define aFOR(i,x) for (auto i: x) #define mem(x,i) memset(x,i,sizeof x) #define fast ios_base::sync_with_stdio(false),cin.tie(0) long long BB; multiset <pi> S; int n; void Init(long long B, std::vector<int> C){ n = C.size(); FOR(i,0,n-1){ S.insert(pi(C[i],i)); } } int Maid(int W){ auto it = S.lower_bound(pi(W,1e9)); if (it != S.end()){ int ans = it->s; S.erase(it); return ans; }else return -1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...