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>
using namespace std;
long long SendInfo(vector<int> W, vector<int> C){
sort(W.begin(), W.end());
sort(C.begin(), C.end());
int n = C.size();
int ret = 0;
for (int j = 0, i = 0; i < n && j < n; ++i){
for (; j < n && C[j] < W[i]; ++j);
if (j >= n)
break;
ret = W[i];
}
return ret;
}
#include "vassal.h"
#include <bits/stdc++.h>
using namespace std;
long long B;
set<pair<int, int>> C;
void Init(long long B, vector<int> C){
::B = B;
for (size_t i = 0; i < C.size(); ++i)
::C.emplace(C[i], i);
}
int Maid(int W){
if (W > B)
return -1;
auto p = C.lower_bound(make_pair(W, 0));
if (p == C.end())
return -1;
int res = p->second;
C.erase(p);
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |