题解:P12643 [KOI 2024 Round 1] 回收退货
Heart_of_Iron · · 题解
思路
卡车从
最终时间复杂度
代码
#include<bits/stdc++.h>
using namespace std;
#define int long long
int x[11451],t[11451];
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int n;
cin>>n;
for(int i=1;i<=n;i++)cin>>x[i];
for(int i=1;i<=n;i++)cin>>t[i];
int ans=2*x[n];
for(int i=1;i<=n;i++)
ans=max(ans,t[i]+x[i]);
cout<<ans;
return 0;
}