#include "Anthony.h"
#include <vector>
#include <bits/stdc++.h>
#define maxn 20005
#define pii pair<int, int>
using namespace std;
namespace {
vector<int> adj[maxn];
const int inf = 8e7;
};
vector<int> Mark(int N, int M, int A, int B,
vector<int> U, vector<int> V) {
for (int i = 0;i < M;i++) adj[U[i]].push_back(V[i]), adj[V[i]].push_back(U[i]);
queue<int> que;
que.push(0);
vector<int> X(M), d(N, inf);
d[0] = 0;
while (que.size()) {
//cout << "zisk" << endl;
int cur = que.front();que.pop();
for (int v:adj[cur]) {
if (d[cur] + 1 < d[v]) {
d[v] = d[cur] + 1;
que.push(v);
}
}
}
for (int i = 0; i < M; ++i) {
if (d[U[i]] > d[V[i]]) swap(U[i], V[i]);
X[i] = d[U[i]] % 3;
}
return X;
}
#include "Catherine.h"
#include <vector>
#include "assert.h"
using namespace std;
namespace {
int A, B;
};
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(vector<int> y) {
int cnt = (y[0] ? 1 : 0) + (y[1] ? 1 : 0) + (y[2] ? 1 : 0);
if (cnt == 1) {
for (int i = 0;i < 3;i++) {
if (y[i]) return i;
}
} else {
if (y[0] && y[1]) return 0;
else if (y[1] && y[2]) return 1;
else if (y[2]) return 2;
}
return -1;
}
/*
7 6 3 6 1
0 2
0 4
1 2
1 3
1 5
4 6
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
35 ms |
15244 KB |
Output is correct |
2 |
Correct |
1 ms |
1000 KB |
Output is correct |
3 |
Correct |
32 ms |
14776 KB |
Output is correct |
4 |
Correct |
43 ms |
16376 KB |
Output is correct |
5 |
Correct |
43 ms |
16420 KB |
Output is correct |
6 |
Correct |
33 ms |
15532 KB |
Output is correct |
7 |
Correct |
33 ms |
15568 KB |
Output is correct |
8 |
Correct |
39 ms |
16308 KB |
Output is correct |
9 |
Correct |
39 ms |
16264 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
35 ms |
15244 KB |
Output is correct |
2 |
Correct |
1 ms |
1000 KB |
Output is correct |
3 |
Correct |
32 ms |
14776 KB |
Output is correct |
4 |
Correct |
43 ms |
16376 KB |
Output is correct |
5 |
Correct |
43 ms |
16420 KB |
Output is correct |
6 |
Correct |
33 ms |
15532 KB |
Output is correct |
7 |
Correct |
33 ms |
15568 KB |
Output is correct |
8 |
Correct |
39 ms |
16308 KB |
Output is correct |
9 |
Correct |
39 ms |
16264 KB |
Output is correct |
10 |
Correct |
33 ms |
13568 KB |
Output is correct |
11 |
Correct |
32 ms |
13544 KB |
Output is correct |
12 |
Correct |
36 ms |
13464 KB |
Output is correct |
13 |
Correct |
33 ms |
13520 KB |
Output is correct |
14 |
Correct |
33 ms |
13860 KB |
Output is correct |
15 |
Correct |
39 ms |
14248 KB |
Output is correct |
16 |
Correct |
38 ms |
16404 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
12848 KB |
Output is correct |
2 |
Correct |
0 ms |
1136 KB |
Output is correct |
3 |
Correct |
28 ms |
12536 KB |
Output is correct |
4 |
Correct |
40 ms |
14340 KB |
Output is correct |
5 |
Correct |
40 ms |
14344 KB |
Output is correct |
6 |
Correct |
32 ms |
13396 KB |
Output is correct |
7 |
Correct |
32 ms |
13404 KB |
Output is correct |
8 |
Correct |
37 ms |
13976 KB |
Output is correct |
9 |
Correct |
40 ms |
13956 KB |
Output is correct |
10 |
Correct |
37 ms |
13716 KB |
Output is correct |
11 |
Correct |
37 ms |
13668 KB |
Output is correct |
12 |
Correct |
35 ms |
13760 KB |
Output is correct |
13 |
Correct |
35 ms |
13660 KB |
Output is correct |
14 |
Correct |
40 ms |
14052 KB |
Output is correct |
15 |
Correct |
36 ms |
13976 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
12848 KB |
Output is correct |
2 |
Correct |
0 ms |
1136 KB |
Output is correct |
3 |
Correct |
28 ms |
12536 KB |
Output is correct |
4 |
Correct |
40 ms |
14340 KB |
Output is correct |
5 |
Correct |
40 ms |
14344 KB |
Output is correct |
6 |
Correct |
32 ms |
13396 KB |
Output is correct |
7 |
Correct |
32 ms |
13404 KB |
Output is correct |
8 |
Correct |
37 ms |
13976 KB |
Output is correct |
9 |
Correct |
40 ms |
13956 KB |
Output is correct |
10 |
Correct |
37 ms |
13716 KB |
Output is correct |
11 |
Correct |
37 ms |
13668 KB |
Output is correct |
12 |
Correct |
35 ms |
13760 KB |
Output is correct |
13 |
Correct |
35 ms |
13660 KB |
Output is correct |
14 |
Correct |
40 ms |
14052 KB |
Output is correct |
15 |
Correct |
36 ms |
13976 KB |
Output is correct |
16 |
Correct |
28 ms |
11788 KB |
Output is correct |
17 |
Correct |
27 ms |
11848 KB |
Output is correct |
18 |
Correct |
34 ms |
11748 KB |
Output is correct |
19 |
Correct |
34 ms |
11760 KB |
Output is correct |
20 |
Correct |
34 ms |
12348 KB |
Output is correct |
21 |
Correct |
31 ms |
12056 KB |
Output is correct |
22 |
Correct |
46 ms |
14076 KB |
Output is correct |
23 |
Correct |
32 ms |
11828 KB |
Output is correct |
24 |
Correct |
30 ms |
11708 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1008 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
2152 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
2136 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |