結果
問題 |
No.2 素因数ゲーム
|
ユーザー |
![]() |
提出日時 | 2020-06-26 17:58:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 5,000 ms |
コード長 | 364 bytes |
コンパイル時間 | 161 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-07-04 09:56:07 |
合計ジャッジ時間 | 2,198 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
import math N = int(input()) xorresult = 0 for i in range(2, int(math.sqrt(N) + 1)): pfnum = 0 while N % i == 0: N /= i pfnum += 1 # xorの計算 xorresult ^= pfnum if N != 1: # N!=1である場合√Nより大きい約数が1つ存在する。 xorresult ^= 1 if xorresult == 0: print("Bob") else: print("Alice")