結果

問題 No.3211 NAND Oracle
コンテスト
ユーザー trqs
提出日時 2025-07-26 08:37:22
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 6 ms / 2,000 ms
+ 373µs
コード長 915 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,267 ms
コンパイル使用メモリ 216,584 KB
実行使用メモリ 9,900 KB
最終ジャッジ日時 2026-10-31 19:16:34
合計ジャッジ時間 5,033 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge7_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const int N = 200005;
const int INF = 0x3f3f3f3f;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, k;
    cin >> n >> k;
    k -= 2;
    if (n / 2 > k) {
        if (k < 3) {
            cout << "No\n";
        } else {
            cout << "Yes\n";
            cout << "1 2\n";
            cout << "1 2\n";
            cout << "3 4\n";
            cout << "4 5\n";
            cout << "4 5\n";
            n -= 5;
            while (n--) cout << "6 7\n";
        }
    } else {
        cout << "Yes\n";
        cout << "1 2\n";
        n--;
        if (n) {
            cout << "1 2\n";
            n--;
        }
        while (n) {
            cout << "3 4\n";
            n--;
            if (!n) break;
            cout << "1 2\n";
            n--;
        }
    }
    return 0;
}
0