結果

問題 No.994 ばらばらコイン
ユーザー polyesterpolyester
提出日時 2020-02-21 22:52:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 570 bytes
コンパイル時間 921 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 08:01:26
合計ジャッジ時間 2,798 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 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 3 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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(){
  int n, k;
  cin >> n >> k;
  vector<int> 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