結果

問題 No.2 素因数ゲーム
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-04-12 17:17:06
言語 Java21
(openjdk 21)
結果
MLE  
実行時間 -
コード長 1,221 bytes
コンパイル時間 3,613 ms
コンパイル使用メモリ 76,460 KB
実行使用メモリ 533,208 KB
最終ジャッジ日時 2023-09-17 19:44:13
合計ジャッジ時間 15,037 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,460 KB
testcase_01 AC 128 ms
56,032 KB
testcase_02 AC 126 ms
55,636 KB
testcase_03 AC 128 ms
55,968 KB
testcase_04 AC 127 ms
55,404 KB
testcase_05 AC 126 ms
56,016 KB
testcase_06 AC 128 ms
55,456 KB
testcase_07 AC 130 ms
55,704 KB
testcase_08 AC 234 ms
77,400 KB
testcase_09 AC 126 ms
55,640 KB
testcase_10 AC 135 ms
55,892 KB
testcase_11 AC 134 ms
56,024 KB
testcase_12 AC 127 ms
55,628 KB
testcase_13 AC 126 ms
55,672 KB
testcase_14 AC 135 ms
55,504 KB
testcase_15 AC 133 ms
55,976 KB
testcase_16 AC 135 ms
55,968 KB
testcase_17 AC 157 ms
58,312 KB
testcase_18 AC 128 ms
55,716 KB
testcase_19 MLE -
testcase_20 AC 1,343 ms
377,772 KB
testcase_21 MLE -
testcase_22 AC 229 ms
77,536 KB
testcase_23 AC 135 ms
55,656 KB
testcase_24 AC 138 ms
56,148 KB
testcase_25 AC 223 ms
77,144 KB
testcase_26 AC 128 ms
55,452 KB
testcase_27 AC 128 ms
56,004 KB
testcase_28 AC 126 ms
55,840 KB
testcase_29 AC 129 ms
55,956 KB
testcase_30 AC 134 ms
55,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.2 素因数ゲーム

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No2 {
    
    static final Scanner in = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        int n = in.nextInt();
        int ans = 0;
        for (int x : primeDecomposition(n)) {
            ans ^= x;
        }

        out.println(ans!=0?"Alice":"Bob");
    }

    static ArrayList<Integer> primeDecomposition(int n) {
        ArrayList<Integer> res = new ArrayList<>();
        if (n == 1) res.add(1);
        else {
            for (int i=2; i<=n; i++) {
                int cnt = 0;
                while (n%i == 0) {
                    cnt++; n /= i;
                }
                res.add(cnt);
            }
        }
        return res;
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        in.close();
        out.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0