結果

問題 No.994 ばらばらコイン
ユーザー soto800soto800
提出日時 2020-02-21 21:25:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 1,524 ms
コンパイル使用メモリ 166,432 KB
実行使用メモリ 9,472 KB
最終ジャッジ日時 2024-04-17 07:07:44
合計ジャッジ時間 3,095 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 67 ms
8,832 KB
testcase_03 AC 73 ms
9,472 KB
testcase_04 AC 70 ms
9,344 KB
testcase_05 AC 34 ms
6,272 KB
testcase_06 AC 70 ms
9,472 KB
testcase_07 AC 72 ms
9,472 KB
testcase_08 AC 47 ms
7,424 KB
testcase_09 AC 66 ms
9,216 KB
testcase_10 AC 47 ms
7,424 KB
testcase_11 AC 56 ms
7,936 KB
testcase_12 AC 62 ms
8,320 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 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