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;
long long SendInfo(vector<int> w,vector<int> c)
{
sort(w.begin(),w.end());
multiset<int> s;
for (int i:c)
s.insert(i);
int cur=0;
for (int i:w)
{
auto it=s.lower_bound(i);
if (it==s.end())
break;
cur=max(cur,i);
s.erase(it);
}
return cur;
}
#include "vassal.h"
#include <bits/stdc++.h>
using namespace std;
long long mx;
set<pair<int,int> > ch;
void Init(long long b,vector<int> c)
{
for (int i=0;i<c.size();i++)
ch.insert({c[i],i});
mx=b;
}
int Maid(int w)
{
if (w>mx)
return -1;
auto it=ch.lower_bound({w,0});
if (it==ch.end())
return -1;
int ret=it->second;
ch.erase(it);
return ret;
}
Compilation message (stderr)
vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:8:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i=0;i<c.size();i++)
~^~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |