Submission #953489

#TimeUsernameProblemLanguageResultExecution timeMemory
953489Pacybwoah양말 찾기 (KPI13_socks)C++17
0 / 1
2245 ms65536 KiB
#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 (stderr)

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]
    9 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
socks.cpp:11:15: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   int x; scanf("%d", &x);
      |          ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...