結果

問題 No.2 素因数ゲーム
ユーザー kuramu
提出日時 2016-01-31 00:22:57
言語 Java
(openjdk 23)
結果
AC  
実行時間 67 ms / 5,000 ms
コード長 663 bytes
コンパイル時間 3,575 ms
コンパイル使用メモリ 73,292 KB
実行使用メモリ 36,916 KB
最終ジャッジ日時 2024-12-26 12:08:33
合計ジャッジ時間 6,862 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

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