답안 #861268

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
861268 2023-10-15T18:25:47 Z Ahmed57 Cat (info1cup19_cat) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;
int main(){
    int t;cin>>t;
    z:while(t--){
        int n;cin>>n;
        int arr[n+1],pos[n+1];
        for(int i = 1;i<=n;i++){
            cin>>arr[i];pos[arr[i]] = i;
        }

        int e = 0;
        for(int i = 1;i<=n;i++){
            int x = pos[i];
            if(arr[i]==i)continue;
            if(arr[n-i+1]==n-x+1&&arr[n-x+1]==n-i+1&&arr[x]==i){
                e++;
            }
        }
        cout<<g-(e/4)<<" "<<0<<endl;
    }
}

Compilation message

cat.cpp: In function 'int main()':
cat.cpp:21:15: error: 'g' was not declared in this scope
   21 |         cout<<g-(e/4)<<" "<<0<<endl;
      |               ^
cat.cpp:6:5: warning: label 'z' defined but not used [-Wunused-label]
    6 |     z:while(t--){
      |     ^