Submission #987

#TimeUsernameProblemLanguageResultExecution timeMemory
987testtest지도 색칠하기 (GA3_map)C++98
55 / 120
1500 ms916 KiB
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 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...