結果

問題 No.300 平方数
ユーザー YamaKasaYamaKasa
提出日時 2018-09-10 00:26:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 1,000 ms
コード長 448 bytes
コンパイル時間 1,941 ms
コンパイル使用メモリ 71,540 KB
実行使用メモリ 57,516 KB
最終ジャッジ日時 2023-08-26 05:18:03
合計ジャッジ時間 9,752 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,056 KB
testcase_01 AC 123 ms
56,036 KB
testcase_02 AC 125 ms
55,944 KB
testcase_03 AC 122 ms
55,764 KB
testcase_04 AC 124 ms
56,052 KB
testcase_05 AC 122 ms
55,816 KB
testcase_06 AC 124 ms
55,828 KB
testcase_07 AC 123 ms
55,856 KB
testcase_08 AC 123 ms
55,512 KB
testcase_09 AC 123 ms
55,776 KB
testcase_10 AC 124 ms
56,264 KB
testcase_11 AC 124 ms
55,888 KB
testcase_12 AC 123 ms
55,812 KB
testcase_13 AC 138 ms
57,516 KB
testcase_14 AC 125 ms
55,792 KB
testcase_15 AC 124 ms
55,872 KB
testcase_16 AC 133 ms
56,036 KB
testcase_17 AC 125 ms
55,516 KB
testcase_18 AC 124 ms
55,860 KB
testcase_19 AC 126 ms
55,640 KB
testcase_20 AC 128 ms
56,188 KB
testcase_21 AC 135 ms
55,500 KB
testcase_22 AC 129 ms
56,084 KB
testcase_23 AC 129 ms
55,600 KB
testcase_24 AC 131 ms
55,860 KB
testcase_25 AC 134 ms
56,128 KB
testcase_26 AC 132 ms
55,808 KB
testcase_27 AC 127 ms
56,212 KB
testcase_28 AC 135 ms
55,544 KB
testcase_29 AC 139 ms
55,928 KB
testcase_30 AC 139 ms
56,152 KB
testcase_31 AC 127 ms
56,144 KB
testcase_32 AC 135 ms
55,900 KB
testcase_33 AC 131 ms
55,508 KB
testcase_34 AC 139 ms
55,780 KB
testcase_35 AC 135 ms
55,792 KB
testcase_36 AC 137 ms
56,044 KB
testcase_37 AC 134 ms
55,948 KB
testcase_38 AC 130 ms
55,828 KB
testcase_39 AC 138 ms
56,068 KB
testcase_40 AC 135 ms
55,508 KB
testcase_41 AC 133 ms
55,548 KB
testcase_42 AC 131 ms
55,996 KB
testcase_43 AC 131 ms
55,908 KB
testcase_44 AC 136 ms
56,108 KB
testcase_45 AC 132 ms
56,136 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) {
					while(X % y == 0) {
						X = X / y;
					}
				}
				k++;
				y = k * k;
			}
			System.out.println(X);
		}
	}
}
0