結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,484 KB
testcase_01 AC 131 ms
57,440 KB
testcase_02 AC 131 ms
57,608 KB
testcase_03 AC 132 ms
57,504 KB
testcase_04 AC 131 ms
57,592 KB
testcase_05 AC 135 ms
57,528 KB
testcase_06 AC 134 ms
57,448 KB
testcase_07 AC 147 ms
57,728 KB
testcase_08 AC 150 ms
57,724 KB
testcase_09 AC 144 ms
57,244 KB
testcase_10 WA -
testcase_11 AC 152 ms
57,632 KB
testcase_12 AC 147 ms
57,880 KB
testcase_13 WA -
testcase_14 AC 321 ms
61,976 KB
testcase_15 AC 319 ms
61,796 KB
testcase_16 WA -
testcase_17 AC 313 ms
61,704 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 549 ms
62,100 KB
testcase_21 AC 638 ms
66,148 KB
testcase_22 AC 688 ms
66,988 KB
testcase_23 AC 719 ms
68,212 KB
testcase_24 AC 707 ms
67,428 KB
testcase_25 AC 731 ms
67,744 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();
        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