結果

問題 No.1523 +/- Tree
ユーザー convexineqconvexineq
提出日時 2021-05-28 22:24:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 78,156 KB
最終ジャッジ日時 2023-08-07 07:14:00
合計ジャッジ時間 6,708 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,284 KB
testcase_01 AC 69 ms
71,352 KB
testcase_02 AC 70 ms
71,152 KB
testcase_03 AC 69 ms
71,156 KB
testcase_04 AC 71 ms
71,380 KB
testcase_05 AC 69 ms
71,468 KB
testcase_06 AC 71 ms
71,192 KB
testcase_07 AC 72 ms
71,264 KB
testcase_08 AC 71 ms
71,096 KB
testcase_09 AC 70 ms
71,156 KB
testcase_10 AC 72 ms
71,148 KB
testcase_11 AC 70 ms
71,204 KB
testcase_12 AC 92 ms
76,420 KB
testcase_13 AC 92 ms
76,840 KB
testcase_14 AC 87 ms
76,652 KB
testcase_15 AC 75 ms
75,144 KB
testcase_16 AC 86 ms
76,396 KB
testcase_17 AC 69 ms
71,468 KB
testcase_18 AC 90 ms
76,584 KB
testcase_19 AC 70 ms
71,476 KB
testcase_20 AC 69 ms
71,200 KB
testcase_21 AC 71 ms
71,356 KB
testcase_22 AC 69 ms
71,560 KB
testcase_23 AC 70 ms
71,340 KB
testcase_24 AC 70 ms
71,312 KB
testcase_25 AC 87 ms
76,312 KB
testcase_26 AC 81 ms
76,412 KB
testcase_27 AC 88 ms
76,696 KB
testcase_28 AC 85 ms
76,640 KB
testcase_29 AC 82 ms
76,516 KB
testcase_30 AC 81 ms
76,420 KB
testcase_31 AC 86 ms
76,480 KB
testcase_32 AC 69 ms
71,468 KB
testcase_33 AC 102 ms
78,156 KB
testcase_34 AC 82 ms
76,412 KB
testcase_35 AC 87 ms
76,364 KB
testcase_36 AC 82 ms
76,480 KB
testcase_37 AC 84 ms
76,532 KB
testcase_38 AC 81 ms
76,532 KB
testcase_39 AC 93 ms
76,496 KB
testcase_40 AC 90 ms
76,648 KB
testcase_41 AC 96 ms
77,000 KB
testcase_42 AC 70 ms
71,200 KB
testcase_43 AC 101 ms
77,628 KB
testcase_44 AC 101 ms
77,560 KB
testcase_45 AC 71 ms
71,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
if k==1:
    print("No")
    exit()
elif k >= 3:
    if n-1==k:
        print("No")
        exit()
    print("Yes")
    print(1,2,-k)
    for i in range(1,k-1):
        print(i+1,i+2,0)
    for i in range(n-k):
        print(1,k+i+1,k-1)

if n%2:
    print("No")
    exit()
else:
    print("Yes")
    for i in range(n-1):
        print(i+1,i+2, -n if i%2 else n-1)
0