You are viewing a single comment's thread. Return to all comments →
C++ Solution
#include <bits/stdc++.h> using namespace std; const int Nmax = 2e3 + 2; int A[2 * Nmax]; int T, N; int main() { cin >> T; while ( T-- ) { cin >> N; for ( int i = 1; i <= 2 * N; ++i ) cin >> A[i]; int xorsum = 0; for ( int i = 1; i <= N; ++i ) xorsum ^= abs( A[i] - A[i + N] ) - 1; if ( xorsum ) cout << "player-2\n"; else cout << "player-1\n"; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Vertical Rooks
You are viewing a single comment's thread. Return to all comments →
C++ Solution