結果

問題 No.1523 +/- Tree
ユーザー shotoyoo
提出日時 2021-05-28 21:57:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 63,744 KB
最終ジャッジ日時 2024-11-07 09:28:03
合計ジャッジ時間 8,040 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 17 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))


n,k = list(map(int, input().split()))
if (n-1)%k==0:
    print("No")
else:
    v = 10000 - 1
    v2 = -5000
    es = []
    for i in range(1,n):
        if i%k==1:
            val = v
        else:
            val = v2
        es.append((i,i+1,val))
    print("Yes")
    write("\n".join((" ".join(map(str, item)) for item in es)))
0