Submission #754554

# Submission time Handle Problem Language Result Execution time Memory
754554 2023-06-08T04:44:51 Z Stickfish Cat (info1cup19_cat) C++17
0 / 100
32 ms 692 KB
#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 time Memory Grader output
1 Incorrect 8 ms 340 KB Integer parameter [name=y] equals to -1, violates the range [1, 8]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 692 KB Given positions are equal
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 340 KB Integer parameter [name=y] equals to -1, violates the range [1, 8]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 692 KB Given positions are equal
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 340 KB Integer parameter [name=y] equals to -1, violates the range [1, 8]
2 Halted 0 ms 0 KB -