結果

問題 No.1523 +/- Tree
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-05-28 21:32:32
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 76,856 KB
最終ジャッジ日時 2023-08-07 07:12:37
合計ジャッジ時間 6,651 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,368 KB
testcase_01 AC 70 ms
71,232 KB
testcase_02 AC 72 ms
71,372 KB
testcase_03 AC 71 ms
71,504 KB
testcase_04 AC 71 ms
71,532 KB
testcase_05 AC 71 ms
71,164 KB
testcase_06 AC 70 ms
71,400 KB
testcase_07 AC 70 ms
71,280 KB
testcase_08 AC 71 ms
71,260 KB
testcase_09 AC 68 ms
71,264 KB
testcase_10 AC 70 ms
71,368 KB
testcase_11 AC 68 ms
71,252 KB
testcase_12 AC 89 ms
76,856 KB
testcase_13 AC 92 ms
76,792 KB
testcase_14 AC 87 ms
76,500 KB
testcase_15 AC 77 ms
75,452 KB
testcase_16 AC 89 ms
76,676 KB
testcase_17 AC 71 ms
71,368 KB
testcase_18 AC 91 ms
76,812 KB
testcase_19 AC 72 ms
71,212 KB
testcase_20 AC 71 ms
71,496 KB
testcase_21 AC 70 ms
71,144 KB
testcase_22 AC 69 ms
71,552 KB
testcase_23 AC 69 ms
71,172 KB
testcase_24 AC 70 ms
71,160 KB
testcase_25 AC 87 ms
76,720 KB
testcase_26 AC 84 ms
76,664 KB
testcase_27 AC 88 ms
76,524 KB
testcase_28 AC 90 ms
76,660 KB
testcase_29 AC 81 ms
76,584 KB
testcase_30 AC 82 ms
76,212 KB
testcase_31 AC 89 ms
76,760 KB
testcase_32 AC 70 ms
71,228 KB
testcase_33 AC 88 ms
76,724 KB
testcase_34 AC 84 ms
76,580 KB
testcase_35 AC 89 ms
76,684 KB
testcase_36 AC 84 ms
76,464 KB
testcase_37 AC 83 ms
76,636 KB
testcase_38 AC 77 ms
75,532 KB
testcase_39 AC 84 ms
76,532 KB
testcase_40 AC 94 ms
76,528 KB
testcase_41 AC 93 ms
76,848 KB
testcase_42 AC 71 ms
71,336 KB
testcase_43 AC 89 ms
76,664 KB
testcase_44 AC 88 ms
76,764 KB
testcase_45 AC 70 ms
71,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if K == 1 or N-1 <= K:
    print ("No")
elif K == 2:
    if N % 2 == 1:
        print ("No")
    else:
        print ("Yes")
        for i in range(N-1):
            print (i+1,i+2, 10**9-1 if i % 2 == 0 else -1*(10**9) )

else:

    print ("Yes")

    for i in range(K-1):

        print (i+1,i+2, -1*(10**9) if i==0 else 0)

    for i in range(K+1,N+1):

        print (1,i,10**9-1)
0