| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 89745 | RAkhshon | Money (IZhO17_money) | C++14 | 1567 ms | 55408 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.
#include <bits/stdc++.h>
#define ll long long
#define INF  998244353
using namespace std;
ll a[1011011];
set< ll > st;
int main()
{
ll n;
scanf("%lld", &n);
for(ll i = 1; i<= n; i ++ ){
    scanf("%lld", &a[i]);
}
ll ans = 0, i;
st.insert(1000000000);
for(  i = 1; i <= n; i ++ ){
    ans++;
    st.insert(a[i]);
    auto x = st.upper_bound(a[i]);
    while( i < n && a[i]<=a[i+1] && a[i+1]<=*x ){
        st.insert(a[i+1]);
        i++;
    }
}
printf("%lld", ans);
return 0;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
