結果

問題 No.2 素因数ゲーム
ユーザー kano_townkano_town
提出日時 2014-12-20 22:31:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 4,640 ms
コンパイル使用メモリ 71,704 KB
実行使用メモリ 57,992 KB
最終ジャッジ日時 2023-09-02 20:25:31
合計ジャッジ時間 11,159 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,612 KB
testcase_01 AC 126 ms
55,612 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 124 ms
55,860 KB
testcase_05 AC 123 ms
55,880 KB
testcase_06 AC 124 ms
55,772 KB
testcase_07 AC 121 ms
55,612 KB
testcase_08 AC 138 ms
55,488 KB
testcase_09 AC 125 ms
55,588 KB
testcase_10 AC 127 ms
57,508 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 128 ms
55,616 KB
testcase_16 AC 127 ms
55,608 KB
testcase_17 AC 131 ms
55,372 KB
testcase_18 WA -
testcase_19 AC 336 ms
55,744 KB
testcase_20 AC 266 ms
55,856 KB
testcase_21 AC 502 ms
55,392 KB
testcase_22 AC 139 ms
55,868 KB
testcase_23 AC 124 ms
55,724 KB
testcase_24 AC 127 ms
55,748 KB
testcase_25 AC 137 ms
55,564 KB
testcase_26 WA -
testcase_27 AC 126 ms
56,088 KB
testcase_28 AC 126 ms
55,536 KB
testcase_29 WA -
testcase_30 AC 126 ms
55,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 > 2 ? 2 : 1;
			}
		System.out.println(s[res % 2]);
	}
}
0