# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
857954 | danikoynov | Newspapers (CEOI21_newspapers) | C++14 | 1 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
void speed()
{
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
}
int n, m;
void solve()
{
cin >> n >> m;
if (n == 1)
{
cout << "YES" << endl;
cout << 1 << endl;
cout << 1 << endl;
return;
}
cout << "YES" << endl;
if (n % 2 == 1)
{
cout << 2 * n << endl;
for (int i = 1; i <= n; i ++)
cout << i << " ";
for (int i = 1; i <= n; i ++)
cout << i << " ";
cout << endl;
}
else
{
cout << 2 * n + 1<< endl;
for (int i = 1; i <= n; i ++)
cout << i << " ";
cout << 1 << " ";
for (int i = 1; i <= n; i ++)
cout << i << " ";
cout << endl;
}
}
int main()
{
solve();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |