# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
582163 | TimDee | Colouring a rectangle (eJOI19_colouring) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
ising ll = long long;
//#define int long long
#define forn(i,n) for (int i=0; i<n; ++i)
const int linf = LLONG_MAX;
const int maxn = 2e5+5;
int32_t main() {
int n,m; cin>>n>>m;
vector<ll> a(maxn), b(maxn);
forn(i,n+m-1) cin>>a[i];
forn(i,n+m-1) cin>>b[i];
ll ans=0;
forn(i,n+m-1) ans+=min(a[i],b[i]);
cout<<ans<<'\n';
return 0;
}