답안 #5089

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
5089 2014-02-02T21:46:19 Z ainta 양말 찾기 (KPI13_socks) C++
0 / 1
0 ms 1600 KB
#include<stdio.h>
int b[2][65536], r[2];
int main(){
	int n, a, i, j, c = 0;
	scanf("%d", &n);
	while (n--){ scanf("%d", &a); a += (1<<30); b[0][a & 65535] ^= a, b[1][a & 32767] ^= a; }
	for (i = 0; i<2 && c != 2; i++){
		c = 0;
		for (j = 0; j != (1 << 15) << i; j++)if (b[i][j]) r[c++] = b[i][j] - (1 << 30);
	}
	if (r[0]>r[1])a = r[0], r[0] = r[1], r[1] = a;
	printf("%d %d\n", r[0], r[1]);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1600 KB Output is correct
2 Correct 0 ms 1600 KB Output is correct
3 Correct 0 ms 1600 KB Output is correct
4 Correct 0 ms 1600 KB Output is correct
5 Correct 0 ms 1600 KB Output is correct
6 Correct 0 ms 1600 KB Output is correct
7 Correct 0 ms 1600 KB Output is correct
8 Incorrect 0 ms 1600 KB Output isn't correct
9 Halted 0 ms 0 KB -