結果
問題 |
No.977 アリス仕掛けの摩天楼
|
ユーザー |
![]() |
提出日時 | 2020-01-31 21:52:03 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 565 bytes |
コンパイル時間 | 1,957 ms |
コンパイル使用メモリ | 74,324 KB |
実行使用メモリ | 63,964 KB |
最終ジャッジ日時 | 2024-09-17 07:55:51 |
合計ジャッジ時間 | 10,887 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 5 |
ソースコード
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"); } }