結果

問題 No.1523 +/- Tree
ユーザー 👑 KazunKazun
提出日時 2021-07-16 19:18:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 478 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 77,156 KB
最終ジャッジ日時 2023-09-20 10:39:50
合計ジャッジ時間 10,855 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,492 KB
testcase_01 AC 73 ms
71,136 KB
testcase_02 WA -
testcase_03 AC 75 ms
71,568 KB
testcase_04 AC 74 ms
71,512 KB
testcase_05 AC 75 ms
71,308 KB
testcase_06 AC 76 ms
71,292 KB
testcase_07 AC 75 ms
71,412 KB
testcase_08 AC 76 ms
71,380 KB
testcase_09 AC 75 ms
71,620 KB
testcase_10 AC 77 ms
71,564 KB
testcase_11 AC 75 ms
71,300 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 72 ms
71,384 KB
testcase_18 WA -
testcase_19 AC 72 ms
71,412 KB
testcase_20 AC 71 ms
71,404 KB
testcase_21 AC 74 ms
71,140 KB
testcase_22 AC 72 ms
71,304 KB
testcase_23 AC 71 ms
71,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())

if K==N-1 or K==1:
    X=[]
elif K==2:
    if N%2==1:
        X=[]
    else:
        X=[]
        for i in range(1,N):
            if i%2==1:
                X.append((i,i+1,2))
            else:
                X.append((i,i+1,-3))
else:
    X=[]
    for i in range(1,K):
        X.append((i,i+1,-1))

    for i in range(K+1,N+1):
        X.append((i,K-1,K-2))

if X:
    print("Yes")
    for u,v,w in X:
        print(u,v,w)
else:
    print("No")
0