結果

問題 No.994 ばらばらコイン
ユーザー miya145592miya145592
提出日時 2023-05-21 03:47:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 86,200 KB
実行使用メモリ 86,300 KB
最終ジャッジ日時 2023-08-23 11:52:19
合計ジャッジ時間 5,103 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,664 KB
testcase_01 AC 72 ms
70,732 KB
testcase_02 AC 163 ms
85,524 KB
testcase_03 AC 194 ms
85,944 KB
testcase_04 AC 194 ms
86,300 KB
testcase_05 AC 143 ms
81,800 KB
testcase_06 AC 203 ms
85,968 KB
testcase_07 AC 195 ms
85,972 KB
testcase_08 AC 160 ms
82,396 KB
testcase_09 AC 190 ms
85,700 KB
testcase_10 AC 162 ms
82,436 KB
testcase_11 AC 177 ms
85,244 KB
testcase_12 AC 181 ms
85,604 KB
testcase_13 AC 72 ms
71,328 KB
testcase_14 AC 74 ms
71,288 KB
testcase_15 AC 73 ms
71,148 KB
testcase_16 AC 74 ms
70,972 KB
testcase_17 AC 74 ms
71,156 KB
testcase_18 AC 73 ms
71,100 KB
testcase_19 AC 72 ms
71,140 KB
testcase_20 AC 72 ms
71,096 KB
testcase_21 AC 73 ms
71,228 KB
testcase_22 AC 72 ms
70,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
G = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    a-=1
    b-=1
    G[a].append(b)
    G[b].append(a)
if N<K:
    print(-1)
    exit()
print(K-1)
0