Submission #47063

# Submission time Handle Problem Language Result Execution time Memory
47063 2018-04-27T05:45:53 Z kriii 양말 찾기 (KPI13_socks) C++17
1 / 1
3941 ms 8192 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

socks.cpp: In function 'int main()':
socks.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
socks.cpp:11:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   int x; scanf("%d", &x);
          ~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 356 KB Output is correct
3 Correct 2 ms 432 KB Output is correct
4 Correct 2 ms 432 KB Output is correct
5 Correct 2 ms 524 KB Output is correct
6 Correct 2 ms 584 KB Output is correct
7 Correct 2 ms 612 KB Output is correct
8 Correct 2 ms 760 KB Output is correct
9 Correct 2 ms 792 KB Output is correct
10 Correct 2 ms 792 KB Output is correct
11 Correct 3913 ms 8192 KB Output is correct
12 Correct 3854 ms 8192 KB Output is correct
13 Correct 3941 ms 8192 KB Output is correct
14 Correct 133 ms 8192 KB Output is correct
15 Correct 137 ms 8192 KB Output is correct
16 Correct 197 ms 8192 KB Output is correct
17 Correct 384 ms 8192 KB Output is correct
18 Correct 2 ms 8192 KB Output is correct
19 Correct 2 ms 8192 KB Output is correct
20 Correct 405 ms 8192 KB Output is correct
21 Correct 2 ms 8192 KB Output is correct
22 Correct 2 ms 8192 KB Output is correct
23 Correct 395 ms 8192 KB Output is correct
24 Correct 2 ms 8192 KB Output is correct
25 Correct 2 ms 8192 KB Output is correct
26 Correct 399 ms 8192 KB Output is correct
27 Correct 395 ms 8192 KB Output is correct
28 Correct 2 ms 8192 KB Output is correct
29 Correct 2 ms 8192 KB Output is correct
30 Correct 392 ms 8192 KB Output is correct
31 Correct 2 ms 8192 KB Output is correct
32 Correct 2 ms 8192 KB Output is correct
33 Correct 406 ms 8192 KB Output is correct
34 Correct 2 ms 8192 KB Output is correct
35 Correct 2 ms 8192 KB Output is correct
36 Correct 443 ms 8192 KB Output is correct
37 Correct 371 ms 8192 KB Output is correct
38 Correct 374 ms 8192 KB Output is correct
39 Correct 394 ms 8192 KB Output is correct
40 Correct 380 ms 8192 KB Output is correct
41 Correct 235 ms 8192 KB Output is correct
42 Correct 376 ms 8192 KB Output is correct
43 Correct 379 ms 8192 KB Output is correct
44 Correct 600 ms 8192 KB Output is correct
45 Correct 373 ms 8192 KB Output is correct
46 Correct 380 ms 8192 KB Output is correct
47 Correct 382 ms 8192 KB Output is correct
48 Correct 397 ms 8192 KB Output is correct
49 Correct 375 ms 8192 KB Output is correct
50 Correct 381 ms 8192 KB Output is correct