Submission #514926

# Submission time Handle Problem Language Result Execution time Memory
514926 2022-01-18T19:55:39 Z cadmiumsky Cat (info1cup19_cat) C++14
15 / 100
732 ms 16268 KB
#include <bits/stdc++.h>

using namespace std;

static void testcase() {
  int n;
  cin >> n;
  vector<int> v(n + 5, 0);
  for(int i = 0; i < n; i++) {
    cin >> v[i];
  }
  int inv = 0;
  for(int i = 0; i < n / 2; i++) {
    if((v[i] <= (n / 2)) == (v[n - i - 1] <= (n / 2))) {
      cout << "-1\n";
      return;
    }
    if(v[i] + v[n - i - 1] != n + 1) {
      cout << "-1\n";
      return;
    }
    inv += (v[i] > (n / 2));
  }
  if(inv % 2 == 1) {
    cout << "-1\n";
    return;
  }
  cout << "1 1\n1 2\n";
}

int main() {
  int t;
  cin >> t;
  while(t--)
    testcase();
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 332 KB Correctly distinguished between possibility and impossibility
# Verdict Execution time Memory Grader output
1 Correct 33 ms 784 KB Correctly distinguished between possibility and impossibility
2 Correct 33 ms 784 KB Correctly distinguished between possibility and impossibility
# Verdict Execution time Memory Grader output
1 Correct 8 ms 332 KB Correctly distinguished between possibility and impossibility
2 Correct 33 ms 784 KB Correctly distinguished between possibility and impossibility
3 Correct 33 ms 784 KB Correctly distinguished between possibility and impossibility
4 Correct 32 ms 684 KB Correctly distinguished between possibility and impossibility
5 Correct 14 ms 460 KB Correctly distinguished between possibility and impossibility
6 Correct 11 ms 452 KB Correctly distinguished between possibility and impossibility
# Verdict Execution time Memory Grader output
1 Correct 33 ms 784 KB Correctly distinguished between possibility and impossibility
2 Correct 33 ms 784 KB Correctly distinguished between possibility and impossibility
3 Correct 732 ms 15588 KB Correctly distinguished between possibility and impossibility
4 Correct 683 ms 15632 KB Correctly distinguished between possibility and impossibility
5 Correct 649 ms 15492 KB Correctly distinguished between possibility and impossibility
# Verdict Execution time Memory Grader output
1 Correct 8 ms 332 KB Correctly distinguished between possibility and impossibility
2 Correct 33 ms 784 KB Correctly distinguished between possibility and impossibility
3 Correct 33 ms 784 KB Correctly distinguished between possibility and impossibility
4 Correct 32 ms 684 KB Correctly distinguished between possibility and impossibility
5 Correct 14 ms 460 KB Correctly distinguished between possibility and impossibility
6 Correct 11 ms 452 KB Correctly distinguished between possibility and impossibility
7 Correct 732 ms 15588 KB Correctly distinguished between possibility and impossibility
8 Correct 683 ms 15632 KB Correctly distinguished between possibility and impossibility
9 Correct 649 ms 15492 KB Correctly distinguished between possibility and impossibility
10 Correct 637 ms 13932 KB Correctly distinguished between possibility and impossibility
11 Correct 638 ms 14384 KB Correctly distinguished between possibility and impossibility
12 Correct 704 ms 16268 KB Correctly distinguished between possibility and impossibility
13 Correct 694 ms 15604 KB Correctly distinguished between possibility and impossibility
14 Correct 702 ms 16164 KB Correctly distinguished between possibility and impossibility