#include "king.h"
long long SendInfo(std::vector<int> W, std::vector<int> C) {
return 0;
}
#include "vassal.h"
#include <algorithm>
std::vector<std::pair<int, int>> chair;
void Init(long long B, std::vector<int> C){
int N = C.size();
for (int i = 0; i < N; i++) {
chair.push_back(std::pair<int,int>(C[i], i));
}
sort(chair.begin(), chair.end());
}
int Maid(int W){
for (int i = 0; i < chair.size(); i++) {
if (chair[i].first >= W) {
chair[i].first = 0;
return chair[i].second;
}
}
return -1;
}
Compilation message
vassal.cpp: In function 'int Maid(int)':
vassal.cpp:17:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < chair.size(); i++) {
~~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
668 KB |
Correct |
2 |
Correct |
4 ms |
916 KB |
Correct |
3 |
Correct |
4 ms |
768 KB |
Correct |
4 |
Correct |
4 ms |
644 KB |
Correct |
5 |
Correct |
4 ms |
788 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
827 ms |
5216 KB |
Correct |
2 |
Execution timed out |
1117 ms |
7720 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
839 ms |
5200 KB |
Correct |
2 |
Execution timed out |
1113 ms |
8548 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |