#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
cin.tie(0);
ios_base::sync_with_stdio(false);
int n, m;
cin >> n >> m;
vector<int> RD = vector<int>(n + m - 1);
vector<int> RU = vector<int>(n + m - 1);
for (int &x : RD)
cin >> x;
for (int &x : RU)
cin >> x;
reverse(RU.begin(), RU.end());
int sol = 0;
for (int i = 0; i < n + m - 1; i++)
sol += min(RD[i], RU[i]);
cout << sol;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
50 ms |
3436 KB |
Output is correct |
2 |
Correct |
52 ms |
3404 KB |
Output is correct |
3 |
Correct |
49 ms |
3404 KB |
Output is correct |
4 |
Correct |
56 ms |
3436 KB |
Output is correct |
5 |
Correct |
60 ms |
3432 KB |
Output is correct |
6 |
Correct |
50 ms |
3436 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
124 ms |
6572 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |