結果

問題 No.300 平方数
ユーザー scachescache
提出日時 2015-11-13 22:27:06
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 613 bytes
コンパイル時間 4,637 ms
コンパイル使用メモリ 72,184 KB
実行使用メモリ 57,672 KB
最終ジャッジ日時 2023-10-11 15:52:58
合計ジャッジ時間 14,291 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 167 ms
53,964 KB
testcase_01 AC 170 ms
55,612 KB
testcase_02 AC 168 ms
56,012 KB
testcase_03 AC 169 ms
55,820 KB
testcase_04 AC 168 ms
55,548 KB
testcase_05 AC 169 ms
55,640 KB
testcase_06 AC 168 ms
53,932 KB
testcase_07 AC 169 ms
55,904 KB
testcase_08 AC 168 ms
55,880 KB
testcase_09 AC 168 ms
55,888 KB
testcase_10 AC 167 ms
55,692 KB
testcase_11 AC 167 ms
55,892 KB
testcase_12 AC 166 ms
55,808 KB
testcase_13 AC 170 ms
55,936 KB
testcase_14 AC 167 ms
56,124 KB
testcase_15 AC 166 ms
55,896 KB
testcase_16 AC 166 ms
55,644 KB
testcase_17 AC 166 ms
55,644 KB
testcase_18 AC 168 ms
56,088 KB
testcase_19 AC 164 ms
55,796 KB
testcase_20 WA -
testcase_21 AC 164 ms
56,064 KB
testcase_22 AC 166 ms
55,996 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 167 ms
56,012 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 171 ms
55,744 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Scanner;

public class Main299 {
    public static void main(String[] args) {
        new Main299();
    }

    public Main299() {
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong();
        System.out.println(solve(x));
    }

    public long solve(long x) {
        long res = 1;
        for (long i = 2; i * i < (10e+12) + 1; i++) {
            int count = 0;
            while (x % i == 0) {
                x /= i;
                count++;
            }

            res *= count % 2 == 1 ? i : 1;
        }

        return res;

    }
}
0