#include "king.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define all(x) x.begin(),x.end()
ll SendInfo(vi W, vi C) {
sort(all(W));
sort(all(C));
int n=C.size();
multiset<int>s;
for(int i=0; i<n; i++)
s.insert(C[i]);
int ans=0;
for(int i=0; i<n; i++){
auto it=s.lower_bound(W[i]);
if(it==s.end())break;
ans=*it;
s.erase(it);
}
return ans;
}
#include "vassal.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int>pi;
int mx=0;
multiset<pi>s;
void Init(ll B, vi C){
mx=B;
int n=C.size();
for(int i=0; i<n; i++)
s.insert({C[i],i});
}
int Maid(int W){
if(W>mx)return -1;
auto it=s.upper_bound({W,-1});
int ans=it->second;
s.erase(it);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
484 KB |
Correct |
2 |
Runtime error |
2 ms |
612 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
58 ms |
10876 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
76 ms |
11012 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |