結果
問題 | No.2 素因数ゲーム |
ユーザー | CrazyBBB |
提出日時 | 2016-03-05 19:02:37 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 836 bytes |
コンパイル時間 | 2,228 ms |
コンパイル使用メモリ | 78,604 KB |
実行使用メモリ | 57,740 KB |
最終ジャッジ日時 | 2023-10-24 19:56:59 |
合計ジャッジ時間 | 7,076 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 127 ms
57,440 KB |
testcase_01 | AC | 128 ms
57,420 KB |
testcase_02 | AC | 111 ms
56,272 KB |
testcase_03 | AC | 127 ms
57,372 KB |
testcase_04 | WA | - |
testcase_05 | AC | 126 ms
57,480 KB |
testcase_06 | AC | 125 ms
57,196 KB |
testcase_07 | AC | 128 ms
57,640 KB |
testcase_08 | WA | - |
testcase_09 | AC | 125 ms
57,496 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 129 ms
57,588 KB |
testcase_13 | AC | 124 ms
57,460 KB |
testcase_14 | AC | 122 ms
57,492 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 121 ms
57,156 KB |
testcase_18 | AC | 126 ms
57,488 KB |
testcase_19 | AC | 128 ms
57,480 KB |
testcase_20 | WA | - |
testcase_21 | AC | 128 ms
57,424 KB |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 112 ms
56,288 KB |
testcase_27 | AC | 124 ms
57,160 KB |
testcase_28 | AC | 116 ms
56,224 KB |
testcase_29 | AC | 126 ms
55,572 KB |
testcase_30 | WA | - |
ソースコード
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { static int[] S; static int[] T; static int[] Y; static int[] M; static int[][] dp; static final int INF = Integer.MAX_VALUE/2; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); List<Integer> list = new ArrayList<>(); if (N == 1) { list.add(1); } else { int x = N; for (int i=2; i*i<=N; i++) { int cnt = 0; while (x%i==0) { cnt++; x/=i; } if (cnt!=0) { list.add(cnt); } } if (list.isEmpty()) { list.add(1); } } int tmp = 0; for (int i=0; i<list.size(); i++) { tmp ^= list.get(i); } if (tmp == 0) { System.out.println("Bob"); } else { System.out.println("Alice"); } sc.close(); } }