답안 #83861

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
83861 2018-11-11T12:51:07 Z faceless 질문 (CEOI14_question_grader) C++14
0 / 100
4424 ms 79112 KB
int numbit (int mask) {
	int ret = 0;
	while (mask) {
		mask -= mask & -mask;
		ret ++;
	}
	return ret;
}
 
int to[2000];
 
int encode (int n, int x, int y){
	int tmp = 1;
	n = 12;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            for (int k = j + 1; k < n; k++) {
                for (int l = k + 1; l < n; l++) {
                    for (int z = l + 1; z < n; z ++) {
                        for (int x = z + 1; z < n; z ++) {
                            to[tmp ++] = (1 << i) ^ (1 << j) ^ (1 << k) ^ (1 << l) ^ (1 << z) ^ (1 << x);
                        }
                    }
                }
            }
        }
    }
	for (int i = 0; i < 12; i++) {
		if (to[x] & (1 << i) and (to[y] & (1 << i)) == 0)
			return i + 1;
	}
}
int numbit (int mask) {
	int ret = 0;
	while (mask) {
		mask -= mask & -mask;
		ret ++;
	}
	return ret;
}

int to[2000];

int decode (int n, int q, int h){
	int tmp = 1;
	n = 12;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            for (int k = j + 1; k < n; k++) {
                for (int l = k + 1; l < n; l++) {
                    for (int z = l + 1; z < n; z ++) {
                        for (int x = z + 1; z < n; z ++) {
                            to[tmp ++] = (1 << i) ^ (1 << j) ^ (1 << k) ^ (1 << l) ^ (1 << z) ^ (1 << x);
                        }
                    }
                }
            }
        }
    }

	int mask = to[q];
	if (mask & (1 << (h - 1)))
		return 1;
	return 0;
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4424 ms 79112 KB wrong answer
2 Incorrect 4412 ms 79072 KB wrong answer