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 <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
void solve_n_1() {
vector<ll> a(n + m - 1, 0);
vector<ll> b(n + m - 1, 0);
for(ll &x : a) cin >> x;
for(ll &x : b) cin >> x;
reverse(b.begin(), b.end());
ll ans = 0;
for(ll i = 0; i < n + m - 1; ++i) ans += min(a[i], b[i]);
cout << ans << "\n";
}
void solve_bf_1010() {
}
void solve() {
cin >> n >> m;
if(n == 1) {
solve_n_1();
return;
}
if(n <= 20 && m <= 20) {
solve_bf_1010();
return;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}
# | 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... |