#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,x,a;
cin>>n>>x;
vector<int>v,dp(n,INT_MAX),pref;
for(int i=0;i<n;i++)
{
cin>>a;
v.push_back(a);
}
int res=0;
for(int i=0;i<n;i++)
{
int temp=lower_bound(dp.begin(),dp.end(),v[i])-dp.begin();
pref.push_back(temp+1);
dp[temp]=v[i];
res=max(res,temp+1);
}
cout<<res;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
60 ms |
3392 KB |
Output is correct |
2 |
Correct |
57 ms |
3344 KB |
Output is correct |
3 |
Correct |
56 ms |
3532 KB |
Output is correct |
4 |
Correct |
57 ms |
3524 KB |
Output is correct |
5 |
Correct |
39 ms |
3536 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
1112 KB |
Output is correct |
2 |
Correct |
14 ms |
1116 KB |
Output is correct |
3 |
Correct |
14 ms |
1220 KB |
Output is correct |
4 |
Incorrect |
10 ms |
1112 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
38 ms |
1868 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |