This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <algorithm>
int C[20][20],D[20],E[20],F[20];
int Compare(const void* a, const void* b)
{
return E[*(int*)b]-E[*(int*)a];
}
int NumberOfMaps(int N, int M, int* A,int* B)
{
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);
F[1];
for(i=1;i<=N;i++)
{
for(j=i+1;j<=N;j++)
{
if(C[F[i]][F[j]])
{
D[F[j]]--;
}
}
}
for(i=1;i<=N;i++)
k*=D[i]+4;
return k;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |