This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
markings[i] = (min(depth[U[i]], depth[V[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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |