| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1361611 | tarjanmici | Global Warming (CEOI18_glo) | C++20 | 53 ms | 2728 KiB |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, x;
cin>>n>>x;
vector<int> t(n+1);
for(int i=1;i<=n;i++) cin>>t[i];
int ans=0;
vector<int> dp0(n+1, INT_MAX), dp1(n+1, INT_MAX);
dp0[0]=0;
dp1[0]=0;
for(int i=1;i<=n;i++){
int a=lower_bound(dp0.begin(), dp0.end(), t[i])-dp0.begin(), b=lower_bound(dp1.begin(), dp1.end(), t[i]+x)-dp1.begin();
dp1[b]=min(dp1[b], t[i]+x);
dp1[a]=min(dp1[a], t[i]);
dp0[a]=t[i];
ans=max(ans, max(a, b));
}
cout<<ans<<'\n';
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
