結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー Konton7Konton7
提出日時 2020-01-31 22:04:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 757 bytes
コンパイル時間 1,820 ms
コンパイル使用メモリ 203,992 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 09:50:56
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 WA -
testcase_14 AC 6 ms
4,348 KB
testcase_15 AC 6 ms
4,348 KB
testcase_16 WA -
testcase_17 AC 6 ms
4,348 KB
testcase_18 WA -
testcase_19 AC 16 ms
4,348 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 52 ms
4,348 KB
testcase_24 AC 51 ms
4,348 KB
testcase_25 AC 52 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using PII = std::pair<int, int>;
using PLL = std::pair<ll, ll>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define DEBUG

int main(){
    int n, a, b;
    string ans;
    cin >> n;
    vector<int> v;
    rep(i, n)
        v.push_back(0);
    
    rep(i, n - 1)
    {
        cin >> a >> b;
        v[a]++;
        v[b]++;
    }
    
    a = b = 0;
    rep(i, n)
    {
        if (v[i] == 0)
            a++;
        else if (v[i] == 1)
            b++;
    }

    
    ans = "Alice";
    if (a == 0)
        ans = "Bob";
    else if (a == 1 && b == 0)
        ans = "Bob";
    cout << ans << endl;
    
    return 0;
}
0