結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー C_nena_EC_nena_E
提出日時 2020-01-31 21:52:59
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 656 bytes
コンパイル時間 2,666 ms
コンパイル使用メモリ 77,520 KB
実行使用メモリ 68,268 KB
最終ジャッジ日時 2023-10-17 09:30:39
合計ジャッジ時間 11,882 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 125 ms
55,600 KB
testcase_02 AC 132 ms
57,360 KB
testcase_03 AC 129 ms
57,436 KB
testcase_04 AC 125 ms
57,756 KB
testcase_05 AC 125 ms
57,452 KB
testcase_06 AC 125 ms
57,484 KB
testcase_07 AC 137 ms
57,612 KB
testcase_08 AC 149 ms
57,764 KB
testcase_09 AC 145 ms
57,568 KB
testcase_10 WA -
testcase_11 AC 141 ms
57,476 KB
testcase_12 AC 144 ms
57,732 KB
testcase_13 WA -
testcase_14 AC 314 ms
60,836 KB
testcase_15 AC 317 ms
61,812 KB
testcase_16 WA -
testcase_17 AC 322 ms
61,836 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 581 ms
62,296 KB
testcase_21 AC 615 ms
66,272 KB
testcase_22 AC 655 ms
67,132 KB
testcase_23 AC 667 ms
68,268 KB
testcase_24 AC 662 ms
67,156 KB
testcase_25 AC 702 ms
67,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        if(N == 2){
            System.out.println("Alice");
            return;
        }
        int[] map = new int[N]; 
        for(int i = 0; i < N-1; i++){
            map[sc.nextInt()]++;
            map[sc.nextInt()]++;
        }
        for(int i = 0; i < N; i++){
            if(map[i] == 0){
                System.out.println("Alice");
                return;
            }
        }
        System.out.println("Bob");
    }
}
0