#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <functional>
#include <vector>
#include <deque>
#include <utility>
#include <bitset>
#include <limits.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long llu;
typedef double lf;
typedef unsigned int uint;
typedef long double llf;
typedef pair<int, int> pii;
int n;
int A[4][1<<8];
vector<int> ans;
int main() {
int i, j, k;
scanf("%d", &n);
for(i = 0; i < n; i++) {
int v; scanf("%d", &v);
for(j = 0; j < 4; j++) A[j][(v >> j*8) & 255] ^= v;
}
for(j = 0; j < 4; j++) {
ans.clear();
for(i = 0; i < 256; i++)
if(A[j][i] != 0) ans.push_back(A[j][i]);
if(ans.size() == 2) {
sort(ans.begin(), ans.end());
for(i = 0; i < 2; i++) printf("%d ", ans[i]);
}
}
for(j = 0; j < 4; j++) {
ans.clear();
for(i = 0; i < 256; i++)
if(A[j][i] != 0) return 0 & printf(A[j][i] > 0 ? "0 %d" : "%d 0", A[j][i]);
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |