結果
問題 |
No.2 素因数ゲーム
|
ユーザー |
|
提出日時 | 2021-07-11 20:11:37 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 126 ms / 5,000 ms |
コード長 | 512 bytes |
コンパイル時間 | 2,715 ms |
コンパイル使用メモリ | 75,392 KB |
実行使用メモリ | 41,288 KB |
最終ジャッジ日時 | 2024-07-02 03:13:07 |
合計ジャッジ時間 | 7,561 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = Long.parseLong(sc.next()); sc.close(); int MAX = 10001; long mex = 0; for ( int i = 2 ; i < MAX ; i++ ) { int cnt = 0; while ( N % i == 0 ) { N /= i; cnt++; } if ( cnt > 0 ) mex = mex ^ cnt; } if ( N > 1 ) { mex = mex ^ 1; } if ( mex == 0 ) { System.out.println("Bob"); } else { System.out.println("Alice"); } } }