#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
// namespace {
// int FunctionExample(int i, int A) {
// return i % A;
// }
// } // namespace
vector<int> Mark(int N, int M, int MarkerTypes, int Speling, vector<int> U, vector<int> V) {
// A -> [{b, index}]
vector<vector<pair<int, int>>> adj(N);
for (int i = 0; i < M; i++)
{
adj[U[i]].push_back({V[i], i});
adj[V[i]].push_back({U[i], i});
}
vector<int> markings(M, 3);
vector<int> depth(N, 1e9);
queue<int> todo;
depth[0] = 0;
todo.push(0);
while (! todo.empty()) {
int node = todo.front();
int next_depth = depth[node] + 1;
todo.pop();
for (auto [other, index] : adj[node]) {
if (depth[other] <= next_depth) {
continue;
}
depth[other] = next_depth;
markings[index] = next_depth % 3;
todo.push(other);
}
}
// filter out the marking 3 with a marking going deeper
for (int i = 0; i < M; i++)
{
if (markings[i] != 3) {
continue;
}
// depth of U[i] and V[i] should be the same
markings[i] = (depth[U[i]]+1) % 3;
}
return markings;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
// namespace {
// int A, B;
// int variable_example = 0;
// } // namespace
void Init(int A, int B) {
// ::A = A;
// ::B = B;
}
int Move(vector<int> y) {
if (y[0] > 0) {
if (y[2] > 0) {
return 2;
}
return 0;
}
if (y[1] > 0) {
return 1;
}
return 2;
// ++variable_example;
// for (int j = 0; j < A; ++j) {
// if (y[j] != 0) {
// return j;
// }
// }
// return -1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
15520 KB |
Output is correct |
2 |
Correct |
0 ms |
592 KB |
Output is correct |
3 |
Correct |
24 ms |
14844 KB |
Output is correct |
4 |
Correct |
33 ms |
16660 KB |
Output is correct |
5 |
Correct |
35 ms |
16568 KB |
Output is correct |
6 |
Correct |
28 ms |
15304 KB |
Output is correct |
7 |
Correct |
26 ms |
15280 KB |
Output is correct |
8 |
Correct |
33 ms |
16100 KB |
Output is correct |
9 |
Correct |
34 ms |
16100 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
15520 KB |
Output is correct |
2 |
Correct |
0 ms |
592 KB |
Output is correct |
3 |
Correct |
24 ms |
14844 KB |
Output is correct |
4 |
Correct |
33 ms |
16660 KB |
Output is correct |
5 |
Correct |
35 ms |
16568 KB |
Output is correct |
6 |
Correct |
28 ms |
15304 KB |
Output is correct |
7 |
Correct |
26 ms |
15280 KB |
Output is correct |
8 |
Correct |
33 ms |
16100 KB |
Output is correct |
9 |
Correct |
34 ms |
16100 KB |
Output is correct |
10 |
Incorrect |
23 ms |
13364 KB |
Wrong Answer [6] |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
13176 KB |
Output is correct |
2 |
Correct |
0 ms |
520 KB |
Output is correct |
3 |
Correct |
22 ms |
12720 KB |
Output is correct |
4 |
Correct |
32 ms |
14312 KB |
Output is correct |
5 |
Correct |
31 ms |
14328 KB |
Output is correct |
6 |
Correct |
26 ms |
13124 KB |
Output is correct |
7 |
Correct |
26 ms |
13084 KB |
Output is correct |
8 |
Correct |
36 ms |
13684 KB |
Output is correct |
9 |
Correct |
31 ms |
13744 KB |
Output is correct |
10 |
Correct |
26 ms |
13512 KB |
Output is correct |
11 |
Correct |
34 ms |
13624 KB |
Output is correct |
12 |
Correct |
27 ms |
13604 KB |
Output is correct |
13 |
Correct |
30 ms |
13576 KB |
Output is correct |
14 |
Correct |
33 ms |
13904 KB |
Output is correct |
15 |
Correct |
32 ms |
13828 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
13176 KB |
Output is correct |
2 |
Correct |
0 ms |
520 KB |
Output is correct |
3 |
Correct |
22 ms |
12720 KB |
Output is correct |
4 |
Correct |
32 ms |
14312 KB |
Output is correct |
5 |
Correct |
31 ms |
14328 KB |
Output is correct |
6 |
Correct |
26 ms |
13124 KB |
Output is correct |
7 |
Correct |
26 ms |
13084 KB |
Output is correct |
8 |
Correct |
36 ms |
13684 KB |
Output is correct |
9 |
Correct |
31 ms |
13744 KB |
Output is correct |
10 |
Correct |
26 ms |
13512 KB |
Output is correct |
11 |
Correct |
34 ms |
13624 KB |
Output is correct |
12 |
Correct |
27 ms |
13604 KB |
Output is correct |
13 |
Correct |
30 ms |
13576 KB |
Output is correct |
14 |
Correct |
33 ms |
13904 KB |
Output is correct |
15 |
Correct |
32 ms |
13828 KB |
Output is correct |
16 |
Correct |
24 ms |
11568 KB |
Output is correct |
17 |
Correct |
23 ms |
11596 KB |
Output is correct |
18 |
Incorrect |
23 ms |
11556 KB |
Wrong Answer [6] |
19 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
2660 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
2764 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |