結果

問題 No.2 素因数ゲーム
ユーザー yuki2006
提出日時 2014-10-01 19:41:31
言語 Java
(openjdk 23)
結果
AC  
実行時間 578 ms / 5,000 ms
コード長 577 bytes
コンパイル時間 3,583 ms
コンパイル使用メモリ 75,124 KB
実行使用メモリ 41,424 KB
最終ジャッジ日時 2024-12-26 10:35:52
合計ジャッジ時間 10,052 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Yuki002 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();

        int ans=0;
        for (int k = 2; N > 1; k++) {
            int count=0;
            while (N%k==0){
                count++;
                N/=k;
            }
            ans^=count;
        }
        if (ans>0){
            System.out.println("Alice");
        }else{
            System.out.println("Bob");

        }


    }
}
0