Submission #857954

#TimeUsernameProblemLanguageResultExecution timeMemory
857954danikoynovNewspapers (CEOI21_newspapers)C++14
6 / 100
1 ms348 KiB
#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)

newspapers.cpp: In function 'void solve()':
newspapers.cpp:38:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   38 |     for (int i = 1; i <= n; i ++)
      |     ^~~
newspapers.cpp:40:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   40 |         cout << 1 << " ";
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...