Submission #153358

#TimeUsernameProblemLanguageResultExecution timeMemory
153358phparkKing of Chairs (FXCUP4_chairs)C++17
17 / 100
477 ms7296 KiB
#include "king.h" using namespace std; long long SendInfo(vector <int> W, vector <int> C) { return 1; }
#include <set> #include <iostream> #include <vector> #include <algorithm> #include "vassal.h" using namespace std; static set <int> sit; static vector <int> chair; static int N; void Init(long long B, vector <int> C) { N = C.size(); chair.resize(N); sort(C.begin(), C.end()); chair = C; for (int i = 0; i < N; i++) sit.insert(chair[i]); } int Maid(int w) { auto itr = sit.lower_bound(w); if (itr == sit.end()) { return -1; } else { int ans = *itr; auto it = find(chair.begin(), chair.end(), ans); auto index = distance(chair.begin(), it); sit.erase(itr); return (int)index; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...