結果

問題 No.994 ばらばらコイン
ユーザー polyester
提出日時 2020-02-21 22:56:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 572 bytes
コンパイル時間 1,910 ms
コンパイル使用メモリ 85,244 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 22:34:32
合計ジャッジ時間 2,526 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cstdio>
using namespace std;
using ll = long long;

using Graph = vector<vector<int>>;
int main(){
  ll n, k;
  cin >> n >> k;
  vector<ll> a(n), b(n);
  //Graph g(n * n);

  for (int i = 0; i < n - 1; i++){
    cin >> a[i] >> b[i];
    //g[a[i]].push_back(b[i]);
    //g[b[i]].push_back(a[i]);
  }
  if(n < k){
    cout << -1 << "\n";
    return 0;
  }
  cout << k - 1 << "\n";

  return 0;
}
0