이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define F first
#define S second
#define pb push_back
const ll N = 2e5 + 10;
const ll LOG = 50;
const ll MOD = 1e9 + 7;
const ll INF = 1e9 + 10;
int n, X, a[N], b[N], dp[2][N], ans;
int LIS(){
int len = 0, p = 0;
for (int i = 1; i <= n; i++){
p = lower_bound(b, b + len, a[i]) - b;
b[p] = a[i];
len = max(len, p + 1);
}
cout << len << '\n';
exit(0);
}
int main() {
cin >> n >> X;
for (int i = 1; i <= n; i++){
cin >> a[i];
}
if (X == 0) {LIS();}
else {return 0;}
for (int i = 1; i <= n; i++){
ans = max({ans, dp[0][i], dp[1][i]});
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |