# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
212218 | bensonlzl | Stray Cat (JOI20_stray) | C++14 | 118 ms | 16588 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;
typedef pair<int,int> pi;
namespace {
int sub[20005], hv[20005], w[20005], cdepth[20005], rev;
vector<int> edges;
vector<pi> AdjList[20005];
queue<int> q;
int cnt[12] = {1,0,0,1,0,1,1,0,0,1,0,1};
void genchain(int x, int p, int eweight){
//cerr << x << ' ' << p << ' ' << eweight << '\n';
int c = 0;
for (auto it : AdjList[x]){
if (it.first == p) continue;
c++;
}
if (c >= 2){
if (eweight == 1) cdepth[x] = 1;
else cdepth[x] = 0;
for (auto it : AdjList[x]){
if (it.first == p) continue;
cdepth[it.first] = cdepth[x] + 1;
edges[it.second] = cnt[cdepth[x]%12];
genchain(it.first,x,edges[it.second]);
}
Compilation message (stderr)
# | 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... |