結果

問題 No.103 素因数ゲーム リターンズ
ユーザー GrenacheGrenache
提出日時 2016-05-19 19:51:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 700 bytes
コンパイル時間 3,529 ms
コンパイル使用メモリ 75,196 KB
実行使用メモリ 41,612 KB
最終ジャッジ日時 2024-04-16 01:24:24
合計ジャッジ時間 7,974 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
41,396 KB
testcase_01 AC 137 ms
41,356 KB
testcase_02 AC 138 ms
41,164 KB
testcase_03 AC 138 ms
41,264 KB
testcase_04 AC 134 ms
41,536 KB
testcase_05 AC 131 ms
41,112 KB
testcase_06 AC 132 ms
41,104 KB
testcase_07 AC 133 ms
41,356 KB
testcase_08 AC 133 ms
41,612 KB
testcase_09 AC 132 ms
41,196 KB
testcase_10 AC 136 ms
41,212 KB
testcase_11 AC 132 ms
41,320 KB
testcase_12 AC 137 ms
41,396 KB
testcase_13 AC 138 ms
41,296 KB
testcase_14 AC 139 ms
41,516 KB
testcase_15 AC 136 ms
41,532 KB
testcase_16 AC 128 ms
41,152 KB
testcase_17 AC 137 ms
41,588 KB
testcase_18 AC 134 ms
41,360 KB
testcase_19 AC 137 ms
41,284 KB
testcase_20 AC 130 ms
41,184 KB
testcase_21 AC 137 ms
41,336 KB
testcase_22 AC 134 ms
41,284 KB
testcase_23 AC 135 ms
41,352 KB
testcase_24 AC 139 ms
41,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;


public class Main_yukicoder103 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int ret = 0;
        for (int i = 0; i < n; i++) {
        	int m = sc.nextInt();
        	int tmp = m;
        	for (int j = 2; j * j <= m; j++) {
        		int cnt = 0;
        		while (tmp % j == 0) {
        			cnt++;
        			tmp /= j;
        		}

        		ret ^= cnt % 3;
        	}
        	if (tmp != 1) {
        		ret ^= 1;
        	}
        }

        if (ret != 0) {
        	System.out.println("Alice");
        } else {
        	System.out.println("Bob");
        }

        sc.close();
    }
}
0