AT_abc373_c 题解
题目传送门
思路
题目要求选择整数
注意事项
- 序列
A 和序列B 中的值可能为负数。
AC CODE
#include<bits/stdc++.h>
using namespace std;
int read(){int x=0;char f=1,ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();return x*f;}
int main(){
int n=read();
int max_a=INT_MIN;
for(int i=1;i<=n;++i)
max_a=max(max_a,read());
int max_b=INT_MIN;
for(int i=1;i<=n;++i)
max_b=max(max_b,read());
printf("%d\n",max_a+max_b);
return 0;
}