結果

問題 No.1523 +/- Tree
ユーザー convexineqconvexineq
提出日時 2021-05-28 22:24:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 76,544 KB
最終ジャッジ日時 2024-04-25 01:19:39
合計ジャッジ時間 4,921 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
51,840 KB
testcase_01 AC 41 ms
52,096 KB
testcase_02 AC 40 ms
51,584 KB
testcase_03 AC 42 ms
51,584 KB
testcase_04 AC 44 ms
51,584 KB
testcase_05 AC 40 ms
51,712 KB
testcase_06 AC 41 ms
51,968 KB
testcase_07 AC 41 ms
51,712 KB
testcase_08 AC 40 ms
51,968 KB
testcase_09 AC 43 ms
51,712 KB
testcase_10 AC 45 ms
51,712 KB
testcase_11 AC 42 ms
52,224 KB
testcase_12 AC 70 ms
67,584 KB
testcase_13 AC 70 ms
68,224 KB
testcase_14 AC 67 ms
65,792 KB
testcase_15 AC 52 ms
58,368 KB
testcase_16 AC 66 ms
65,664 KB
testcase_17 AC 41 ms
51,712 KB
testcase_18 AC 72 ms
68,736 KB
testcase_19 AC 40 ms
51,712 KB
testcase_20 AC 40 ms
51,840 KB
testcase_21 AC 41 ms
51,840 KB
testcase_22 AC 41 ms
51,840 KB
testcase_23 AC 40 ms
51,712 KB
testcase_24 AC 41 ms
51,840 KB
testcase_25 AC 67 ms
67,456 KB
testcase_26 AC 59 ms
63,360 KB
testcase_27 AC 65 ms
66,048 KB
testcase_28 AC 66 ms
66,304 KB
testcase_29 AC 59 ms
62,976 KB
testcase_30 AC 54 ms
61,696 KB
testcase_31 AC 65 ms
65,792 KB
testcase_32 AC 41 ms
51,968 KB
testcase_33 AC 89 ms
76,288 KB
testcase_34 AC 60 ms
63,232 KB
testcase_35 AC 64 ms
66,176 KB
testcase_36 AC 58 ms
62,848 KB
testcase_37 AC 59 ms
62,848 KB
testcase_38 AC 56 ms
61,824 KB
testcase_39 AC 77 ms
70,144 KB
testcase_40 AC 69 ms
67,968 KB
testcase_41 AC 78 ms
71,552 KB
testcase_42 AC 41 ms
51,840 KB
testcase_43 AC 90 ms
76,544 KB
testcase_44 AC 88 ms
76,288 KB
testcase_45 AC 41 ms
51,840 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