# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
85416 | 2018-11-19T20:07:02 Z | ToadDaveski | Money (IZhO17_money) | C++14 | 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
# | 결과 | 실행 시간 | 메모리 | 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 | - |
# | 결과 | 실행 시간 | 메모리 | 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 | - |
# | 결과 | 실행 시간 | 메모리 | 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 | - |
# | 결과 | 실행 시간 | 메모리 | 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 | - |