結果
問題 |
No.2 素因数ゲーム
|
ユーザー |
|
提出日時 | 2014-12-20 21:57:05 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 396 bytes |
コンパイル時間 | 3,330 ms |
コンパイル使用メモリ | 74,220 KB |
実行使用メモリ | 41,692 KB |
最終ジャッジ日時 | 2024-06-12 02:43:37 |
合計ジャッジ時間 | 8,409 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 7 |
ソースコード
import java.util.Scanner; public class Yukicoder02 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), res = 0, cnt; String[] s = {"Alice", "Bob"}; for (int i = 2; i * i <= n; i++) if (n % i == 0) { n /= i; for (cnt = 0; n % i == 0; cnt++) n /= i; res += cnt % 2 == 0 ? 1 : 0; } System.out.println(s[res % 2]); } }