#include "king.h"
long long SendInfo(std::vector<int> W, std::vector<int> C) {
int N = W.size();
int ten = 1;
int send = 0;
for (int i = N - 1; i >= 0; --i) {
send += W[i] * ten;
ten *= 10;
}
return send;
}
#include "vassal.h"
#include <stdio.h>
#include <unordered_map>
long long BB;
std::unordered_map<int, std::vector<int>> ans;
void Init(long long B, std::vector<int> C){
int N = C.size();
BB = B;
std::vector<int> occ(N), W;
while (B) {
W.push_back(B % 10);
B /= 10;
}
for (int i = N - 1; i >= 0; --i) {
ans[W[i]].push_back(-1);
for (int j = 0; j < N; ++j) {
if (occ[j] == 0 and C[j] >= W[i]) {
occ[j] = 1;
ans[W[i]][ans[W[i]].size() - 1] = j;
break;
}
}
}
}
int Maid(int W){
int temp = ans[W].back();
ans[W].pop_back();
return temp;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
10 ms |
1052 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
52 ms |
3788 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
40 ms |
3008 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |