Submission #952866

#TimeUsernameProblemLanguageResultExecution timeMemory
952866Darren0724양말 찾기 (KPI13_socks)C++17
0 / 1
1 ms1112 KiB
#include <bits/stdc++.h> using namespace std; #define LCBorz ios_base::sync_with_stdio(false); cin.tie(0); #define all(x) x.begin(), x.end() #define endl '\n' const int N=200005; const int INF=1e18; const int K=35000; int32_t main() { LCBorz; int n;cin>>n; vector<int> v(K),v1(K); for(int i=0;i<n;i++){ int p;cin>>p; v[p%K]^=p; v1[p/K]^=p; } int cnt1=0; for(int i=0;i<K;i++){ cnt1+=(v[i]>0); } if(cnt1==2){ for(int i=0;i<K;i++){ if(v[i])cout<<v[i]<<' '; } cout<<endl; return 0; } for(int i=0;i<K;i++){ if(v1[i])cout<<v1[i]<<' '; } cout<<endl; return 0; }

Compilation message (stderr)

socks.cpp:7:15: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
    7 | const int INF=1e18;
      |               ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...