結果
問題 | No.103 素因数ゲーム リターンズ |
ユーザー |
|
提出日時 | 2015-02-25 15:35:10 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 13 ms / 5,000 ms |
コード長 | 452 bytes |
コンパイル時間 | 186 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 23:19:53 |
合計ジャッジ時間 | 1,436 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 20 |
ソースコード
import sys sys.setrecursionlimit(100000) def get_pow(n): if n == 1: return [1] res = [] i = 2 while i*i <= n: cnt = 0 while n%i == 0: n /= i cnt += 1 if cnt > 0: res.append(cnt) i += 1 if n > 1: res.append(1) return res N = int(raw_input()) M = map(int,raw_input().split()) x = 0 for Mi in M: for stone in get_pow(Mi): x ^= stone%3 print "Alice" if x != 0 else "Bob"