結果
問題 | No.1506 Unbalanced Pocky Game |
ユーザー |
![]() |
提出日時 | 2021-05-15 01:44:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 92 ms / 2,000 ms |
コード長 | 420 bytes |
コンパイル時間 | 338 ms |
コンパイル使用メモリ | 82,556 KB |
実行使用メモリ | 107,860 KB |
最終ジャッジ日時 | 2024-10-02 08:23:35 |
合計ジャッジ時間 | 5,964 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 63 |
ソースコード
import collections N = int(input()) A = list(map(int, input().split())) D = collections.deque(A) aliceWin = False while len(D) and D[0]==1: D.popleft() aliceWin = not aliceWin if len(D)==0: if aliceWin: print('Alice') else: print('Bob') exit() aliceWin = True while len(D) and D[-1]==1: D.pop() aliceWin = not aliceWin if aliceWin: print('Alice') else: print('Bob')