Submission #959180

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9591802024-04-07 14:50:15andrei_boacaCapital City (JOI20_capital_city)C++17
11 / 100
3033 ms382160 KiB
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
int n,k,nr[200005];
bool use[200005];
vector<int> mynodes[200005];
int cul[200005];
vector<int> muchii[200005];
vector<int> edges[200005];
vector<pii> g;
vector<int> st;
vector<pii> init;
int comp[200005],nrcul[200005],nrcomp,nrnodes[200005],nrmuchii[200005];
int root;
void dfs1(int nod)
{
use[nod]=1;
for(int i:edges[nod])
if(!use[i])
dfs1(i);
st.push_back(nod);
}
void dfs2(int nod)
{
use[nod]=1;
comp[nod]=nrcomp;
nrcul[nrcomp]++;
for(int i:edges[nod])
if(!use[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...