Submission #514926

#TimeUsernameProblemLanguageResultExecution timeMemory
514926cadmiumskyCat (info1cup19_cat)C++14
15 / 100
732 ms16268 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...