# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
953489 | 2024-03-26T03:24:05 Z | Pacybwoah | 양말 찾기 (KPI13_socks) | C++17 | 2245 ms | 65536 KB |
#include <stdio.h> #include <set> using namespace std; int n,v[31]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) { int x; scanf("%d", &x); x += 1000000001; for (int j = 0; j < 31; j++) if (x & (1 << j)) v[j] ^= x; } set<int> ans; int u = 0; for (int j = 0; j < 31; j++) { if (v[j] & (1 << j)) ans.insert(v[j]); else if (v[j]) u = v[j]; } if (ans.size() == 1) ans.insert(u^*ans.begin()); for (auto &x : ans) printf("%d ", x - 1000000001); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 1 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 600 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Runtime error | 2245 ms | 65536 KB | Memory limit exceeded |
12 | Halted | 0 ms | 0 KB | - |