//Colouring a rectangle
#define _CTR_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
typedef long long int ll;
template <typename T> T in()
{
T x;
std::cin >> x;
return x;
}
constexpr int maxn = 2e5 + 3;
int minus[maxn];
int plus[maxn];
ll m1(int n)
{
ll odp(0);
for (int i(1); i < n; ++i)odp += std::min(minus[i], plus[n - i]);
return odp;
}
int main()
{
std::cin.tie(nullptr); std::cout.tie(nullptr); std::ios_base::sync_with_stdio(0);
int n(in<int>()), m(in<int>());
for (int i(1); i < m + n; ++i)std::cin >> minus[i];
for (int i(1); i < m + n; ++i)std::cin >> plus[i];
if (m == 1)std::cout << m1(n + m);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
50 ms |
5724 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
33 ms |
4420 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |