結果

問題 No.2 素因数ゲーム
ユーザー gigurururugigurururu
提出日時 2014-11-04 13:58:18
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 418 bytes
コンパイル時間 680 ms
コンパイル使用メモリ 6,608 KB
実行使用メモリ 797,256 KB
最終ジャッジ日時 2023-08-29 00:31:44
合計ジャッジ時間 22,032 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
10,532 KB
testcase_01 AC 11 ms
6,140 KB
testcase_02 AC 12 ms
6,224 KB
testcase_03 AC 12 ms
6,088 KB
testcase_04 AC 12 ms
6,096 KB
testcase_05 AC 34 ms
8,480 KB
testcase_06 AC 3,907 ms
298,760 KB
testcase_07 AC 4,847 ms
130,476 KB
testcase_08 TLE -
testcase_09 MLE -
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+1
sieve = [True]*max2
t = 0
while max % 2 == 0:
  max /= 2
  t += 1
x = [t]
for i in range(int((max-3)/2)+1):
  if not sieve[i]: continue
  k = i+i+3
  t = 0
  while max % k == 0:
    max /= k
    t += 1
  x.append(t)
  if max == 1: break
  j = k*(i+1)+i
  while j < max2:
    sieve[j] = False
    j += k
print "Alice" if reduce(lambda i,j:i^j,x)>0 else "Bob"
0