알고리즘

[알고리즘] 백준 14656 - 조교는 새디스트야!! (C++)

blueberrysoda 2024. 11. 16. 23:55

[문제 링크] : https://www.acmicpc.net/problem/14656

#include <iostream>
using namespace std;

int N, Ans, inp;

int main(){
    cin >> N;
    for(int i=1; i<=N; i++){
        cin >> inp;
        if(inp != i){
            Ans++;
        }
    }
    cout << Ans << "\n";
    return 0;
}