#include "Anthony.h"
#include<bits/stdc++.h>
using namespace std;
vector<int>adj[200001];
int depth[200001],col[200001];
void dfs(int x, int p){
depth[x] = depth[p] + 1;
for(auto s: adj[x]){
if(!depth[s]) dfs(s,x);
}
}
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();
for(int i = 0; i < M; i++){
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
dfs(0,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;
for(auto s: y) p.insert(s);
auto xx = *p.begin(), yy = 0;
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;
}
Compilation message
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:16:25: warning: unused variable 'yy' [-Wunused-variable]
16 | auto xx = *p.begin(), yy = 0;
| ^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
31 ms |
19860 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
31 ms |
19860 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
25 ms |
17824 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
25 ms |
17824 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
5256 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
6560 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
6512 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |