| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 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';
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
