답안 #1087276

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1087276 2024-09-12T12:09:32 Z MercubytheFirst Newspapers (CEOI21_newspapers) C++17
4 / 100
1 ms 348 KB
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define endl '\n'

#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 37
#endif

template <typename T>
void print(vector<T> v) {
    const int n = v.size();
    for(int i = 1; i + 1 < n; ++i) {
        cout << v[i];
    }
    cout << endl;
}

inline void solve(){
    int n, m;
    cin >> n >> m;
    // vector<bool> v(n + 2, true);
    // vector<int> sol;
    // v[0] = v.back() = false;
    // print(v);
    // while(true) {
    //     int x;
    //     cin >> x;
    //     if(x == -1) {
    //         break;
    //     }
    //     v[x] = false;
    //     sol.push_back(x);
    //     vector<bool> nv = v;
    //     for(int i = 1; i <= n; ++i) {
    //         nv[i] = (v[i - 1] or v[i + 1]);
    //     }
    //     v = nv;
    //     print(v);
    // }
    // for(int x : sol) {
    //     cout << x << " ";
    // }
    if(n <= 2) {
        cout << "YES\n1\n1\n";
        return;
    }
    cout << "YES\n" << 2 * n - 4 << '\n';
    for(int i = 2; i < n; ++i) {
        cout << i << ' ';
    }
    for(int i = n - 1; i >= 2; --i) {
        cout << i << ' ';
    }
}

 
signed main(){
    #ifdef LOCAL
    freopen("test.in", "r", stdin);
    freopen("err.txt", "w", stderr);
    #endif
    // ios_base::sync_with_stdio(0);
    // cin.tie(NULL); 
    // signed t; cin >> t; while(t--)
        solve();
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Partially correct 0 ms 348 KB Failed to provide a successful strategy.
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Partially correct 0 ms 348 KB Failed to provide a successful strategy.
6 Partially correct 0 ms 348 KB Failed to provide a successful strategy.
7 Incorrect 0 ms 348 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Partially correct 0 ms 348 KB Failed to provide a successful strategy.
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Partially correct 0 ms 348 KB Failed to provide a successful strategy.
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Partially correct 0 ms 348 KB Failed to provide a successful strategy.
6 Partially correct 0 ms 348 KB Failed to provide a successful strategy.
7 Incorrect 0 ms 348 KB Output isn't correct
8 Halted 0 ms 0 KB -