Advertisement
Nusrat_Ullah

CF 62 Edu Div2 A

Mar 22nd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int g,t,ma,re=0;
  6.     scanf("%d",&t);
  7.     int wq[t+3];
  8.     for(g=1;g<=t;g++)scanf("%d",&wq[g]);
  9.     ma=wq[1];
  10.     for(g=1;g<=t;g++){
  11.         if(wq[g]>ma) ma=wq[g];
  12.         if(g==ma) re++;
  13.     }
  14.     printf("%d\n",re);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement