#include "Anthony.h"
#include<bits/stdc++.h>
using namespace std;
vector<int>adj[200001];
int depth[200001],col[200001];
int vs[200001];
void dfs(int x){
vs[x] = 1;
for(auto s: adj[x]){
if(!vs[s]) {
depth[s] = depth[x] + 1;
dfs(s);
}
}
}
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
for(int i = 1; i <= N; i++) {
adj[i].clear();
depth[i] = vs[i] = 0;
}
for(int i = 0; i < M; i++){
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
dfs(0);
vector<int>ans;
for(int i = 0; i < M; i++){
ans.push_back(max(depth[U[i]], depth[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;
}
int Move(vector<int> y) {
set<int>p;
int col = 0;
for(auto s: y) {
if(s > 0) p.insert(col);
col++;
}
auto xx = *p.begin();
p.erase(p.begin());
if(p.empty()) return xx;
if(xx == 0 and *p.begin() == 1) return 0;
if(xx == 1 and *p.begin() == 2) return 1;
if(xx == 0 and *p.begin() == 2) return 2;
return -1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
20676 KB |
Output is correct |
2 |
Correct |
3 ms |
5208 KB |
Output is correct |
3 |
Correct |
27 ms |
19512 KB |
Output is correct |
4 |
Correct |
36 ms |
22264 KB |
Output is correct |
5 |
Correct |
36 ms |
22440 KB |
Output is correct |
6 |
Correct |
28 ms |
20224 KB |
Output is correct |
7 |
Correct |
30 ms |
20248 KB |
Output is correct |
8 |
Correct |
46 ms |
21580 KB |
Output is correct |
9 |
Correct |
36 ms |
21452 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
20676 KB |
Output is correct |
2 |
Correct |
3 ms |
5208 KB |
Output is correct |
3 |
Correct |
27 ms |
19512 KB |
Output is correct |
4 |
Correct |
36 ms |
22264 KB |
Output is correct |
5 |
Correct |
36 ms |
22440 KB |
Output is correct |
6 |
Correct |
28 ms |
20224 KB |
Output is correct |
7 |
Correct |
30 ms |
20248 KB |
Output is correct |
8 |
Correct |
46 ms |
21580 KB |
Output is correct |
9 |
Correct |
36 ms |
21452 KB |
Output is correct |
10 |
Incorrect |
26 ms |
18220 KB |
Wrong Answer [6] |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
18304 KB |
Output is correct |
2 |
Correct |
2 ms |
5272 KB |
Output is correct |
3 |
Correct |
24 ms |
17336 KB |
Output is correct |
4 |
Correct |
34 ms |
20096 KB |
Output is correct |
5 |
Correct |
34 ms |
20044 KB |
Output is correct |
6 |
Correct |
33 ms |
17904 KB |
Output is correct |
7 |
Correct |
28 ms |
18120 KB |
Output is correct |
8 |
Correct |
31 ms |
19092 KB |
Output is correct |
9 |
Correct |
33 ms |
19064 KB |
Output is correct |
10 |
Correct |
30 ms |
18748 KB |
Output is correct |
11 |
Correct |
30 ms |
18828 KB |
Output is correct |
12 |
Correct |
30 ms |
18796 KB |
Output is correct |
13 |
Correct |
30 ms |
18744 KB |
Output is correct |
14 |
Correct |
34 ms |
19168 KB |
Output is correct |
15 |
Correct |
33 ms |
19152 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
18304 KB |
Output is correct |
2 |
Correct |
2 ms |
5272 KB |
Output is correct |
3 |
Correct |
24 ms |
17336 KB |
Output is correct |
4 |
Correct |
34 ms |
20096 KB |
Output is correct |
5 |
Correct |
34 ms |
20044 KB |
Output is correct |
6 |
Correct |
33 ms |
17904 KB |
Output is correct |
7 |
Correct |
28 ms |
18120 KB |
Output is correct |
8 |
Correct |
31 ms |
19092 KB |
Output is correct |
9 |
Correct |
33 ms |
19064 KB |
Output is correct |
10 |
Correct |
30 ms |
18748 KB |
Output is correct |
11 |
Correct |
30 ms |
18828 KB |
Output is correct |
12 |
Correct |
30 ms |
18796 KB |
Output is correct |
13 |
Correct |
30 ms |
18744 KB |
Output is correct |
14 |
Correct |
34 ms |
19168 KB |
Output is correct |
15 |
Correct |
33 ms |
19152 KB |
Output is correct |
16 |
Incorrect |
24 ms |
16228 KB |
Wrong Answer [6] |
17 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5268 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
7096 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
7012 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |