제출 #97190

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
971902019-02-14 09:49:55maruiiSnowy Roads (JOI16_snowy)C++14
100 / 100
30 ms1932 KiB
#include "Anyalib.h"
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
static vector<int> edge[500];
static int A[500], B[500], prt[500], dth[500], c[500], N, piv;
static void dfs(int x){
for(auto &i: edge[x]){
if(prt[x]==i) continue;
prt[i] = x;
dth[i] = dth[x]+1;
dfs(i);
}
}
static int dfs2(int x){
int ret = 1;
for(auto &i: edge[x]){
if(prt[x]==i) continue;
c[i] += c[x];
ret = max(ret, dfs2(i)%12+1);
}
if(!x || ret%12 == 0) for(int i=0; i<9; ++i) Save(piv++, (c[x]>>i) & 1);
return ret;
}
void InitAnya(int N_ , int AA[] , int BB[]) {
N = N_;
for(int i=0; i<N; ++i) edge[i].clear();
for(int i=0; i<N-1; ++i){
A[i] = AA[i], B[i] = BB[i];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...