Fila

Problem Link

Solution by Mr.Olimpia100 pts

Code / Notes

#include <bits/stdc++.h>
using namespace std;

int main()  {
    int N;
    cin >> N;
    vector<int>cola(N);
    for(int i=0; i< N; i++){
        cin >> cola[i];
    }
    int max=0;
    int ans=N;
    for(int i=N-1; i>=0; i--){
        if(cola[i]>max){
            max=cola[i];
            ans= ans-1;
        }
    }
    cout << ans;
}

Last updated 1 month, 4 weeks ago


« Back to problem