#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
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++)
~^~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
1044 KB |
Correct |
2 |
Correct |
10 ms |
1044 KB |
Correct |
3 |
Correct |
13 ms |
1044 KB |
Correct |
4 |
Correct |
10 ms |
1040 KB |
Correct |
5 |
Correct |
10 ms |
1040 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
80 ms |
8144 KB |
Correct |
2 |
Correct |
136 ms |
13512 KB |
Correct |
3 |
Correct |
144 ms |
14960 KB |
Correct |
4 |
Correct |
149 ms |
14968 KB |
Correct |
5 |
Correct |
148 ms |
14708 KB |
Correct |
6 |
Correct |
160 ms |
14956 KB |
Correct |
7 |
Correct |
146 ms |
15208 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
97 ms |
8400 KB |
B = 993847 |
2 |
Partially correct |
181 ms |
13988 KB |
B = 996200 |
3 |
Partially correct |
169 ms |
14956 KB |
B = 706116 |
4 |
Partially correct |
196 ms |
15224 KB |
B = 998466 |
5 |
Partially correct |
190 ms |
15212 KB |
B = 995867 |
6 |
Partially correct |
193 ms |
14964 KB |
B = 997501 |
7 |
Partially correct |
172 ms |
14952 KB |
B = 706123 |
8 |
Correct |
142 ms |
15208 KB |
Correct |