This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
long long NumberOfMaps (int N, int M, int *A, int *B){
int i, j, k; long long ret = 0;
if(M == 0) return 1ll << (2 * N);
for(i = 0; i < M; i++) A[i] = 1 << (A[i] - 1);
for(i = 0; i < M; i++) B[i] = 1 << (B[i] - 1);
int TB = (1 << (N - 1));
for (i = 0; i < (1 << N); i++) if(!(i & A[0]) && !(i & B[0])){
for(j = 0; j < (1 << N); j++) if(!(j & A[0]) && (j & B[0])){
for(k = 0; k < M; k++){
int uc = 0, vc = 0;
if(i & A[k]) uc |= 2; if(j & A[k]) uc |= 1;
if(i & B[k]) vc |= 2; if(j & B[k]) vc |= 1;
if(uc == vc) break;
}
if(k >= M) ++ret;
}
}
return ret * 12;
}
# | 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... |