結果

問題 No.994 ばらばらコイン
ユーザー soto800soto800
提出日時 2020-02-21 21:25:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 1,572 ms
コンパイル使用メモリ 167,896 KB
実行使用メモリ 9,120 KB
最終ジャッジ日時 2023-07-30 05:18:17
合計ジャッジ時間 3,485 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,364 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 66 ms
8,496 KB
testcase_03 AC 75 ms
9,032 KB
testcase_04 AC 76 ms
9,068 KB
testcase_05 AC 36 ms
6,468 KB
testcase_06 AC 75 ms
9,120 KB
testcase_07 AC 76 ms
9,068 KB
testcase_08 AC 52 ms
7,252 KB
testcase_09 AC 71 ms
8,836 KB
testcase_10 AC 52 ms
7,276 KB
testcase_11 AC 58 ms
7,868 KB
testcase_12 AC 63 ms
8,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 1
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)

signed main(){

	lli n,k;
	cin>>n>>k;

	vector<vector<lli>> v(n);

	REP(i,0,n-1){
		lli a,b;
		cin>>a>>b;
		a--,b--;
		v[a].push_back(b);
		v[b].push_back(a);
	}

	if(k>n){
		cout<<-1<<endl;
		return 0;
	}

	cout<<k-1<<endl;


	return 0;
}
0