#include "king.h"
using namespace std;
long long SendInfo(std::vector<int> W, std::vector<int> C) {
return 0;
}
#include "vassal.h"
#include <vector>
#include <algorithm>
#include <cassert>
#define pii pair<int,int>
#define sz(x) (int)(x).size()
using namespace std;
vector<pii> vec;
int n;
int p[100002];
char visit[100002];
int find(int a) {
if (p[a] == a) return a;
return p[a] = find(p[a]);
}
void merge(int a, int b) {
a = find(a);
b = find(b);
if (a == b) return;
p[b] = a;
}
void Init(long long B, std::vector<int> C) {
int N = C.size();
for (int i = 0; i < N; i++) {
p[i] = i;
vec.push_back({ C[i], i });
}
p[N] = N;
n = N;
sort(vec.begin(), vec.end());
assert(0);
}
// �꺸�� ���̰ų� �����鼭 ���� ���� ����.
int Maid(int W) {
int idx = upper_bound(vec.begin(), vec.end(), pii(W, -1)) - vec.begin();
if (idx == sz(vec)) return -1;
// printf("%d %d %d///", W, idx, vec[idx].second);
if (visit[idx] == 0) {
visit[idx]++;
return vec[idx].second;
}
else {
idx = find(idx);
idx++;
if (idx == sz(vec)) return -1;
visit[idx]++;
return vec[idx].second;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
10 ms |
1188 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
52 ms |
4016 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
54 ms |
4288 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |