#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int n, m1, m2, t; cin >> n >> m1 >> m2 >> t;
vector<vector<int>> a(3, vector<int> (n + 1));
for (int i = 0; i < m1; i++){
int x; cin >> x;
a[1][x] = 1;
}
for (int i = 0; i < m2; i++){
int x; cin >> x;
a[2][x] = 1;
}
set<int> ans;
bool f = 0;
int pos = 1;
for (int i = 0; i < n; i++){
if (a[pos][i + 1]){
ans.insert(i);
pos = 3 - pos;
if (a[pos][i] || a[pos][i + 1]){
f = 1;
break;
}
}
}
if (f) cout << "No" << endl;
else{
cout << "Yes" << endl;
cout << ans.size() << endl;
for (int x : ans){
cout << x << ' ';
}
cout << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
[No solution found] n = 20, m1 = 12, m2 = 9, t = 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |