Submission #762906

#TimeUsernameProblemLanguageResultExecution timeMemory
762906TrunktyCat (info1cup19_cat)C++14
15 / 100
172 ms17100 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll int t; int arr[200005]; signed main(){ ios::sync_with_stdio(false); cin.tie(NULL); cin >> t; for(int e=1;e<=t;e++){ int n; cin >> n; for(int i=1;i<=n;i++){ cin >> arr[i]; } bool bad = false; for(int i=1;i<=n/2;i++){ if(arr[i]+arr[n-i+1LL]!=n+1LL){ bad = true; } } if(bad){ cout << -1 << "\n"; continue; } int cnt=0; for(int i=1;i<=n/2;i++){ if(arr[i]>n/2){ cnt++; } } if(cnt%2){ cout << -1 << "\n"; } else{ cout << 0 << " " << 0 << "\n"; } } return 0; }
#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...