# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
486134 | davi_bart | Po (COCI21_po) | C++14 | 9 ms | 1744 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define fi first
#define se second
#define ld long double
#define pb push_back
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
vector<int> v(N);
vector<int> k;
int ans = 0;
for (int &i : v) {
cin >> i;
while (k.size() && k.back() > i) k.pop_back();
if (!k.size() || k.back() != i) {
ans++;
k.pb(i);
}
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |