답안 #987

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
987 2013-06-06T22:31:03 Z testtest 지도 색칠하기 (GA3_map) C++
55 / 120
1500 ms 916 KB
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; 
} 
# 결과 실행 시간 메모리 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 1 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 6 ms 916 KB Output is correct
9 Correct 2 ms 916 KB Output is correct
10 Correct 8 ms 916 KB Output is correct
11 Correct 1 ms 916 KB Output is correct
12 Correct 8 ms 916 KB Output is correct
13 Correct 1 ms 916 KB Output is correct
14 Correct 7 ms 916 KB Output is correct
15 Correct 1 ms 916 KB Output is correct
16 Correct 7 ms 916 KB Output is correct
17 Correct 7 ms 916 KB Output is correct
18 Correct 7 ms 916 KB Output is correct
19 Correct 7 ms 916 KB Output is correct
20 Correct 8 ms 916 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 916 KB Output is correct
2 Correct 47 ms 916 KB Output is correct
3 Correct 60 ms 916 KB Output is correct
4 Correct 103 ms 916 KB Output is correct
5 Correct 378 ms 916 KB Output is correct
6 Correct 491 ms 916 KB Output is correct
7 Correct 124 ms 916 KB Output is correct
8 Correct 137 ms 916 KB Output is correct
9 Correct 132 ms 916 KB Output is correct
10 Correct 528 ms 916 KB Output is correct
11 Correct 606 ms 916 KB Output is correct
12 Correct 123 ms 916 KB Output is correct
13 Correct 582 ms 916 KB Output is correct
14 Correct 590 ms 916 KB Output is correct
15 Correct 495 ms 916 KB Output is correct
16 Correct 492 ms 916 KB Output is correct
17 Correct 152 ms 916 KB Output is correct
18 Correct 473 ms 916 KB Output is correct
19 Correct 121 ms 916 KB Output is correct
20 Correct 148 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 -