# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
220217 | atoiz | Stray Cat (JOI20_stray) | C++14 | 73 ms | 16980 KiB |
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 <vector>
using namespace std;
namespace Anthony_7 {
int N, M;
vector<int> U, V, X;
vector<vector<int>> adj;
void dfs(int u, int id, int path_order = -1)
{
if (adj[u].size() == 1) return;
if (adj[u].size() == 2) {
int nxt = id ^ adj[u][0] ^ adj[u][1];
if (!~path_order) path_order = X[id];
path_order = (path_order + 1) % 6;
X[nxt] = (path_order == 1 || path_order == 4 || path_order == 5);
return dfs(U[nxt] ^ V[nxt] ^ u, nxt, path_order);
}
int x = X[id] ^ 1;
for (int nxt : adj[u]) if (nxt != id) {
X[nxt] = x;
dfs(U[nxt] ^ V[nxt] ^ u, nxt);
}
}
vector<int> mark(int _N, int _M, int A, int B, vector<int> _U, vector<int> _V)
# | 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... |