# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
925457 | adaawf | Stray Cat (JOI20_stray) | C++14 | 3052 ms | 16776 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 <bits/stdc++.h>
using namespace std;
namespace {
vector<pair<int, int>> g[20005];
int f[20005], dx[] = {1, 0, 1, 0, 0, 1}, dd[20005];
vector<int> res;
void dfs(int x, int p) {
int c = 0;
for (auto w : g[x]) {
if (w.second == p) continue;
c++;
if (c == 1) {
for (auto w : g[x]) {
if (w.second == p) continue;
res[w.second] = dx[f[x]];
f[w.first] = (f[x] + 1) % 6;
dfs(w.first, w.second);
}
}
else {
for (auto w : g[x]) {
if (w.second == p) continue;
if (p == -1) res[w.second] = 0;
else res[w.second] = res[p] ^ 1;
if (res[w.second] == 1) f[w.first] = 1;
else f[w.first] = 2;
dfs(w.first, w.second);
}
}
# | 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... |