#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(M, 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);
assert(cnt != 3);
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 |
47 ms |
15200 KB |
Output is correct |
2 |
Correct |
1 ms |
1000 KB |
Output is correct |
3 |
Correct |
27 ms |
14824 KB |
Output is correct |
4 |
Correct |
40 ms |
15552 KB |
Output is correct |
5 |
Incorrect |
40 ms |
15536 KB |
Wrong Answer [6] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
47 ms |
15200 KB |
Output is correct |
2 |
Correct |
1 ms |
1000 KB |
Output is correct |
3 |
Correct |
27 ms |
14824 KB |
Output is correct |
4 |
Correct |
40 ms |
15552 KB |
Output is correct |
5 |
Incorrect |
40 ms |
15536 KB |
Wrong Answer [6] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
12856 KB |
Output is correct |
2 |
Correct |
0 ms |
1000 KB |
Output is correct |
3 |
Correct |
30 ms |
12472 KB |
Output is correct |
4 |
Correct |
47 ms |
13072 KB |
Output is correct |
5 |
Incorrect |
36 ms |
13216 KB |
Wrong Answer [6] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
12856 KB |
Output is correct |
2 |
Correct |
0 ms |
1000 KB |
Output is correct |
3 |
Correct |
30 ms |
12472 KB |
Output is correct |
4 |
Correct |
47 ms |
13072 KB |
Output is correct |
5 |
Incorrect |
36 ms |
13216 KB |
Wrong Answer [6] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1008 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
2156 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
2152 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |