結果

問題 No.2 素因数ゲーム
ユーザー mastersatoshimastersatoshi
提出日時 2015-08-01 08:58:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 737 bytes
コンパイル時間 5,214 ms
コンパイル使用メモリ 71,472 KB
実行使用メモリ 49,736 KB
最終ジャッジ日時 2023-09-25 00:04:15
合計ジャッジ時間 4,858 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,188 KB
testcase_01 AC 41 ms
49,320 KB
testcase_02 AC 42 ms
49,156 KB
testcase_03 AC 44 ms
49,528 KB
testcase_04 AC 42 ms
49,376 KB
testcase_05 AC 44 ms
49,472 KB
testcase_06 AC 43 ms
49,416 KB
testcase_07 AC 42 ms
49,200 KB
testcase_08 WA -
testcase_09 AC 42 ms
49,196 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 42 ms
49,736 KB
testcase_13 AC 43 ms
49,584 KB
testcase_14 AC 42 ms
49,236 KB
testcase_15 AC 42 ms
49,384 KB
testcase_16 WA -
testcase_17 AC 43 ms
49,236 KB
testcase_18 AC 41 ms
49,136 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 42 ms
49,168 KB
testcase_27 AC 42 ms
49,012 KB
testcase_28 AC 42 ms
49,164 KB
testcase_29 AC 42 ms
49,200 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        long N = Long.parseLong(br.readLine());

        long z = 0;

        for (long i = 2; i <= 10000; i++) {
            int count = 0;
            while (true) {
                if (N % i == 0) {
                    N = N / i;

                    count++;
                } else {
                    z = z ^ count;
                    break;
                }
            }
        }

        if (z == 0) {
            System.out.println("Bob");
        } else {
            System.out.println("Alice");
        }
    }
}
0