#include "Anthony.h"
#include <vector>
#include <bits/stdc++.h>
namespace {
int FunctionExample(int i, int A) {
return i % A;
}
} // namespace
std::vector<int> Mark(int N, int M, int A, int B,
std::vector<int> U, std::vector<int> V) {
std::vector<int> adj[20001];
int index[20001] = {};
std::vector<int> X(M);
std::queue<int> bfs;
bfs.push(0);
index[0] = 1;
for (int i = 0; i < M; ++i) {
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
while(!bfs.empty()){
int node = bfs.back();
bfs.pop();
for(auto child:adj[node]){
if(index[child]==0){
index[child] = index[node] + 1;
if(index[child]==4) index[child] = 1;
bfs.push(child);
}
}
}
for (int i = 0; i < M; ++i) {
int nodeA = index[U[i]];
int nodeB = index[V[i]];
if(nodeA > nodeB) std::swap(nodeA,nodeB);
if((nodeA == 1)&&(nodeB == 2)) X[i] = 0;
if((nodeA == 2)&&(nodeB == 3)) X[i] = 1;
if((nodeA == 1)&&(nodeB == 3)) X[i] = 2;
if((nodeA == 2)&&(nodeB == 2)) X[i] = 1;
if((nodeA == 3)&&(nodeB == 3)) X[i] = 2;
if((nodeA == 1)&&(nodeB == 1)) X[i] = 0;
}
return X;
}
#include "Catherine.h"
#include <vector>
namespace {
int A, B;
int variable_example = 0;
} // namespace
using namespace std;
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(std::vector<int> y) {
++variable_example;
/*for (int j = 0; j < A; ++j) {
if (y[j] != 0) {
return j;
}
}*/
if (y[0]==0){
if (y[1]==0){
return 2;
}
else return 1;
}
if (y[1]==0){
if (y[2]==0){
return 0;
}
else return 2;
}
if (y[2]==0){
if (y[0]==0){
return 1;
}
else return 0;
}
return -1;
}
Compilation message
Anthony.cpp:7:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
7 | int FunctionExample(int i, int A) {
| ^~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
43 ms |
14404 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
43 ms |
14404 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
30 ms |
12032 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
30 ms |
12032 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1408 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
2176 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
34 ms |
10632 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |