結果

問題 No.300 平方数
ユーザー ぴろずぴろず
提出日時 2015-11-13 23:29:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 1,000 ms
コード長 396 bytes
コンパイル時間 2,724 ms
コンパイル使用メモリ 71,368 KB
実行使用メモリ 56,172 KB
最終ジャッジ日時 2023-10-11 16:49:21
合計ジャッジ時間 9,986 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,760 KB
testcase_01 AC 125 ms
55,876 KB
testcase_02 AC 139 ms
55,780 KB
testcase_03 AC 124 ms
55,752 KB
testcase_04 AC 124 ms
55,596 KB
testcase_05 AC 125 ms
56,000 KB
testcase_06 AC 125 ms
55,968 KB
testcase_07 AC 126 ms
55,828 KB
testcase_08 AC 124 ms
56,000 KB
testcase_09 AC 126 ms
55,772 KB
testcase_10 AC 124 ms
55,560 KB
testcase_11 AC 126 ms
55,436 KB
testcase_12 AC 125 ms
55,820 KB
testcase_13 AC 143 ms
55,776 KB
testcase_14 AC 130 ms
55,972 KB
testcase_15 AC 136 ms
55,676 KB
testcase_16 AC 136 ms
55,944 KB
testcase_17 AC 142 ms
55,416 KB
testcase_18 AC 130 ms
55,920 KB
testcase_19 AC 133 ms
55,612 KB
testcase_20 AC 131 ms
55,720 KB
testcase_21 AC 141 ms
55,532 KB
testcase_22 AC 140 ms
55,620 KB
testcase_23 AC 140 ms
55,952 KB
testcase_24 AC 136 ms
55,720 KB
testcase_25 AC 141 ms
55,796 KB
testcase_26 AC 139 ms
56,172 KB
testcase_27 AC 138 ms
55,620 KB
testcase_28 AC 139 ms
55,952 KB
testcase_29 AC 141 ms
55,828 KB
testcase_30 AC 143 ms
55,620 KB
testcase_31 AC 142 ms
55,944 KB
testcase_32 AC 137 ms
56,104 KB
testcase_33 AC 135 ms
55,944 KB
testcase_34 AC 140 ms
56,032 KB
testcase_35 AC 140 ms
55,840 KB
testcase_36 AC 139 ms
55,716 KB
testcase_37 AC 139 ms
55,392 KB
testcase_38 AC 139 ms
55,672 KB
testcase_39 AC 139 ms
55,636 KB
testcase_40 AC 137 ms
55,796 KB
testcase_41 AC 137 ms
55,608 KB
testcase_42 AC 137 ms
55,596 KB
testcase_43 AC 142 ms
55,772 KB
testcase_44 AC 138 ms
55,720 KB
testcase_45 AC 135 ms
55,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no300;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		long x_ = x;
		long y = 1;
		for(long i=2;i*i<=x_;i++) {
			int a = 0;
			while(x % i == 0) {
				x /= i;
				a++;
			}
			if (a % 2 == 1) {
				y *= i;
			}
		}
		if (x > 1) {
			y *= x;
		}
		System.out.println(y);
	}

}
0