fork download
  1. #include<iostream>
  2. #include<cstdio>
  3. #include <algorithm>
  4. using namespace std;
  5. int ABS(int a) {return (((a)<(0) ) ? (-a) : (a));}
  6. int main() {
  7. int t;
  8. cin >> t;
  9. while(t--) {
  10. int n;
  11. cin >> n;
  12. int p1[n], p2[n];
  13. for(int i=0; i<n; i++) {
  14. cin >> p1[i];
  15. }
  16. for(int i=0; i<n; i++) {
  17. cin >> p2[i];
  18. }
  19. int diff[n];
  20. for(int i=0; i<n; i++) {
  21. diff[i] = ABS(p1[i]-p2[i])-1;
  22. }
  23. int co = 0;
  24. int turn = 2;
  25. sort(diff, diff+n);
  26. int odd = 0;
  27. for(int i=0; i<n; i++) {
  28. if(diff[i]%2) {
  29. odd++;
  30. }
  31. }
  32. int even = n-odd;
  33. turn = 2;
  34. if(odd%2) {
  35. turn = 1;
  36. }
  37. if(turn == 2) {
  38. printf("player-1\n");
  39. }else {
  40. printf("player-2\n");
  41. }
  42. }
  43. return 0;
  44. }
  45.  
Runtime error #stdin #stdout 0s 2728KB
stdin
Standard input is empty
stdout
Standard output is empty