Submission #148969

#TimeUsernameProblemLanguageResultExecution timeMemory
148969ummm (#200)King of Chairs (FXCUP4_chairs)C++17
100 / 100
163 ms10452 KiB
#include "king.h" long long SendInfo(std::vector<int> W, std::vector<int> C) { // int N = W.size(); // return W[0]*100 + W[1]*10 + W[2]*1; return 0; }
/* cerberus97 - Hanit Banga */ #include <iostream> #include <iomanip> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <algorithm> #include "vassal.h" using namespace std; #define pb push_back #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL) typedef long long ll; typedef long double ld; typedef pair <int, int> pii; typedef pair <ll, ll> pll; const int N = 1e5 + 10; ll BB; set<pii> available; void Init(ll B, std::vector<int> C) { int N = C.size(); BB = B; for (int i = 0; i < N; ++i) { available.insert({C[i], i}); } // ToDo } int Maid(int W) { auto it = available.lower_bound({W, -1}); if (it != available.end()) { int ans = it->second; available.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...