結果

問題 No.3211 NAND Oracle
ユーザー jiangxinyang
提出日時 2025-07-25 22:05:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 743 bytes
コンパイル時間 1,505 ms
コンパイル使用メモリ 194,740 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-07-25 22:05:31
合計ジャッジ時間 4,101 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#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() {
    ll q, k;
    cin >> q >> k;
    if (k == 2) {
        if (q == 1) {
            cout << "Yes\n";
            cout << "1 2\n";
        } else {
            cout << "No\n";
        }
        return 0;
    }
    if (q > 2 * k - 3) {
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    if (q == 1) {
        cout << "1 2\n";
        return 0;
    }
    ll a, b;
    if (q <= k) {
        a = 2;
    } else {
        a = q - k + 2;
    }
    b = q - a;
    for (int i = 0; i < a; i++) cout << "1 2\n";
    for (int i = 0; i < b; i++) cout << "3 4\n";
    return 0;
}
0