Submission #5124

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
51242014-02-10 04:18:02aintaCactus? Not cactus? (kriii1_C)C++98
0 / 1
68 ms9992 KiB
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
int par[100010], C, chk[100010];
vector<int>E[100010];
int n;
void DFS(int a, int p){
par[a] = p;
int i, x;
for (i = 0; i < E[a].size(); i++){
if (E[a][i] == p)continue;
if (par[E[a][i]]){
x = a;
while (x != E[a][i]){
chk[x]++;
x = par[x];
}
chk[x]++;
}
}
for (i = 0; i < E[a].size(); i++){
if (!par[E[a][i]]){
DFS(E[a][i], a);
}
}
}
int main(){
int i, a, b, m;
scanf("%d%d", &n, &m);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...