結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー ぽまぽま
提出日時 2020-01-31 22:07:39
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 1,316 ms
コンパイル使用メモリ 30,312 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 09:56:53
合計ジャッジ時間 2,422 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main(void) {
    int i, a, b, n, iso = 0, one = 0;
    scanf("%d", &n);
    int net[n];
    for(i = 0; i < n; i++) net[i] = 0;
    for(i = 0; i < n-1; i++) {
        scanf("%d %d", &a, &b);
        net[a]++;
        net[b]++;
    }
    for(i = 0; i < n; i++) {
        if(net[i] == 0) iso++;
        else if(net[i] == 1) one++;
    }
    if(iso > 1 || (iso > 0 && one > 0)) printf("Alice\n");
    else printf("Bob\n");
    return 0;
}
0