結果
問題 |
No.977 アリス仕掛けの摩天楼
|
ユーザー |
![]() |
提出日時 | 2020-01-31 21:52:59 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 656 bytes |
コンパイル時間 | 2,015 ms |
コンパイル使用メモリ | 74,456 KB |
実行使用メモリ | 64,476 KB |
最終ジャッジ日時 | 2024-09-17 07:58:54 |
合計ジャッジ時間 | 10,402 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 WA * 6 |
ソースコード
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"); } }