結果

問題 No.2 素因数ゲーム
ユーザー kuramukuramu
提出日時 2016-01-31 00:22:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 663 bytes
コンパイル時間 2,147 ms
コンパイル使用メモリ 72,036 KB
実行使用メモリ 49,828 KB
最終ジャッジ日時 2023-08-27 04:14:20
合計ジャッジ時間 4,812 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,332 KB
testcase_01 AC 42 ms
47,364 KB
testcase_02 AC 43 ms
49,448 KB
testcase_03 AC 44 ms
49,828 KB
testcase_04 AC 42 ms
49,572 KB
testcase_05 AC 42 ms
47,308 KB
testcase_06 AC 43 ms
49,348 KB
testcase_07 AC 43 ms
49,452 KB
testcase_08 AC 43 ms
49,228 KB
testcase_09 AC 42 ms
49,472 KB
testcase_10 AC 42 ms
49,668 KB
testcase_11 AC 42 ms
49,472 KB
testcase_12 AC 42 ms
49,224 KB
testcase_13 AC 42 ms
49,364 KB
testcase_14 AC 44 ms
49,352 KB
testcase_15 AC 44 ms
49,156 KB
testcase_16 AC 43 ms
49,264 KB
testcase_17 AC 43 ms
49,532 KB
testcase_18 AC 43 ms
49,360 KB
testcase_19 AC 43 ms
49,340 KB
testcase_20 AC 42 ms
49,436 KB
testcase_21 AC 42 ms
49,524 KB
testcase_22 AC 42 ms
49,256 KB
testcase_23 AC 41 ms
49,352 KB
testcase_24 AC 42 ms
49,220 KB
testcase_25 AC 42 ms
49,212 KB
testcase_26 AC 42 ms
49,264 KB
testcase_27 AC 42 ms
49,220 KB
testcase_28 AC 42 ms
49,260 KB
testcase_29 AC 42 ms
49,168 KB
testcase_30 AC 43 ms
49,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {

	 public static void main(String[] args) {
	      BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
	      try {
	    	  int N = Integer.parseInt(stdReader.readLine());
	    	  int count = 0;
	    	  int ans = 0;
	    	  for(int i=2;i*i<=N;i++){
	    		  count = 0;
	    		  while(N%i==0){
	    			  N /= i;
	    			  count++;
	    		  }
	    		  ans ^= count;
	    	  }
	    	  if(N!=1) ans ^= 1;
	    	  System.out.println(ans==0?"Bob":"Alice");
	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0