Submission #952874

#TimeUsernameProblemLanguageResultExecution timeMemory
952874browntoad양말 찾기 (KPI13_socks)C++14
0 / 1
1 ms1636 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define int ll #define FOR(i, a, b) for(int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define REP1(i, n) FOR(i, 1, n+1) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) #define pii pair<int, int> #define ppi pair<pii, int> #define ALL(x) (x).begin(), (x).end() #define SZ(x) (int)((x).size()) #define f first #define s second #define pb push_back #define endl '\n' #define IOS() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0) const ll maxn = 1e6+5; const ll bloc = 33000; vector<int> toadp(bloc), toadm(bloc); signed main(){ IOS(); int n; cin>>n; int x; REP(i, n){ cin>>x; toadp[x/bloc] ^= x; toadm[x%bloc] ^= x; } int dif = 0, xr = 0; REP(i, bloc){ if (toadp[i] > 0){ dif++; } } if (dif == 2){ REP(i, bloc){ if (toadp[i] > 0) cout<<toadp[i]<<' '; } cout<<endl; } else { REP(i, bloc){ if (toadm[i] > 0) cout<<toadm[i]<<' '; } cout<<endl; } }

Compilation message (stderr)

socks.cpp: In function 'int main()':
socks.cpp:33:18: warning: unused variable 'xr' [-Wunused-variable]
   33 |     int dif = 0, xr = 0;
      |                  ^~
#Verdict Execution timeMemoryGrader output
Fetching results...