Submission #149294

#TimeUsernameProblemLanguageResultExecution timeMemory
149294Showing Hands (#200)King of Chairs (FXCUP4_chairs)C++17
95 / 100
156 ms10444 KiB
#include "king.h" #include<bits/stdc++.h> using namespace std; long long SendInfo(std::vector<int> W, std::vector<int> C) { int i,j,n = W.size(); sort(W.begin() , W.end()); for(i=j=0; i<n && j<n ;i++,j++){ for(;j<n && C[j] < W[i] ; j++); } return i ? W[i-1] : 0; }
#include "vassal.h" #include<bits/stdc++.h> using namespace std; multiset< pair<int,int> > S; multiset< pair<int,int> > :: iterator it; long long B; void Init(long long BB, std::vector<int> C){ int i, n = C.size(); B = BB; for(i=0;i<n;i++) S.insert(make_pair(C[i],i)); } int Maid(int W){ if(W > B) return -1; it = S.lower_bound(make_pair(W,0)); if(it == S.end()) return -1; int i = it -> second; S.erase(it); return i; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...