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;
typedef long long ll;
typedef vector<int> vi;
ll SendInfo(vi W, vi C) {
multiset<int>s;
int n=C.size();
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;
s.erase(it);
ans++;
}
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 pref=0;
multiset<pi>s;
void Init(ll B, vi C){
pref=B;
int n=C.size();
for(int i=0; i<n; i++)
s.insert({C[i],i});
}
int Maid(int W){
if(!pref)return -1;
if(W>=s.rbegin()->first)return -1;
pref--;
int ans=s.rbegin()->second;
s.erase(s.find(*s.rbegin()));
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |