結果

問題 No.3211 NAND Oracle
ユーザー miya145592
提出日時 2025-07-25 23:12:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 649 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 82,104 KB
実行使用メモリ 77,856 KB
最終ジャッジ日時 2025-07-25 23:12:16
合計ジャッジ時間 4,608 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
Q, K = map(int, input().split())
if Q==1:
    print("Yes")
    print(1, 2)
elif Q==2:
    if K>=3:
        print("Yes")
        print(1, 2)
        print(2, 3)
    else:
        print("No")
elif Q==3:
    if K>=3:
        print("Yes")
        print(1, 2)
        print(2, 3)
        print(1, 4)
    else:
        print("No")
else:
    tmp = (Q-3+1)//2 + 3
    if K>=tmp:
        print("Yes")
        print(1, 2)
        print(2, 3)
        print(1, 4)
        for i in range(3, Q):
            if i%2==1:
                print(3, 5)
            else:
                print(1, 4)
    else:
        print("No")


0