Submission #625

#TimeUsernameProblemLanguageResultExecution timeMemory
625jwvg0425지도 색칠하기 (GA3_map)C++98
0 / 120
0 ms920 KiB
#include <algorithm> int C[21][21],D[21],E[21]; void dfs(int i,int N) { int t; if(E[i]==1) return; E[i]=1; for(t=1;t<=N;t++) { if(C[i][t]) D[t]--; C[t][i]=0; } for(t=1;t<=N;t++) { if(C[i][t]) { C[i][t]=0; dfs(t,N); } } } long long int NumberOfMaps(int N, int M, int* A,int* B) { int i;long long int k=1; for(i=0;i<M;i++) { C[A[i]][B[i]]=C[B[i]][A[i]]=1; } for(i=1;i<=N;i++) { if(E[i]==0) dfs(i,N); } for(i=1;i<=N;i++) { if(D[i]+4<0) { k=0; break; } k*=D[i]+4; } return k; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...