#include "Joi.h"
using namespace std;
void Joi(int N, int M, int A[], int B[], long long X, int T) {
for(int i = 0; i < N; i++){
if(i > 60) {
MessageBoard(i, 0);
continue;
}
if(X & (1ll << i))
MessageBoard(i, 1);
else
MessageBoard(i, 0);
}
}
#include "Ioi.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
typedef long long ll;
const int NN = 10123;
int what[NN];
vector<int> g[NN];
bool u[NN];
void dfs(int x, int pr = -1) {
u[x] = 1;
for(auto to : g[x]) {
if(u[to]) continue;
what[to] = Move(to);
dfs(to, x);
Move(x);
}
}
long long Ioi(int N, int M, int A[], int B[], int P, int V, int T) {
memset(what, -1, sizeof what);
memset(u, 0, sizeof u);
for(int i = 0; i < M; i ++) {
g[A[i]].pb(B[i]);
g[B[i]].pb(A[i]);
}
what[P] = V;
dfs(P);
for(int i = 0; i < N; i ++) {
assert(u[i] == 1);
assert(what[i] != -1);
}
ll tmp = 0;
for(int i = 0; i < N; i ++) {
if(i > 60)
break;
tmp += (1ll << i) * what[i];
}
return tmp;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
860 KB |
Output is correct |
2 |
Correct |
4 ms |
1284 KB |
Output is correct |
3 |
Correct |
4 ms |
1468 KB |
Output is correct |
4 |
Correct |
4 ms |
1604 KB |
Output is correct |
5 |
Correct |
4 ms |
1624 KB |
Output is correct |
6 |
Correct |
4 ms |
1632 KB |
Output is correct |
7 |
Correct |
4 ms |
1672 KB |
Output is correct |
8 |
Correct |
5 ms |
1772 KB |
Output is correct |
9 |
Correct |
4 ms |
1848 KB |
Output is correct |
10 |
Correct |
3 ms |
1864 KB |
Output is correct |
11 |
Correct |
7 ms |
2040 KB |
Output is correct |
12 |
Correct |
3 ms |
2216 KB |
Output is correct |
13 |
Correct |
4 ms |
2216 KB |
Output is correct |
14 |
Correct |
4 ms |
2216 KB |
Output is correct |
15 |
Correct |
4 ms |
2216 KB |
Output is correct |
16 |
Correct |
4 ms |
2216 KB |
Output is correct |
17 |
Correct |
4 ms |
2216 KB |
Output is correct |
18 |
Correct |
4 ms |
2216 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
3604 KB |
Output is correct |
2 |
Correct |
41 ms |
4584 KB |
Output is correct |
3 |
Correct |
33 ms |
4692 KB |
Output is correct |
4 |
Correct |
18 ms |
4800 KB |
Output is correct |
5 |
Correct |
19 ms |
4800 KB |
Output is correct |
6 |
Correct |
19 ms |
4800 KB |
Output is correct |
7 |
Correct |
18 ms |
4800 KB |
Output is correct |
8 |
Correct |
20 ms |
4800 KB |
Output is correct |
9 |
Correct |
25 ms |
4800 KB |
Output is correct |
10 |
Correct |
18 ms |
4800 KB |
Output is correct |
11 |
Correct |
20 ms |
4800 KB |
Output is correct |
12 |
Correct |
19 ms |
4800 KB |
Output is correct |
13 |
Correct |
19 ms |
4800 KB |
Output is correct |
14 |
Correct |
19 ms |
4800 KB |
Output is correct |
15 |
Correct |
19 ms |
4800 KB |
Output is correct |
16 |
Correct |
22 ms |
4800 KB |
Output is correct |
17 |
Correct |
18 ms |
4800 KB |
Output is correct |
18 |
Correct |
18 ms |
4800 KB |
Output is correct |
19 |
Correct |
17 ms |
4800 KB |
Output is correct |
20 |
Correct |
14 ms |
4800 KB |
Output is correct |
21 |
Correct |
15 ms |
4800 KB |
Output is correct |
22 |
Correct |
22 ms |
4800 KB |
Output is correct |
23 |
Correct |
18 ms |
4800 KB |
Output is correct |
24 |
Correct |
18 ms |
4800 KB |
Output is correct |
25 |
Correct |
20 ms |
4800 KB |
Output is correct |
26 |
Correct |
21 ms |
4800 KB |
Output is correct |
27 |
Correct |
17 ms |
4800 KB |
Output is correct |
28 |
Correct |
18 ms |
4800 KB |
Output is correct |
29 |
Correct |
19 ms |
4800 KB |
Output is correct |
30 |
Correct |
17 ms |
4800 KB |
Output is correct |
31 |
Correct |
4 ms |
4800 KB |
Output is correct |
32 |
Correct |
3 ms |
4800 KB |
Output is correct |
33 |
Correct |
4 ms |
4800 KB |
Output is correct |
34 |
Correct |
3 ms |
4800 KB |
Output is correct |
35 |
Correct |
3 ms |
4800 KB |
Output is correct |
36 |
Correct |
4 ms |
4800 KB |
Output is correct |
37 |
Correct |
3 ms |
4800 KB |
Output is correct |
38 |
Correct |
3 ms |
4800 KB |
Output is correct |
39 |
Correct |
3 ms |
4800 KB |
Output is correct |
40 |
Correct |
3 ms |
4800 KB |
Output is correct |
41 |
Correct |
3 ms |
4800 KB |
Output is correct |
42 |
Correct |
3 ms |
4800 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
4800 KB |
Output is correct |
2 |
Correct |
3 ms |
4800 KB |
Output is correct |
3 |
Correct |
3 ms |
4800 KB |
Output is correct |
4 |
Incorrect |
5 ms |
4800 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
4800 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
34 ms |
4800 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |