Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- using ll = long long;
- int main()
- {
- ll t, ts;
- vector<ll> z1;
- cin >> t;
- ts = t;
- ll a;
- while (t-- > 0)
- {
- cin >> a;
- z1.push_back(a);
- }
- ll s = 0;
- ll x = z1.at(0) - 1;
- ;
- for (int i = 0; i < ts; i++)
- {
- if (z1.at(i) > x)
- {
- x = z1.at(i);
- ll hlp = 0;
- for (int p = i + 1; p < ts; p++)
- {
- if (z1.at(i) > z1.at(p))
- {
- hlp = 1;
- break;
- }
- }
- if (hlp == 0)
- {
- s += 1;
- }
- }
- }
- cout << s << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment