Submission #754554

#TimeUsernameProblemLanguageResultExecution timeMemory
754554StickfishCat (info1cup19_cat)C++17
0 / 100
32 ms692 KiB
#include <iostream> #include <vector> using namespace std; void solve() { int n; cin >> n; vector<int> p(n); for (int i = 0; i < n; ++i) cin >> p[i], --p[i]; for (int i = 0; i < n; ++i) if (p[i] + p[n - i - 1] != n - 1) { cout << "-1\n"; return; } int e0 = 0; for (int i = 0; i < n / 2; ++i) e0 += p[i] < n / 2; if ((e0 + n / 2) % 2) { cout << "-1\n"; return; } cout << "1\n"; cout << "1 2\n"; } signed main() { int t; cin >> t; while (t--) { solve(); } }
#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...