結果

問題 No.2 素因数ゲーム
ユーザー gigurururugigurururu
提出日時 2014-11-04 13:38:48
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 485 bytes
コンパイル時間 502 ms
コンパイル使用メモリ 6,532 KB
実行使用メモリ 336,596 KB
最終ジャッジ日時 2023-08-29 00:31:21
合計ジャッジ時間 22,836 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,328 KB
testcase_01 AC 12 ms
6,232 KB
testcase_02 AC 12 ms
6,112 KB
testcase_03 AC 12 ms
6,228 KB
testcase_04 AC 13 ms
6,232 KB
testcase_05 AC 44 ms
9,396 KB
testcase_06 AC 4,626 ms
295,516 KB
testcase_07 TLE -
testcase_08 AC 4,811 ms
307,240 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
max = input()
max2 = (max-3)/2+1
sieve = [True]*max2
for i in range(int((math.sqrt(max)-3)/2)+1):
  if not sieve[i]: continue
  k = i+i+3
  j = k*(i+1)+i
  while j < max2:
    sieve[j] = False
    j += k

for i in range(max2):
  if sieve[i]: sieve[i]=i+i+3
sieve=[2]+sieve
sieve=[[i,0] for i in sieve if i]
for i in sieve:
    while max%i[0]==0:
        max/=i[0]
        i[1]+=1
print "Alice" if reduce(lambda x,y:x^y,[j for i,j in sieve])>0 else "Bob"
0