#include <bits/stdc++.h>
#ifdef local
#define debug(a...) qqbx(#a, a)
template <typename ...T> void qqbx(const char *s, T ...a) {
int cnt = sizeof...(T);
((std::cerr << "\033[1;32m(" << s << ") = (") , ... , (std::cerr << a << (--cnt ? ", " : ")\033[0m\n")));
}
#define pary(a...) danb(#a, a)
template <typename T> void danb(const char *s, T L, T R) {
std::cerr << "\033[1;32m[ " << s << " ] = [ ";
for (int f = 0; L != R; ++L) std::cerr << (f++ ? " " : "") << *L;
std::cerr << " ]\033[0m\n";
}
#else
#define debug(...) ((void)0)
#define pary(...) ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define pb emplace_back
using namespace std;
using ll = int64_t;
const int inf = 1e9, MOD = 1000000007, maxn = 1 << 18, maxLg = 18;
signed main() {
ios_base::sync_with_stdio(0), cin.tie(0);
int n, k;
cin >> n >> k;
vector<int> a[2];
ll sum = 0;
for (int i = 0; i < n + k; i++) {
int x;
cin >> x;
a[x & 1].emplace_back(x);
sum += x;
}
if (sum & 1) {
a[1].pop_back();
--k;
}
while (k >= 2 && a[1].size() >= 2) {
a[1].pop_back();
a[1].pop_back();
k -= 2;
}
while (k) {
a[0].pop_back();
--k;
}
vector<int> ans;
for (int i = 0; i < 2; i++)
for (int x: a[i])
ans.emplace_back(x);
sort(all(ans));
for (int x: ans)
cout << x << ' ';
cout << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output does not have symmetry property |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
716 KB |
Output does not have symmetry property |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
43 ms |
3008 KB |
Output does not have symmetry property |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output does not have symmetry property |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output does not have symmetry property |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output does not have symmetry property |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output does not have symmetry property |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
46 ms |
3040 KB |
Output does not have symmetry property |
3 |
Halted |
0 ms |
0 KB |
- |