| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 92498 | Randooom | Money (IZhO17_money) | C++14 | 1522 ms | 58184 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 in freopen ("input.txt", "r", stdin);
#define out freopen("output.txt", "w", stdout);
#define ll long long int
const int val = (1e6) + 5;
const int inf = (1e9) + 7;
double eps = 0.000000001;
using namespace std;
int a[val], ans = 1;
set <int> q;
set <int> :: iterator l, r;
int solve(){
    int n;
    cin >> n;
    for(int i=1; i<=n; ++i){
        cin >> a[i];
    }
    q.insert(0);
    q.insert(inf);
    l = q.lower_bound(a[1]);
    r = q.upper_bound(a[1]);
    -- l;
    q.insert(a[1]);
    for(int i=2; i<=n; ++i){
        if(a[i] >= a[i-1] && *l <= a[i] && a[i] <= *r){
            q.insert(a[i]);
        }
        else{
            l = q.lower_bound(a[i]);
            r = q.upper_bound(a[i]);
            -- l;
            q.insert(a[i]);
            ++ ans;
        }
    }
    cout << ans << endl;
}
int main(){
    //in out
	ios_base::sync_with_stdio(0);
    solve();
    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... | ||||
