Submission #85416

# Submission time Handle Problem Language Result Execution time Memory
85416 2018-11-19T20:07:02 Z ToadDaveski Money (IZhO17_money) C++14
0 / 100
2 ms 596 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
set <ll> st;
ll a[1000001];
int main()
{
    ll n,m,i,j,ans=0;
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    st.insert(0);
    st.insert(10000000);
    for(i=1;i<=n;i++)
    {
        ans++;
        st.insert(a[i]);
        while(i<n && a[i+1]>=a[i] && a[i+1]<=(*st.upper_bound(a[i])))
        {
            st.insert(a[i+1]);
            i++;
        }
    }
    cout<<ans;
    return 0;
}

Compilation message

money.cpp: In function 'int main()':
money.cpp:8:10: warning: unused variable 'm' [-Wunused-variable]
     ll n,m,i,j,ans=0;
          ^
money.cpp:8:14: warning: unused variable 'j' [-Wunused-variable]
     ll n,m,i,j,ans=0;
              ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 456 KB Output is correct
4 Correct 2 ms 500 KB Output is correct
5 Correct 2 ms 576 KB Output is correct
6 Correct 2 ms 584 KB Output is correct
7 Correct 2 ms 584 KB Output is correct
8 Correct 2 ms 584 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 2 ms 596 KB Output is correct
11 Correct 2 ms 596 KB Output is correct
12 Incorrect 2 ms 596 KB Output isn't correct
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 456 KB Output is correct
4 Correct 2 ms 500 KB Output is correct
5 Correct 2 ms 576 KB Output is correct
6 Correct 2 ms 584 KB Output is correct
7 Correct 2 ms 584 KB Output is correct
8 Correct 2 ms 584 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 2 ms 596 KB Output is correct
11 Correct 2 ms 596 KB Output is correct
12 Incorrect 2 ms 596 KB Output isn't correct
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 456 KB Output is correct
4 Correct 2 ms 500 KB Output is correct
5 Correct 2 ms 576 KB Output is correct
6 Correct 2 ms 584 KB Output is correct
7 Correct 2 ms 584 KB Output is correct
8 Correct 2 ms 584 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 2 ms 596 KB Output is correct
11 Correct 2 ms 596 KB Output is correct
12 Incorrect 2 ms 596 KB Output isn't correct
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 456 KB Output is correct
4 Correct 2 ms 500 KB Output is correct
5 Correct 2 ms 576 KB Output is correct
6 Correct 2 ms 584 KB Output is correct
7 Correct 2 ms 584 KB Output is correct
8 Correct 2 ms 584 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 2 ms 596 KB Output is correct
11 Correct 2 ms 596 KB Output is correct
12 Incorrect 2 ms 596 KB Output isn't correct
13 Halted 0 ms 0 KB -