結果

問題 No.300 平方数
ユーザー GrenacheGrenache
提出日時 2015-11-13 22:27:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 497 bytes
コンパイル時間 4,456 ms
コンパイル使用メモリ 71,820 KB
実行使用メモリ 56,468 KB
最終ジャッジ日時 2023-10-11 15:53:43
合計ジャッジ時間 10,858 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
56,060 KB
testcase_01 AC 123 ms
55,812 KB
testcase_02 AC 123 ms
55,552 KB
testcase_03 AC 123 ms
55,884 KB
testcase_04 AC 123 ms
55,976 KB
testcase_05 AC 124 ms
56,172 KB
testcase_06 AC 125 ms
56,468 KB
testcase_07 AC 126 ms
55,944 KB
testcase_08 AC 123 ms
55,716 KB
testcase_09 AC 124 ms
55,856 KB
testcase_10 AC 124 ms
55,764 KB
testcase_11 AC 125 ms
55,584 KB
testcase_12 AC 127 ms
56,140 KB
testcase_13 AC 141 ms
55,892 KB
testcase_14 AC 124 ms
56,088 KB
testcase_15 AC 123 ms
55,832 KB
testcase_16 AC 123 ms
56,040 KB
testcase_17 AC 124 ms
55,816 KB
testcase_18 AC 124 ms
55,484 KB
testcase_19 AC 125 ms
56,132 KB
testcase_20 AC 125 ms
55,784 KB
testcase_21 AC 124 ms
56,404 KB
testcase_22 AC 124 ms
56,056 KB
testcase_23 AC 130 ms
55,832 KB
testcase_24 AC 133 ms
55,956 KB
testcase_25 AC 140 ms
55,984 KB
testcase_26 AC 134 ms
55,796 KB
testcase_27 AC 131 ms
56,104 KB
testcase_28 AC 139 ms
55,620 KB
testcase_29 AC 137 ms
55,816 KB
testcase_30 AC 127 ms
55,808 KB
testcase_31 AC 130 ms
55,676 KB
testcase_32 AC 128 ms
55,760 KB
testcase_33 AC 134 ms
55,480 KB
testcase_34 AC 140 ms
55,764 KB
testcase_35 AC 135 ms
55,784 KB
testcase_36 AC 132 ms
55,956 KB
testcase_37 AC 132 ms
55,800 KB
testcase_38 AC 125 ms
55,704 KB
testcase_39 AC 125 ms
55,912 KB
testcase_40 AC 125 ms
55,772 KB
testcase_41 AC 133 ms
55,756 KB
testcase_42 AC 125 ms
55,732 KB
testcase_43 AC 126 ms
56,076 KB
testcase_44 AC 127 ms
55,748 KB
testcase_45 AC 124 ms
55,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder300 {

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

        long x = sc.nextLong();

        long ret = 1;
        for (long i = 2; i * i <= x; i++) {
        	int tmp = 0;
        	while (x % i == 0) {
        		tmp++;
        		x /= i;
        	}
        	
        	if (tmp % 2 == 1) {
        		ret *= i;
        	}
        }

        System.out.println(ret * x);

        sc.close();
    }
}
0