結果

問題 No.994 ばらばらコイン
ユーザー eru_t
提出日時 2020-02-21 21:37:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 1,840 ms
コンパイル使用メモリ 192,272 KB
最終ジャッジ日時 2025-01-09 01:28:43
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n - 1; i++) {
        int a, b;
        cin >> a >> b;
    }

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

    cout << (k - 1) << endl;

    return 0;
}
0