結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-20 22:33:33 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 386 bytes |
| コンパイル時間 | 4,153 ms |
| コンパイル使用メモリ | 74,392 KB |
| 実行使用メモリ | 54,400 KB |
| 最終ジャッジ日時 | 2024-06-12 02:48:08 |
| 合計ジャッジ時間 | 8,088 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 = {"Bob", "Alice"};
for (int i = 2; i <= n; i++)
if (n % i == 0) {
n /= i;
for (cnt = 0; n % i == 0; cnt++) n /= i;
res += cnt > 1 ? 2 : 1;
}
System.out.println(s[res % 2]);
}
}