結果
問題 |
No.977 アリス仕掛けの摩天楼
|
ユーザー |
![]() |
提出日時 | 2020-04-01 13:56:51 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 440 bytes |
コンパイル時間 | 306 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 34,972 KB |
最終ジャッジ日時 | 2024-06-26 10:48:48 |
合計ジャッジ時間 | 5,793 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 8 |
ソースコード
n = int(input()) i_cs = {} for i in range(n): i_cs[i] = [] for i in range(n-1): s, d = map(int, input().split()) i_cs[s].append(d) i_cs[d].append(s) # print(i_cs) free_num = sum([1 for i, cs in i_cs.items() if len(cs) ==0]) # print(free_num) one_num = sum([1 for i, cs in i_cs.items() if len(cs) == 1]) if free_num >= 2: print("Alice") elif free_num == 1 and one_num >= 1: print("Alice") else: print("Bob")