This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "king.h"
#include <bits/stdc++.h>
long long SendInfo(std::vector<int> W, std::vector<int> C) {
int N = W.size();
std::multiset<int> CC(C.begin(),C.end());
std::sort(W.begin(),W.end());
for(int i=0;i<N;i++) {
auto it=CC.lower_bound(W[i]);
if(it==CC.end()) return W[i]-1;
CC.erase(it);
}
return W[N-1];
}
#include "vassal.h"
#include <bits/stdc++.h>
long long BB;
std::set<std::pair<int,int>> S;
void Init(long long B, std::vector<int> C){
int N = C.size();
BB = B;
for(int i=0;i<N;i++) S.insert({C[i],i});
}
int Maid(int W){
int ret;
auto it=S.lower_bound(std::make_pair(W,-1));
if(W>BB || it==S.end()) return -1;
ret=it->second;
S.erase(it);
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |