#include "Joi.h"
void Joi(int N, int M, int A[], int B[], long long X, int T) {
for (int i = 0; i < 60; ++i) {
MessageBoard(i, X >> i & 1);
}
for (int i = 60; i < N; ++i) {
MessageBoard(i, 0);
}
}
#include "Ioi.h"
#include <vector>
namespace {
template <class T>
using Vec = std::vector<T>;
Vec<Vec<int>> graph;
Vec<int> value;
void write(const int u, const int p) {
for (const auto v: graph[u]) {
if (value[v] == -1) {
value[v] = Move(v);
write(v, u);
}
}
if (p != -1) {
Move(p);
}
}
};
long long Ioi(int N, int M, int A[], int B[], int P, int V, int T) {
graph.resize(N);
value.resize(N, -1);
for (int i = 0; i < M; ++i) {
graph[A[i]].push_back(B[i]);
graph[B[i]].push_back(A[i]);
}
value[P] = V;
write(P, -1);
long long X = 0;
for (int i = 0; i < 60; ++i) {
if (value[i]) {
X += (1ll << i);
}
}
return X;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
988 KB |
Output is correct |
2 |
Correct |
1 ms |
744 KB |
Output is correct |
3 |
Correct |
1 ms |
752 KB |
Output is correct |
4 |
Correct |
2 ms |
980 KB |
Output is correct |
5 |
Correct |
1 ms |
1128 KB |
Output is correct |
6 |
Correct |
1 ms |
912 KB |
Output is correct |
7 |
Correct |
2 ms |
752 KB |
Output is correct |
8 |
Correct |
1 ms |
752 KB |
Output is correct |
9 |
Correct |
1 ms |
1028 KB |
Output is correct |
10 |
Correct |
1 ms |
744 KB |
Output is correct |
11 |
Correct |
5 ms |
1220 KB |
Output is correct |
12 |
Correct |
1 ms |
744 KB |
Output is correct |
13 |
Correct |
2 ms |
1028 KB |
Output is correct |
14 |
Correct |
2 ms |
752 KB |
Output is correct |
15 |
Correct |
2 ms |
752 KB |
Output is correct |
16 |
Correct |
2 ms |
892 KB |
Output is correct |
17 |
Correct |
2 ms |
1020 KB |
Output is correct |
18 |
Correct |
1 ms |
760 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
3640 KB |
Output is correct |
2 |
Correct |
25 ms |
3728 KB |
Output is correct |
3 |
Correct |
26 ms |
3848 KB |
Output is correct |
4 |
Correct |
15 ms |
2464 KB |
Output is correct |
5 |
Correct |
16 ms |
3112 KB |
Output is correct |
6 |
Correct |
15 ms |
2852 KB |
Output is correct |
7 |
Correct |
16 ms |
2588 KB |
Output is correct |
8 |
Correct |
17 ms |
2720 KB |
Output is correct |
9 |
Correct |
16 ms |
2416 KB |
Output is correct |
10 |
Correct |
14 ms |
2336 KB |
Output is correct |
11 |
Correct |
15 ms |
2272 KB |
Output is correct |
12 |
Correct |
14 ms |
2052 KB |
Output is correct |
13 |
Correct |
14 ms |
2052 KB |
Output is correct |
14 |
Correct |
15 ms |
2340 KB |
Output is correct |
15 |
Correct |
15 ms |
2456 KB |
Output is correct |
16 |
Correct |
16 ms |
2332 KB |
Output is correct |
17 |
Correct |
15 ms |
2204 KB |
Output is correct |
18 |
Correct |
15 ms |
2332 KB |
Output is correct |
19 |
Correct |
19 ms |
2372 KB |
Output is correct |
20 |
Correct |
13 ms |
2460 KB |
Output is correct |
21 |
Correct |
13 ms |
2332 KB |
Output is correct |
22 |
Correct |
15 ms |
2460 KB |
Output is correct |
23 |
Correct |
15 ms |
2332 KB |
Output is correct |
24 |
Correct |
16 ms |
2460 KB |
Output is correct |
25 |
Correct |
15 ms |
2460 KB |
Output is correct |
26 |
Correct |
15 ms |
2460 KB |
Output is correct |
27 |
Correct |
16 ms |
2460 KB |
Output is correct |
28 |
Correct |
16 ms |
2460 KB |
Output is correct |
29 |
Correct |
15 ms |
2476 KB |
Output is correct |
30 |
Correct |
15 ms |
2476 KB |
Output is correct |
31 |
Correct |
1 ms |
752 KB |
Output is correct |
32 |
Correct |
1 ms |
884 KB |
Output is correct |
33 |
Correct |
2 ms |
756 KB |
Output is correct |
34 |
Correct |
2 ms |
980 KB |
Output is correct |
35 |
Correct |
1 ms |
988 KB |
Output is correct |
36 |
Correct |
1 ms |
744 KB |
Output is correct |
37 |
Correct |
1 ms |
872 KB |
Output is correct |
38 |
Correct |
1 ms |
1028 KB |
Output is correct |
39 |
Correct |
1 ms |
872 KB |
Output is correct |
40 |
Correct |
1 ms |
872 KB |
Output is correct |
41 |
Correct |
2 ms |
988 KB |
Output is correct |
42 |
Correct |
1 ms |
928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1000 KB |
Output is correct |
2 |
Correct |
1 ms |
744 KB |
Output is correct |
3 |
Correct |
1 ms |
988 KB |
Output is correct |
4 |
Incorrect |
2 ms |
1188 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
27 ms |
3600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
26 ms |
3588 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |