제출 #550264

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5502642022-04-17 19:07:19AntekbCapital City (JOI20_capital_city)C++14
100 / 100
824 ms46808 KiB
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int blo[N], col[N], par[N], vis[N], typ[N], siz[N];
vector<int> co[N];
vector<int> E[N];
int cent;
void color(int v, int p, int c, int n){
col[v]=c;
bool czy=1;
siz[v]=1;
for(int u:E[v]){
if(!blo[u] && u!=p){
color(u, v, c, n);
siz[v]+=siz[u];
if(siz[u]*2>n)czy=0;
}
}
if(siz[v]*2<n)czy=0;
if(czy)cent=v;
}
void dfs(int v){
//cout<<v<<" "<<par[v]<<col[v]<<" "<<typ[v]<<"q\n";
for(int u:E[v]){
if(u!=par[v] && !blo[u]){
par[u]=v;
dfs(u);
}
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

capital_city.cpp: In function 'void solve(int, int)':
capital_city.cpp:45:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |  for(int i=0; i<V.size(); i++){
      |               ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...