# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40603 | chonka | Birthday gift (IZhO18_treearray) | C++98 | 1419 ms | 82516 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<iostream>
#include<stdio.h>
#include<vector>
#include<set>
using namespace std ;
#define MAXN 200007
#define LOG 20
int n , m , q ;
vector < int > v[ MAXN ] ;
int a[ MAXN ] ;
int lvl[ MAXN ] ;
int LCA[ MAXN ][ LOG + 2 ] ;
int f[ MAXN ] ;
set < int > s[ MAXN ] ;
set < int > aux[ MAXN ] ;
void dfs_init ( int vertex , int prv ) {
int i ;
int sz = v[ vertex ].size ( ) ;
if ( prv != -1 ) {
for ( i = 1 ; i <= LOG ; i ++ ) {
LCA[ vertex ][ i ] = LCA[ LCA[ vertex ][ i - 1 ] ][ i - 1 ] ;
}
}
for ( i = 0 ; i < sz ; i ++ ) {
if ( v[ vertex ][ i ] == prv ) { continue ; }
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... |