# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1025028 | I_FloPPed21 | Global Warming (CEOI18_glo) | C++14 | 90 ms | 8592 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
using namespace std;
long long n , x,v[200005],pref[200005];
int main()
{
cin >> n >> x;
vector<long long> dp (n+1,1e9);
for ( int i = 1; i <= n ; i ++)
cin >> v[i];
long long maxx = 0 ;
for ( int i = 1; i <= n ; i ++ )
{
long long poz = lower_bound(dp.begin(),dp.end(),v[i]) - dp.begin();
maxx = max ( maxx , poz );
dp[poz]= v[i];
pref[i] = poz + 1;
}
dp = vector<long long> (n+1,1e9);
for ( int i = n ; i >= 1; i -- )
{
long long poz = lower_bound(dp.begin(),dp.end(),-v[i]) - dp.begin();
long long cox = lower_bound(dp.begin(),dp.end(),-v[i]+x) - dp.begin();
maxx = max ( maxx, pref[i] + cox);
dp[poz] = -v[i];
}
cout << maxx << '\n';
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |