結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
t8m8⛄️
|
| 提出日時 | 2015-04-12 17:02:07 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 1,292 bytes |
| 記録 | |
| コンパイル時間 | 3,096 ms |
| コンパイル使用メモリ | 84,652 KB |
| 実行使用メモリ | 784,072 KB |
| 最終ジャッジ日時 | 2026-03-25 21:54:59 |
| 合計ジャッジ時間 | 24,968 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 TLE * 3 MLE * 3 |
ソースコード
//No.2 素因数ゲーム
import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;
public class No2 {
static final Scanner in = new Scanner(System.in);
static final PrintWriter out = new PrintWriter(System.out,false);
static void solve() {
int n = in.nextInt();
int ans = 0;
HashMap<Long,Integer> map = primeDecomposition(n);
for (Long x : map.keySet()) {
ans ^= map.get(x);
}
out.println(ans!=0?"Alice":"Bob");
}
static HashMap<Long,Integer> primeDecomposition(long n) {
HashMap<Long,Integer> res = new HashMap<>();
if (n == 1) res.put(1L,1);
else {
for (long i=2; i<=n; i++) {
int cnt = 0;
while (n%i == 0) {
cnt++; n /= i;
}
res.put(i,cnt);
}
}
return res;
}
public static void main(String[] args) {
long start = System.currentTimeMillis();
solve();
out.flush();
long end = System.currentTimeMillis();
//trace(end-start + "ms");
in.close();
out.close();
}
static void trace(Object... o) { System.out.println(deepToString(o));}
}
t8m8⛄️