#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
const int NMAX = 2e4 + 5;
const int ROOT = 0;
vector < int > G[NMAX];
vector < int > ans;
int Level[NMAX];
bool Sel[NMAX];
queue < int > Q;
void Add_Edge (int x, int y)
{
G[x].push_back(y), G[y].push_back(x);
return;
}
void BFS (int Node)
{
Sel[Node] = 1, Level[Node] = 0;
Q.push(Node);
while(!Q.empty())
{
int Node = Q.front();
Q.pop();
for(auto it : G[Node])
if(!Sel[it])
{
Sel[it] = 1, Level[it] = 1 + Level[Node];
Q.push(it);
}
}
return;
}
vector < int > Mark (int N, int M, int A, int B, vector < int > U, vector < int > V)
{
for(int i = 0; i < M; ++i)
{
int X = U[i], Y = V[i];
Add_Edge(X, Y);
}
BFS(ROOT);
ans.resize(M);
ans.shrink_to_fit();
for(int i = 0; i < M; ++i)
ans[i] = min(Level[U[i]], Level[V[i]]) % 3;
return ans;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
int A, B;
void Init (int a, int b)
{
A = a, B = b;
return;
}
int Move (vector < int > y)
{
int cnt = 0, X = -1;
for(int i = 0; i < A; ++i)
if(y[i])
++cnt, X = i;
if(cnt == 1)
return X;
if(y[0] && y[1])
return 0;
if(y[1] && y[2])
return 1;
return 2;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
47 ms |
16132 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
39 ms |
15460 KB |
Output is correct |
4 |
Correct |
61 ms |
17284 KB |
Output is correct |
5 |
Correct |
56 ms |
17280 KB |
Output is correct |
6 |
Correct |
48 ms |
15856 KB |
Output is correct |
7 |
Correct |
46 ms |
15824 KB |
Output is correct |
8 |
Correct |
53 ms |
16596 KB |
Output is correct |
9 |
Correct |
52 ms |
16568 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
47 ms |
16132 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
39 ms |
15460 KB |
Output is correct |
4 |
Correct |
61 ms |
17284 KB |
Output is correct |
5 |
Correct |
56 ms |
17280 KB |
Output is correct |
6 |
Correct |
48 ms |
15856 KB |
Output is correct |
7 |
Correct |
46 ms |
15824 KB |
Output is correct |
8 |
Correct |
53 ms |
16596 KB |
Output is correct |
9 |
Correct |
52 ms |
16568 KB |
Output is correct |
10 |
Correct |
40 ms |
13864 KB |
Output is correct |
11 |
Correct |
43 ms |
13992 KB |
Output is correct |
12 |
Correct |
44 ms |
14028 KB |
Output is correct |
13 |
Correct |
40 ms |
14124 KB |
Output is correct |
14 |
Correct |
41 ms |
14188 KB |
Output is correct |
15 |
Correct |
47 ms |
14588 KB |
Output is correct |
16 |
Correct |
50 ms |
16724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
45 ms |
13788 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
44 ms |
13420 KB |
Output is correct |
4 |
Correct |
53 ms |
15108 KB |
Output is correct |
5 |
Correct |
73 ms |
15224 KB |
Output is correct |
6 |
Correct |
48 ms |
13780 KB |
Output is correct |
7 |
Correct |
41 ms |
13524 KB |
Output is correct |
8 |
Correct |
48 ms |
14472 KB |
Output is correct |
9 |
Correct |
60 ms |
14572 KB |
Output is correct |
10 |
Correct |
46 ms |
14084 KB |
Output is correct |
11 |
Correct |
49 ms |
14216 KB |
Output is correct |
12 |
Correct |
46 ms |
14212 KB |
Output is correct |
13 |
Correct |
46 ms |
14220 KB |
Output is correct |
14 |
Correct |
50 ms |
14484 KB |
Output is correct |
15 |
Correct |
50 ms |
14472 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
45 ms |
13788 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
44 ms |
13420 KB |
Output is correct |
4 |
Correct |
53 ms |
15108 KB |
Output is correct |
5 |
Correct |
73 ms |
15224 KB |
Output is correct |
6 |
Correct |
48 ms |
13780 KB |
Output is correct |
7 |
Correct |
41 ms |
13524 KB |
Output is correct |
8 |
Correct |
48 ms |
14472 KB |
Output is correct |
9 |
Correct |
60 ms |
14572 KB |
Output is correct |
10 |
Correct |
46 ms |
14084 KB |
Output is correct |
11 |
Correct |
49 ms |
14216 KB |
Output is correct |
12 |
Correct |
46 ms |
14212 KB |
Output is correct |
13 |
Correct |
46 ms |
14220 KB |
Output is correct |
14 |
Correct |
50 ms |
14484 KB |
Output is correct |
15 |
Correct |
50 ms |
14472 KB |
Output is correct |
16 |
Correct |
37 ms |
12108 KB |
Output is correct |
17 |
Correct |
41 ms |
11980 KB |
Output is correct |
18 |
Correct |
43 ms |
11988 KB |
Output is correct |
19 |
Correct |
40 ms |
11980 KB |
Output is correct |
20 |
Correct |
51 ms |
12492 KB |
Output is correct |
21 |
Correct |
46 ms |
12384 KB |
Output is correct |
22 |
Correct |
52 ms |
14420 KB |
Output is correct |
23 |
Correct |
51 ms |
12116 KB |
Output is correct |
24 |
Correct |
54 ms |
12108 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1536 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
4352 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
4352 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |