結果

問題 No.2 素因数ゲーム
ユーザー uafr_csuafr_cs
提出日時 2015-06-03 03:28:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 462 bytes
コンパイル時間 1,973 ms
コンパイル使用メモリ 72,496 KB
実行使用メモリ 57,708 KB
最終ジャッジ日時 2023-08-27 03:49:43
合計ジャッジ時間 7,122 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,420 KB
testcase_01 AC 126 ms
55,996 KB
testcase_02 AC 121 ms
55,752 KB
testcase_03 AC 125 ms
55,996 KB
testcase_04 AC 126 ms
57,708 KB
testcase_05 AC 124 ms
55,692 KB
testcase_06 AC 124 ms
55,996 KB
testcase_07 AC 126 ms
55,968 KB
testcase_08 AC 123 ms
55,612 KB
testcase_09 AC 124 ms
55,652 KB
testcase_10 AC 125 ms
56,468 KB
testcase_11 AC 125 ms
55,704 KB
testcase_12 AC 126 ms
55,884 KB
testcase_13 AC 126 ms
55,928 KB
testcase_14 AC 125 ms
56,160 KB
testcase_15 AC 125 ms
55,820 KB
testcase_16 AC 128 ms
55,860 KB
testcase_17 AC 126 ms
55,648 KB
testcase_18 AC 128 ms
55,668 KB
testcase_19 AC 127 ms
55,704 KB
testcase_20 AC 123 ms
56,016 KB
testcase_21 AC 128 ms
56,092 KB
testcase_22 AC 127 ms
56,044 KB
testcase_23 AC 125 ms
55,940 KB
testcase_24 AC 126 ms
55,632 KB
testcase_25 AC 128 ms
55,868 KB
testcase_26 AC 125 ms
56,200 KB
testcase_27 AC 125 ms
55,696 KB
testcase_28 AC 124 ms
55,808 KB
testcase_29 AC 121 ms
53,424 KB
testcase_30 AC 125 ms
56,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		long N = sc.nextLong();
		
		int xor = 0;
		for(long i = 2; i <= 100000; i++){
			int count = 0;
			
			while(N % i == 0){
				N /= i;
				count++;
			}
			
			xor ^= count;
		}
		
		if(N != 1){
			xor ^= 1;
		}
		
		System.out.println(xor == 0 ? "Bob" : "Alice");
		
	}
	
}
0