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 <bits/stdc++.h>
#include "king.h"
#define send_info SendInfo
#define int32_t int
#define int64_t long long
int64_t send_info(std::vector< int32_t > w, std::vector< int32_t > c) {
std::sort(w.begin(), w.end());
int32_t indW = w.size() - 1, indC = c.size() - 1, ans = 0;
while(indW >= 0 && indC >= 0) {
if(c[indC] >= w[indW]) {
ans++;
indW--;
indC--;
}
else {
indW--;
}
}
return 0;
}
#include <bits/stdc++.h>
#include "vassal.h"
#define init Init
#define maid Maid
#define int32_t int
#define int64_t long long
std::set< std::pair< int32_t, int32_t > > s;
void init(int64_t b, std::vector< int32_t > c) {
for(int32_t i = c.size() - 1; i >= 0; i--) {
s.insert({ c[i], i });
}
}
int32_t maid(int32_t w) {
auto it = s.lower_bound({ w, 0 });
if(it != s.end()) {
int32_t ans = it->second;
s.erase(it);
return ans;
}
return -1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |