結果

問題 No.994 ばらばらコイン
ユーザー wakuwinmailwakuwinmail
提出日時 2020-02-21 21:26:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 375 bytes
コンパイル時間 1,496 ms
コンパイル使用メモリ 166,396 KB
実行使用メモリ 8,960 KB
最終ジャッジ日時 2024-04-17 07:08:47
合計ジャッジ時間 5,399 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 69 ms
8,704 KB
testcase_03 AC 79 ms
8,960 KB
testcase_04 AC 81 ms
8,832 KB
testcase_05 AC 34 ms
6,016 KB
testcase_06 AC 73 ms
8,960 KB
testcase_07 AC 72 ms
8,960 KB
testcase_08 AC 52 ms
7,040 KB
testcase_09 AC 73 ms
8,448 KB
testcase_10 AC 51 ms
7,040 KB
testcase_11 AC 59 ms
7,680 KB
testcase_12 AC 61 ms
7,936 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll=long long;

int main(){
    int n,k;
    cin>>n>>k;
    vector<vector<int>> g(n);
    for (int i = 0; i < n-1; ++i) {
        int a,b;
        cin>>a>>b;
        g[a].emplace_back(b);
        g[b].emplace_back(a);
    }
    if(k>n){
        cout<<-1<<endl;
    }
    else{
        cout<<k-1<<endl;
    }
    return 0;
}
0