結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-20 21:49:51 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 391 bytes |
| 記録 | |
| コンパイル時間 | 3,841 ms |
| コンパイル使用メモリ | 74,280 KB |
| 実行使用メモリ | 41,720 KB |
| 最終ジャッジ日時 | 2024-06-12 02:43:25 |
| 合計ジャッジ時間 | 9,652 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / 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 == 0 ? 1 : 2;
}
System.out.println(s[res%2]);
}
}