#include <bits/stdc++.h>
#define int long long
using namespace std;
const int NMAX = 2e5;
int a[NMAX * 2 + 5];
int b[NMAX * 2 + 5];
signed main()
{
int n, m;
cin >> m >> n;
for (int i=1; i<n+m; i++)
cin >> a[i];
for (int i=1; i<n+m; i++)
cin >> b[i];
int ans = 0;
if (n == 1 || m == 1)
{
reverse(a+1, a+n+m);
for (int i=1; i<n+m; i++)
{
ans += min(a[i], b[i]);
}
cout << ans;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
116 ms |
3340 KB |
Output is correct |
2 |
Correct |
109 ms |
7240 KB |
Output is correct |
3 |
Correct |
125 ms |
7272 KB |
Output is correct |
4 |
Correct |
119 ms |
7448 KB |
Output is correct |
5 |
Correct |
128 ms |
7792 KB |
Output is correct |
6 |
Correct |
122 ms |
6684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
249 ms |
6476 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |