답안 #783084

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
783084 2023-07-14T15:09:23 Z Andrey Cat (info1cup19_cat) C++14
3.75 / 100
210 ms 15664 KB
#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n,a;
    cin >> n;
    vector<int> p(n+1);
    for(int i = 1; i <= n; i++) {
        cin >> a;
        p[a] = i;
    }
    for(int i = 1; i <= n/2; i++) {
        if(p[i] != n-p[n-i+1]+1) {
            cout << -1 << "\n";
            return;
        }
    }
    cout << 1 << " " << 0 << "\n";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t;
    cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 212 KB Wrong answer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 340 KB Correctly distinguished between possibility and impossibility
2 Correct 12 ms 724 KB Correctly distinguished between possibility and impossibility
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 212 KB Wrong answer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 340 KB Correctly distinguished between possibility and impossibility
2 Correct 12 ms 724 KB Correctly distinguished between possibility and impossibility
3 Correct 206 ms 15548 KB Correctly distinguished between possibility and impossibility
4 Correct 210 ms 15664 KB Correctly distinguished between possibility and impossibility
5 Correct 165 ms 15492 KB Correctly distinguished between possibility and impossibility
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 212 KB Wrong answer
2 Halted 0 ms 0 KB -