답안 #85413

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
85413 2018-11-19T19:59:41 Z ToadDaveski Money (IZhO17_money) C++14
0 / 100
3 ms 660 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(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;
              ^
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 372 KB Output is correct
3 Correct 2 ms 448 KB Output is correct
4 Correct 2 ms 472 KB Output is correct
5 Correct 3 ms 552 KB Output is correct
6 Correct 2 ms 640 KB Output is correct
7 Correct 3 ms 652 KB Output is correct
8 Correct 2 ms 652 KB Output is correct
9 Correct 2 ms 652 KB Output is correct
10 Correct 2 ms 652 KB Output is correct
11 Correct 2 ms 652 KB Output is correct
12 Incorrect 2 ms 660 KB Output isn't correct
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 372 KB Output is correct
3 Correct 2 ms 448 KB Output is correct
4 Correct 2 ms 472 KB Output is correct
5 Correct 3 ms 552 KB Output is correct
6 Correct 2 ms 640 KB Output is correct
7 Correct 3 ms 652 KB Output is correct
8 Correct 2 ms 652 KB Output is correct
9 Correct 2 ms 652 KB Output is correct
10 Correct 2 ms 652 KB Output is correct
11 Correct 2 ms 652 KB Output is correct
12 Incorrect 2 ms 660 KB Output isn't correct
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 372 KB Output is correct
3 Correct 2 ms 448 KB Output is correct
4 Correct 2 ms 472 KB Output is correct
5 Correct 3 ms 552 KB Output is correct
6 Correct 2 ms 640 KB Output is correct
7 Correct 3 ms 652 KB Output is correct
8 Correct 2 ms 652 KB Output is correct
9 Correct 2 ms 652 KB Output is correct
10 Correct 2 ms 652 KB Output is correct
11 Correct 2 ms 652 KB Output is correct
12 Incorrect 2 ms 660 KB Output isn't correct
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 372 KB Output is correct
3 Correct 2 ms 448 KB Output is correct
4 Correct 2 ms 472 KB Output is correct
5 Correct 3 ms 552 KB Output is correct
6 Correct 2 ms 640 KB Output is correct
7 Correct 3 ms 652 KB Output is correct
8 Correct 2 ms 652 KB Output is correct
9 Correct 2 ms 652 KB Output is correct
10 Correct 2 ms 652 KB Output is correct
11 Correct 2 ms 652 KB Output is correct
12 Incorrect 2 ms 660 KB Output isn't correct
13 Halted 0 ms 0 KB -