#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});
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 |
10 ms |
972 KB |
Correct |
2 |
Correct |
10 ms |
1044 KB |
Correct |
3 |
Correct |
11 ms |
1044 KB |
Correct |
4 |
Correct |
11 ms |
1048 KB |
Correct |
5 |
Correct |
10 ms |
784 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
76 ms |
8228 KB |
Correct |
2 |
Correct |
135 ms |
13776 KB |
Correct |
3 |
Correct |
152 ms |
14708 KB |
Correct |
4 |
Correct |
145 ms |
14708 KB |
Correct |
5 |
Correct |
150 ms |
14964 KB |
Correct |
6 |
Correct |
146 ms |
14960 KB |
Correct |
7 |
Correct |
149 ms |
15212 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
95 ms |
8404 KB |
B = 993847 |
2 |
Partially correct |
170 ms |
14028 KB |
B = 996200 |
3 |
Partially correct |
161 ms |
14896 KB |
B = 706116 |
4 |
Runtime error |
183 ms |
15336 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
5 |
Halted |
0 ms |
0 KB |
- |