#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.front();
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 |
Correct |
41 ms |
15412 KB |
Output is correct |
2 |
Correct |
1 ms |
1032 KB |
Output is correct |
3 |
Correct |
30 ms |
14692 KB |
Output is correct |
4 |
Correct |
43 ms |
16488 KB |
Output is correct |
5 |
Correct |
44 ms |
16424 KB |
Output is correct |
6 |
Correct |
38 ms |
15124 KB |
Output is correct |
7 |
Correct |
54 ms |
15248 KB |
Output is correct |
8 |
Correct |
41 ms |
15824 KB |
Output is correct |
9 |
Correct |
43 ms |
15740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
41 ms |
15412 KB |
Output is correct |
2 |
Correct |
1 ms |
1032 KB |
Output is correct |
3 |
Correct |
30 ms |
14692 KB |
Output is correct |
4 |
Correct |
43 ms |
16488 KB |
Output is correct |
5 |
Correct |
44 ms |
16424 KB |
Output is correct |
6 |
Correct |
38 ms |
15124 KB |
Output is correct |
7 |
Correct |
54 ms |
15248 KB |
Output is correct |
8 |
Correct |
41 ms |
15824 KB |
Output is correct |
9 |
Correct |
43 ms |
15740 KB |
Output is correct |
10 |
Correct |
32 ms |
13156 KB |
Output is correct |
11 |
Correct |
36 ms |
13132 KB |
Output is correct |
12 |
Correct |
36 ms |
13240 KB |
Output is correct |
13 |
Correct |
31 ms |
13288 KB |
Output is correct |
14 |
Correct |
34 ms |
13552 KB |
Output is correct |
15 |
Correct |
40 ms |
13756 KB |
Output is correct |
16 |
Correct |
48 ms |
15932 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
12792 KB |
Output is correct |
2 |
Correct |
2 ms |
1032 KB |
Output is correct |
3 |
Correct |
30 ms |
12360 KB |
Output is correct |
4 |
Correct |
40 ms |
14144 KB |
Output is correct |
5 |
Correct |
44 ms |
14176 KB |
Output is correct |
6 |
Correct |
34 ms |
12824 KB |
Output is correct |
7 |
Correct |
32 ms |
12880 KB |
Output is correct |
8 |
Correct |
39 ms |
13488 KB |
Output is correct |
9 |
Correct |
41 ms |
13492 KB |
Output is correct |
10 |
Correct |
38 ms |
13360 KB |
Output is correct |
11 |
Correct |
35 ms |
13268 KB |
Output is correct |
12 |
Correct |
39 ms |
13252 KB |
Output is correct |
13 |
Correct |
36 ms |
13392 KB |
Output is correct |
14 |
Correct |
42 ms |
13564 KB |
Output is correct |
15 |
Correct |
53 ms |
13456 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
12792 KB |
Output is correct |
2 |
Correct |
2 ms |
1032 KB |
Output is correct |
3 |
Correct |
30 ms |
12360 KB |
Output is correct |
4 |
Correct |
40 ms |
14144 KB |
Output is correct |
5 |
Correct |
44 ms |
14176 KB |
Output is correct |
6 |
Correct |
34 ms |
12824 KB |
Output is correct |
7 |
Correct |
32 ms |
12880 KB |
Output is correct |
8 |
Correct |
39 ms |
13488 KB |
Output is correct |
9 |
Correct |
41 ms |
13492 KB |
Output is correct |
10 |
Correct |
38 ms |
13360 KB |
Output is correct |
11 |
Correct |
35 ms |
13268 KB |
Output is correct |
12 |
Correct |
39 ms |
13252 KB |
Output is correct |
13 |
Correct |
36 ms |
13392 KB |
Output is correct |
14 |
Correct |
42 ms |
13564 KB |
Output is correct |
15 |
Correct |
53 ms |
13456 KB |
Output is correct |
16 |
Correct |
31 ms |
11320 KB |
Output is correct |
17 |
Correct |
32 ms |
11744 KB |
Output is correct |
18 |
Correct |
33 ms |
11704 KB |
Output is correct |
19 |
Correct |
33 ms |
11660 KB |
Output is correct |
20 |
Correct |
39 ms |
12196 KB |
Output is correct |
21 |
Correct |
43 ms |
12084 KB |
Output is correct |
22 |
Correct |
44 ms |
14180 KB |
Output is correct |
23 |
Correct |
35 ms |
11784 KB |
Output is correct |
24 |
Correct |
37 ms |
11796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1152 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
2152 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
2180 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |