답안 #520

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
520 2013-02-28T07:54:59 Z tncks0121 지도 색칠하기 (GA3_map) C++
55 / 120
1500 ms 916 KB
typedef long long ll;

long long NumberOfMaps (int N, int M, int *A, int *B){
    int i, j, k; ll 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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 916 KB Output is correct
2 Correct 0 ms 916 KB Output is correct
3 Correct 0 ms 916 KB Output is correct
4 Correct 0 ms 916 KB Output is correct
5 Correct 0 ms 916 KB Output is correct
6 Correct 0 ms 916 KB Output is correct
7 Correct 0 ms 916 KB Output is correct
8 Correct 0 ms 916 KB Output is correct
9 Correct 0 ms 916 KB Output is correct
10 Correct 0 ms 916 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 916 KB Output is correct
2 Correct 2 ms 916 KB Output is correct
3 Correct 2 ms 916 KB Output is correct
4 Correct 6 ms 916 KB Output is correct
5 Correct 0 ms 916 KB Output is correct
6 Correct 1 ms 916 KB Output is correct
7 Correct 1 ms 916 KB Output is correct
8 Correct 7 ms 916 KB Output is correct
9 Correct 2 ms 916 KB Output is correct
10 Correct 9 ms 916 KB Output is correct
11 Correct 2 ms 916 KB Output is correct
12 Correct 7 ms 916 KB Output is correct
13 Correct 2 ms 916 KB Output is correct
14 Correct 7 ms 916 KB Output is correct
15 Correct 0 ms 916 KB Output is correct
16 Correct 7 ms 916 KB Output is correct
17 Correct 9 ms 916 KB Output is correct
18 Correct 7 ms 916 KB Output is correct
19 Correct 9 ms 916 KB Output is correct
20 Correct 7 ms 916 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 916 KB Output is correct
2 Correct 52 ms 916 KB Output is correct
3 Correct 58 ms 916 KB Output is correct
4 Correct 103 ms 916 KB Output is correct
5 Correct 380 ms 916 KB Output is correct
6 Correct 484 ms 916 KB Output is correct
7 Correct 125 ms 916 KB Output is correct
8 Correct 123 ms 916 KB Output is correct
9 Correct 125 ms 916 KB Output is correct
10 Correct 490 ms 916 KB Output is correct
11 Correct 492 ms 916 KB Output is correct
12 Correct 122 ms 916 KB Output is correct
13 Correct 473 ms 916 KB Output is correct
14 Correct 491 ms 916 KB Output is correct
15 Correct 501 ms 916 KB Output is correct
16 Correct 493 ms 916 KB Output is correct
17 Correct 134 ms 916 KB Output is correct
18 Correct 490 ms 916 KB Output is correct
19 Correct 119 ms 916 KB Output is correct
20 Correct 119 ms 916 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 916 KB Output is correct
2 Execution timed out 1500 ms 0 KB Program timed out
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
11 Halted 0 ms 0 KB -
12 Halted 0 ms 0 KB -
13 Halted 0 ms 0 KB -
14 Halted 0 ms 0 KB -
15 Halted 0 ms 0 KB -
16 Halted 0 ms 0 KB -
17 Halted 0 ms 0 KB -
18 Halted 0 ms 0 KB -
19 Halted 0 ms 0 KB -
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 916 KB Output is correct
2 Execution timed out 1500 ms 0 KB Program timed out
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
11 Halted 0 ms 0 KB -
12 Halted 0 ms 0 KB -
13 Halted 0 ms 0 KB -
14 Halted 0 ms 0 KB -
15 Halted 0 ms 0 KB -
16 Halted 0 ms 0 KB -
17 Halted 0 ms 0 KB -
18 Halted 0 ms 0 KB -
19 Halted 0 ms 0 KB -
20 Halted 0 ms 0 KB -
21 Halted 0 ms 0 KB -
22 Halted 0 ms 0 KB -
23 Halted 0 ms 0 KB -
24 Halted 0 ms 0 KB -
25 Halted 0 ms 0 KB -
26 Halted 0 ms 0 KB -
27 Halted 0 ms 0 KB -
28 Halted 0 ms 0 KB -
29 Halted 0 ms 0 KB -
30 Halted 0 ms 0 KB -