# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
542963 | chonka | Capital City (JOI20_capital_city) | C++98 | 714 ms | 42804 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<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
// mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
#define MAXN 200007
int n , k ;
int a[ MAXN ] ;
vector < int > v[ MAXN ] ;
vector < int > col[ MAXN ] ;
int tot ;
int used[ MAXN ] , subtree[ MAXN ] , prv[ MAXN ] , mrk[ MAXN ] ;
bool added[ MAXN ] ;
vector < int > clist ;
int ans = MAXN ;
void dfs ( int vertex , int lst , int ori ) {
mrk[ vertex ] = ori ;
++ tot ;
subtree[ vertex ] = 1 ;
for ( auto x : v[ vertex ] ) {
if ( x == lst || used[ x ] == 1 ) { continue ; }
prv[ x ] = vertex ;
dfs ( x , vertex , ori ) ;
subtree[ vertex ] += subtree[ x ] ;
}
}
# | 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... |