Submission #620

#TimeUsernameProblemLanguageResultExecution timeMemory
620jwvg0425지도 색칠하기 (GA3_map)C++98
0 / 120
0 ms920 KiB
#include <algorithm> int C[21][21],D[21],E[21],F[21]; int Compare(const void* a, const void* b) { return E[*(int*)b]-E[*(int*)a]; } long long int NumberOfMaps(int N, int M, int* A,int* B) { long long int i,j,k=1; for(i=1;i<=N;i++)F[i]=i; for(i=0;i<M;i++) { C[A[i]][B[i]]=C[B[i]][A[i]]=1; E[A[i]]++; E[B[i]]++; } qsort(F+1,N,sizeof(int),Compare); for(i=1;E[F[1]];) { for(j=i+1;j<=N;j++) { if(C[F[i]][F[j]]) { D[F[j]]--; E[F[i]]--; E[F[j]]--; C[F[i]][F[j]]=C[F[j]][F[i]]=0; } } qsort(F+1,N,sizeof(int),Compare); } for(i=1;i<=N;i++) 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...