結果

問題 No.300 平方数
ユーザー YamaKasaYamaKasa
提出日時 2018-09-10 00:18:23
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 414 bytes
コンパイル時間 2,019 ms
コンパイル使用メモリ 71,784 KB
実行使用メモリ 56,344 KB
最終ジャッジ日時 2023-08-26 05:17:34
合計ジャッジ時間 10,219 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,112 KB
testcase_01 AC 123 ms
56,156 KB
testcase_02 AC 124 ms
55,856 KB
testcase_03 AC 123 ms
55,964 KB
testcase_04 AC 123 ms
56,344 KB
testcase_05 AC 120 ms
55,496 KB
testcase_06 AC 127 ms
55,856 KB
testcase_07 AC 123 ms
55,644 KB
testcase_08 AC 121 ms
55,536 KB
testcase_09 AC 124 ms
55,496 KB
testcase_10 AC 122 ms
55,980 KB
testcase_11 AC 123 ms
55,772 KB
testcase_12 WA -
testcase_13 AC 140 ms
55,884 KB
testcase_14 WA -
testcase_15 AC 122 ms
56,004 KB
testcase_16 AC 131 ms
56,004 KB
testcase_17 AC 123 ms
55,916 KB
testcase_18 AC 125 ms
56,072 KB
testcase_19 AC 122 ms
55,740 KB
testcase_20 AC 131 ms
55,792 KB
testcase_21 AC 131 ms
56,204 KB
testcase_22 AC 129 ms
55,760 KB
testcase_23 WA -
testcase_24 AC 130 ms
55,788 KB
testcase_25 AC 137 ms
55,540 KB
testcase_26 AC 132 ms
55,944 KB
testcase_27 AC 139 ms
55,780 KB
testcase_28 AC 135 ms
55,880 KB
testcase_29 AC 137 ms
55,892 KB
testcase_30 AC 138 ms
56,192 KB
testcase_31 AC 126 ms
55,844 KB
testcase_32 AC 132 ms
55,860 KB
testcase_33 AC 132 ms
55,744 KB
testcase_34 AC 137 ms
55,956 KB
testcase_35 AC 134 ms
55,756 KB
testcase_36 AC 135 ms
55,988 KB
testcase_37 AC 134 ms
55,864 KB
testcase_38 WA -
testcase_39 AC 137 ms
55,712 KB
testcase_40 AC 133 ms
55,852 KB
testcase_41 AC 131 ms
56,116 KB
testcase_42 AC 130 ms
55,728 KB
testcase_43 WA -
testcase_44 AC 136 ms
56,156 KB
testcase_45 AC 134 ms
56,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long X = scan.nextLong();
		scan.close();
		long x = (long)Math.sqrt(X);
		if(x * x == X) {
			System.out.println(1);
		}else {
			long y = 4;
			long k = 2;
			while(y < X) {
				if(X % y == 0) {
					X = X / y;
				}
				k++;
				y = k * k;
			}
			System.out.println(X);
		}
	}
}
0