← Back to List

15781번: 헬멧과 조끼 ↗

Solutions

C++14
225 B | 225 chars
#include <iostream>
#include <algorithm>
using namespace std;
int N,M,A,B,a,b;
int main()
{
	cin>>N>>M;
	for(int x=0; x<N; x++)
	{
		cin>>a;
		A=max(A,a);
	}
	for(int x=0; x<M; x++)
	{
		cin>>b;
		B=max(B,b);
	}
	cout<<A+B;
}