Submission #953118

#TimeUsernameProblemLanguageResultExecution timeMemory
953118Pacybwoah양말 찾기 (KPI13_socks)C++17
0 / 1
1 ms344 KiB
#include<iostream> using namespace std; int arr[32][2]; int main(){ int n; cin>>n; int x; for(int i=0;i<32;i++) arr[i][0]=0,arr[i][1]=0; int j; for(int i=0;i<n;i++){ cin>>x; x+=1000000001; for(j=31;j>=0;j--){ if(x&(1<<j)) arr[j][1]^=x; else arr[j][0]^=x; } } for(int i=0;i<32;i++){ if(arr[i][0]>0&&arr[i][1]>0){ cout<<(arr[i][0]<arr[i][1]?arr[i][0]:arr[i][1])<<" "<<(arr[i][1]>arr[i][0]?arr[i][1]:arr[i][0])<<"\n"; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...