This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <utility>
#include <climits>
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll m, n, res = 0;
cin >> m >> n;
vector<ll> a(n+m-1), b(n+m-1);
for(ll i = 0; i < m+n-1; i++) cin >> a[i];
for(ll i = 0; i < m+n-1; i++) {
cin >> b[i];
res+=min(a[i], b[i]);
}
cout << res << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |