#include "king.h"
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
int n;
vector<int> tw, tc;
LL SendInfo(vector<int> w, vector<int> c){
n=w.size();
tw=w;
tc=c;
sort(tw.begin(), tw.end());
sort(tc.begin(), tc.end());
int p=n-1;
LL num=0;
for(int i=n-1; i>=0; i--){
for(; p>=0; p--){
if(c[i]>=w[p]){
num++;
p--;
break;
}
}
}
return num;
}
#include "vassal.h"
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
int BB;
int N;
vector<pair<int, int> > Tc;
set<pair<int, int> > s;
void Init(long long B, std::vector<int> C){
N = C.size();
BB = (int)B;
for(int i=0; i<N; i++){
Tc.pb({C[i], i});
}
sort(Tc.begin(), Tc.end());
for(int i=N-BB; i<N; i++){
s.insert(Tc[i]);
}
}
int Maid(int W){
set<pair<int, int> >::iterator it;
it=s.lower_bound(make_pair(W, -987654321));
if(it==s.end())return -1;
int ret=it->second;
s.erase(it);
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
1144 KB |
Correct |
2 |
Incorrect |
10 ms |
536 KB |
Wrong |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
69 ms |
6680 KB |
Correct |
2 |
Correct |
118 ms |
10944 KB |
Correct |
3 |
Correct |
111 ms |
9652 KB |
Correct |
4 |
Correct |
127 ms |
11948 KB |
Correct |
5 |
Correct |
128 ms |
11944 KB |
Correct |
6 |
Correct |
124 ms |
11688 KB |
Correct |
7 |
Correct |
109 ms |
9640 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
72 ms |
5788 KB |
Wrong |
2 |
Halted |
0 ms |
0 KB |
- |