結果

問題 No.1523 +/- Tree
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-05-28 21:32:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 68,352 KB
最終ジャッジ日時 2024-04-25 01:18:26
合計ジャッジ時間 4,869 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,840 KB
testcase_01 AC 41 ms
51,840 KB
testcase_02 AC 45 ms
52,096 KB
testcase_03 AC 40 ms
51,840 KB
testcase_04 AC 42 ms
51,968 KB
testcase_05 AC 40 ms
51,840 KB
testcase_06 AC 42 ms
51,840 KB
testcase_07 AC 44 ms
52,352 KB
testcase_08 AC 42 ms
51,456 KB
testcase_09 AC 42 ms
51,328 KB
testcase_10 AC 42 ms
51,840 KB
testcase_11 AC 43 ms
51,712 KB
testcase_12 AC 69 ms
67,584 KB
testcase_13 AC 71 ms
68,096 KB
testcase_14 AC 65 ms
65,664 KB
testcase_15 AC 49 ms
57,984 KB
testcase_16 AC 65 ms
65,664 KB
testcase_17 AC 41 ms
51,968 KB
testcase_18 AC 73 ms
68,352 KB
testcase_19 AC 44 ms
51,840 KB
testcase_20 AC 40 ms
51,840 KB
testcase_21 AC 41 ms
51,712 KB
testcase_22 AC 41 ms
51,584 KB
testcase_23 AC 41 ms
51,712 KB
testcase_24 AC 41 ms
51,712 KB
testcase_25 AC 67 ms
67,072 KB
testcase_26 AC 58 ms
63,232 KB
testcase_27 AC 66 ms
66,304 KB
testcase_28 AC 65 ms
66,560 KB
testcase_29 AC 53 ms
60,928 KB
testcase_30 AC 55 ms
61,312 KB
testcase_31 AC 65 ms
66,304 KB
testcase_32 AC 41 ms
51,584 KB
testcase_33 AC 66 ms
66,688 KB
testcase_34 AC 59 ms
62,976 KB
testcase_35 AC 66 ms
65,664 KB
testcase_36 AC 60 ms
62,720 KB
testcase_37 AC 60 ms
63,232 KB
testcase_38 AC 47 ms
58,240 KB
testcase_39 AC 60 ms
64,128 KB
testcase_40 AC 74 ms
67,840 KB
testcase_41 AC 66 ms
65,536 KB
testcase_42 AC 42 ms
51,968 KB
testcase_43 AC 66 ms
66,560 KB
testcase_44 AC 65 ms
66,944 KB
testcase_45 AC 41 ms
51,968 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