#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin>>n;
int x;
cin>>x;
int arr[n];
for(int i=0;i<n;i++) cin>>arr[i];
vector<int> v;
for(int i=0;i<n;i++){
auto it=upper_bound(v.begin(),v.end(),arr[i]);
if(it==v.end()) v.emplace_back(arr[i]);
else{
*it=arr[i];
}
}
cout<<v.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 |
26 ms |
1228 KB |
Output is correct |
2 |
Correct |
26 ms |
1116 KB |
Output is correct |
3 |
Correct |
26 ms |
1228 KB |
Output is correct |
4 |
Correct |
25 ms |
1116 KB |
Output is correct |
5 |
Incorrect |
17 ms |
1760 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
600 KB |
Output is correct |
2 |
Correct |
6 ms |
1140 KB |
Output is correct |
3 |
Correct |
7 ms |
1112 KB |
Output is correct |
4 |
Incorrect |
5 ms |
1372 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
13 ms |
604 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 |
- |