Submission #4840

#TimeUsernameProblemLanguageResultExecution timeMemory
4840tncks0121양말 찾기 (KPI13_socks)C++98
1 / 1
1780 ms1212 KiB
#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]); return 0; } } 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; }
#Verdict Execution timeMemoryGrader output
Fetching results...