제출 #832230

#제출 시각아이디문제언어결과실행 시간메모리
832230QwertyPiNewspapers (CEOI21_newspapers)C++14
4 / 100
1 ms212 KiB
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define int long long
using namespace std;

const int MAXN = 1e3 + 11;

vector<int> ans;

void yes(){
    cout << "YES" << endl;
    cout << ans.size() << endl;
    for(auto i : ans) cout << i << ' '; cout << endl;
    exit(0);
}

void no(){
    cout << "NO" << endl;
    exit(0);
}

int32_t main(){
    int n, m; cin >> n >> m;
    if(n == 1){ ans = {1}; yes(); }

    if(n % 2){
        for(int i = 2; i <= n - 1; i++){
            ans.push_back(i);
        }
        for(int i = 2; i <= n - 1; i++){
            ans.push_back(i);
        }
    }else{
        for(int i = 2; i <= n; i++){
            ans.push_back(i);
        }
        for(int i = 2; i <= n - 1; i++){
            ans.push_back(i);
        }
    }
    yes();
}

컴파일 시 표준 에러 (stderr) 메시지

newspapers.cpp: In function 'void yes()':
newspapers.cpp:13:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   13 |     for(auto i : ans) cout << i << ' '; cout << endl;
      |     ^~~
newspapers.cpp:13:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   13 |     for(auto i : ans) cout << i << ' '; cout << endl;
      |                                         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...