結果

問題 No.1523 +/- Tree
ユーザー shotoyoo
提出日時 2021-05-28 21:56:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 538 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 63,872 KB
最終ジャッジ日時 2024-11-07 09:26:56
合計ジャッジ時間 10,442 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 44
権限があれば一括ダウンロードができます

ソースコード

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(-1)
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))
    write("\n".join((" ".join(map(str, item)) for item in es)))
0