#include<bits/stdc++.h>
using namespace std;
const int mxN = 2e5+5;
int n, x, arr[mxN];
int main() {
cin >> n >> x;
vector<int> temp;
for(int i = 1; i <= n; ++i) {
cin >> arr[i];
auto itr = lower_bound(temp.begin(), temp.end(), arr[i]);
if(itr == temp.end())
temp.emplace_back(arr[i]);
else
*itr = arr[i];
}
cout << temp.size();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
74 ms |
964 KB |
Output is correct |
2 |
Correct |
68 ms |
1100 KB |
Output is correct |
3 |
Correct |
64 ms |
1104 KB |
Output is correct |
4 |
Correct |
67 ms |
1240 KB |
Output is correct |
5 |
Correct |
41 ms |
1736 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
600 KB |
Output is correct |
2 |
Correct |
15 ms |
632 KB |
Output is correct |
3 |
Correct |
19 ms |
604 KB |
Output is correct |
4 |
Incorrect |
10 ms |
1112 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
32 ms |
820 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |