#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5+10;
const int INF = 1e9;
#define pb push_back
int n, x, resp, v[MAXN], LIS[MAXN];
int main () {
cin >> n >> x;
for(int i = 1; i <= n; i++) {
cin >> v[i];
LIS[i] = INF;
}
for(int i = 1; i <= n; i++) {
int ptr = lower_bound(LIS+1, LIS+1+n, v[i]) - LIS;
LIS[ptr] = v[i];
resp = max(resp, ptr);
}
cout << resp;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
82 ms |
3732 KB |
Output is correct |
2 |
Correct |
83 ms |
3700 KB |
Output is correct |
3 |
Correct |
81 ms |
3680 KB |
Output is correct |
4 |
Correct |
85 ms |
3764 KB |
Output is correct |
5 |
Correct |
54 ms |
2956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
20 ms |
1128 KB |
Output is correct |
2 |
Correct |
20 ms |
1072 KB |
Output is correct |
3 |
Correct |
20 ms |
1108 KB |
Output is correct |
4 |
Incorrect |
16 ms |
944 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
41 ms |
2012 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |