#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define int long long
#define N 200200
int n , x , p , rt , a[N] , b[N];
signed main(){
cin.tie(0)->sync_with_stdio(0);
cin >> n >> x;
for (int i = 1 ; i <= n ; i ++) cin >> a[i] , b[i] = 2e9;
for (int i = 1 ; i <= n ; i ++){
p = lower_bound(b , b + n + 1 , a[i]) - b;
rt = max(rt,p) , b[p] = a[i];
}
cout << rt;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
5304 KB |
Output is correct |
2 |
Correct |
23 ms |
5304 KB |
Output is correct |
3 |
Correct |
24 ms |
5468 KB |
Output is correct |
4 |
Correct |
23 ms |
5468 KB |
Output is correct |
5 |
Correct |
15 ms |
4700 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
1628 KB |
Output is correct |
2 |
Correct |
10 ms |
1628 KB |
Output is correct |
3 |
Correct |
6 ms |
1628 KB |
Output is correct |
4 |
Incorrect |
4 ms |
1528 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
11 ms |
2908 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |