結果

問題 No.3211 NAND Oracle
ユーザー tau0529
提出日時 2025-07-25 22:57:23
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 270 ms / 2,000 ms
コード長 1,497 bytes
コンパイル時間 3,214 ms
コンパイル使用メモリ 276,296 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-07-25 22:57:32
合計ジャッジ時間 8,390 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

/*
ショトカ登録
cin cout endl return void
int double string char
pair make_pair first second tuple make_tuple get
sort erase swap map set insert
stoi reverse to_string
auto bool true false
vector queue priority_queue front pop_frpnt
size substr push_back pop_back push pop top
if for while break continue next_permutation
__builtin_popcount 
*/

//無限
int inf = 1020304050;
int64_t INF = 1020304050607080900;

//モッド
int64_t mod = 998244353;

//all マクロ
#define all(v) v.begin(), v.end()

//int64_t
typedef int64_t lint;



int main () {
    //少数以下
    cout << fixed << setprecision(15);

    lint Q, K; cin >> Q >> K;
    if ((Q == 1) || ((Q == 2 || Q == 3) && K >= 3) || (Q == 4 && K >= 4) || (Q >= 5 && K >= 5)) {
        cout << "Yes" << endl;
        if (Q >= 1) cout << "1 2" << endl;//最大2
        if (Q >= 2) cout << "1 3" << endl;//最大3
        if (Q >= 3) cout << "2 4" << endl;//3
        if (Q >= 4) cout << "2 5" << endl;//4
        if (Q >= 5) cout << "2 5" << endl;//5
        for (lint i = 6; i <= Q; i++) {
            if (Q >= 2) cout << "6 7" << endl;//変動なし
        }
    }
    else if (Q == 5 && K == 4) {
        cout << "Yes" << endl;
        cout << "1 2" << endl;//最大2
        cout << "1 3" << endl;//最大3
        cout << "2 4" << endl;//3
        cout << "2 4" << endl;//最大4
        cout << "3 5" << endl;//4
    }
    else {
        cout << "No" << endl;
    }

    //*/
}
0