fork download
  1. /*
  2. * @Author: hungeazy
  3. * @Date: 2026-03-04 23:24:15
  4. * @Last Modified by: hungeazy
  5. * @Last Modified time: 2026-03-09 22:04:58
  6. */
  7. #include <bits/stdc++.h>
  8. using namespace std;
  9. const int N = 1000010;
  10. int a[N],b[N],c[N];
  11.  
  12. int main()
  13. {
  14. int n;
  15. cin >> n;
  16. for (int i = 1; i <= n; i++) cin >> a[i];
  17. int ans = 0;
  18. for (int i = 1; i < n; i++)
  19. {
  20. bool check = true;
  21. for (int j = i+1; j <= n; j++)
  22. if (a[i] <= a[j]) check = false;
  23. if (check == true) ans++;
  24. }
  25. cout << ans;
  26. return 0;
  27. }
Success #stdin #stdout 0.27s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty