답안 #89744

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
89744 2018-12-18T09:10:18 Z RAkhshon Money (IZhO17_money) C++14
45 / 100
1500 ms 145964 KB
#include <bits/stdc++.h>
#define ll long long
#define INF  998244353
using namespace std;
ll a[1011011];
set< ll > st;
int main()
{
ll n;
cin>>n;
for(ll i = 1; i<= n; i ++ ){
    cin>>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++;
    }
}
cout<<ans;
return 0;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 440 KB Output is correct
4 Correct 2 ms 520 KB Output is correct
5 Correct 2 ms 548 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 584 KB Output is correct
10 Correct 2 ms 584 KB Output is correct
11 Correct 2 ms 584 KB Output is correct
12 Correct 2 ms 584 KB Output is correct
13 Correct 2 ms 584 KB Output is correct
14 Correct 2 ms 620 KB Output is correct
15 Correct 2 ms 620 KB Output is correct
16 Correct 2 ms 648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 440 KB Output is correct
4 Correct 2 ms 520 KB Output is correct
5 Correct 2 ms 548 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 584 KB Output is correct
10 Correct 2 ms 584 KB Output is correct
11 Correct 2 ms 584 KB Output is correct
12 Correct 2 ms 584 KB Output is correct
13 Correct 2 ms 584 KB Output is correct
14 Correct 2 ms 620 KB Output is correct
15 Correct 2 ms 620 KB Output is correct
16 Correct 2 ms 648 KB Output is correct
17 Correct 2 ms 676 KB Output is correct
18 Correct 2 ms 676 KB Output is correct
19 Correct 2 ms 676 KB Output is correct
20 Correct 3 ms 676 KB Output is correct
21 Correct 2 ms 676 KB Output is correct
22 Correct 2 ms 676 KB Output is correct
23 Correct 2 ms 676 KB Output is correct
24 Correct 2 ms 676 KB Output is correct
25 Correct 2 ms 708 KB Output is correct
26 Correct 2 ms 716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 440 KB Output is correct
4 Correct 2 ms 520 KB Output is correct
5 Correct 2 ms 548 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 584 KB Output is correct
10 Correct 2 ms 584 KB Output is correct
11 Correct 2 ms 584 KB Output is correct
12 Correct 2 ms 584 KB Output is correct
13 Correct 2 ms 584 KB Output is correct
14 Correct 2 ms 620 KB Output is correct
15 Correct 2 ms 620 KB Output is correct
16 Correct 2 ms 648 KB Output is correct
17 Correct 2 ms 676 KB Output is correct
18 Correct 2 ms 676 KB Output is correct
19 Correct 2 ms 676 KB Output is correct
20 Correct 3 ms 676 KB Output is correct
21 Correct 2 ms 676 KB Output is correct
22 Correct 2 ms 676 KB Output is correct
23 Correct 2 ms 676 KB Output is correct
24 Correct 2 ms 676 KB Output is correct
25 Correct 2 ms 708 KB Output is correct
26 Correct 2 ms 716 KB Output is correct
27 Correct 2 ms 716 KB Output is correct
28 Correct 2 ms 720 KB Output is correct
29 Correct 2 ms 768 KB Output is correct
30 Correct 2 ms 772 KB Output is correct
31 Correct 2 ms 776 KB Output is correct
32 Correct 2 ms 904 KB Output is correct
33 Correct 2 ms 904 KB Output is correct
34 Correct 2 ms 904 KB Output is correct
35 Correct 2 ms 904 KB Output is correct
36 Correct 2 ms 904 KB Output is correct
37 Correct 2 ms 904 KB Output is correct
38 Correct 2 ms 904 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 440 KB Output is correct
4 Correct 2 ms 520 KB Output is correct
5 Correct 2 ms 548 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 584 KB Output is correct
10 Correct 2 ms 584 KB Output is correct
11 Correct 2 ms 584 KB Output is correct
12 Correct 2 ms 584 KB Output is correct
13 Correct 2 ms 584 KB Output is correct
14 Correct 2 ms 620 KB Output is correct
15 Correct 2 ms 620 KB Output is correct
16 Correct 2 ms 648 KB Output is correct
17 Correct 2 ms 676 KB Output is correct
18 Correct 2 ms 676 KB Output is correct
19 Correct 2 ms 676 KB Output is correct
20 Correct 3 ms 676 KB Output is correct
21 Correct 2 ms 676 KB Output is correct
22 Correct 2 ms 676 KB Output is correct
23 Correct 2 ms 676 KB Output is correct
24 Correct 2 ms 676 KB Output is correct
25 Correct 2 ms 708 KB Output is correct
26 Correct 2 ms 716 KB Output is correct
27 Correct 2 ms 716 KB Output is correct
28 Correct 2 ms 720 KB Output is correct
29 Correct 2 ms 768 KB Output is correct
30 Correct 2 ms 772 KB Output is correct
31 Correct 2 ms 776 KB Output is correct
32 Correct 2 ms 904 KB Output is correct
33 Correct 2 ms 904 KB Output is correct
34 Correct 2 ms 904 KB Output is correct
35 Correct 2 ms 904 KB Output is correct
36 Correct 2 ms 904 KB Output is correct
37 Correct 2 ms 904 KB Output is correct
38 Correct 2 ms 904 KB Output is correct
39 Correct 199 ms 7872 KB Output is correct
40 Correct 337 ms 15660 KB Output is correct
41 Correct 159 ms 15660 KB Output is correct
42 Correct 148 ms 16936 KB Output is correct
43 Correct 111 ms 17968 KB Output is correct
44 Correct 421 ms 30596 KB Output is correct
45 Correct 416 ms 37324 KB Output is correct
46 Correct 425 ms 44016 KB Output is correct
47 Correct 412 ms 51016 KB Output is correct
48 Correct 415 ms 57748 KB Output is correct
49 Correct 849 ms 83268 KB Output is correct
50 Correct 946 ms 89936 KB Output is correct
51 Correct 866 ms 96644 KB Output is correct
52 Correct 913 ms 103428 KB Output is correct
53 Correct 977 ms 110156 KB Output is correct
54 Correct 981 ms 116840 KB Output is correct
55 Execution timed out 1534 ms 145964 KB Time limit exceeded
56 Halted 0 ms 0 KB -