#include "king.h"
#include<algorithm>
using namespace std;
long long SendInfo(std::vector<int> w, std::vector<int> c) {
int n = w.size();
sort(w.begin(), w.end());
sort(c.begin(), c.end());
int cnt = 0;
int i, j;
for (i = j = n - 1; i >= 0 && j >= 0;)
{
if (w[i] > c[j]) i--;
else if (w[i] <= c[j]) {
cnt++;
i--;
j--;
}
}
if (cnt == 0) return 0;
return w[cnt-1];
}
#include "vassal.h"
#include<algorithm>
using namespace std;
long long m;
int n;
typedef pair<int, int> pii;
pii v[100009];
void Init(long long mm, std::vector<int> c){
n = c.size();
m = mm;
// ToDo
for (int i = 0; i < n; i++) {
v[i].first = c[i];
v[i].second = i;
}
sort(v, v + n);
}
int Maid(int w){
if(w>m) return -1;
return v[lower_bound(v, v + n, pii(w, -1)) - v].second;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
548 KB |
Correct |
2 |
Runtime error |
10 ms |
1056 KB |
Execution failed because the return code was nonzero |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
55 ms |
3908 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
59 ms |
3916 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |