#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main(){
ios::sync_with_stdio(0);
cin.tie(0);
int m,n;
cin >> m >> n;
vector<int> v1(m+n-1), v2(m+n-1);
for (int i=0; i<m+n-1; ++i){
cin >> v1[i];
}
for (int i=0; i<m+n-1; ++i){
cin >> v2[i];
}
int sum = 0;
for (int i=0; i<m+n-1; ++i){
sum += min(v1[i],v2[m+n-2-i]);
if (i == m+n-2-i) break;
}
cout << sum;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
3528 KB |
Output is correct |
2 |
Correct |
63 ms |
7288 KB |
Output is correct |
3 |
Correct |
73 ms |
7384 KB |
Output is correct |
4 |
Correct |
71 ms |
7736 KB |
Output is correct |
5 |
Correct |
68 ms |
7760 KB |
Output is correct |
6 |
Incorrect |
59 ms |
6776 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
132 ms |
6560 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |