結果

問題 No.300 平方数
ユーザー prime_mgmprime_mgm
提出日時 2016-03-08 15:50:51
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 295 bytes
コンパイル時間 2,228 ms
コンパイル使用メモリ 76,924 KB
実行使用メモリ 57,696 KB
最終ジャッジ日時 2023-10-24 19:43:42
合計ジャッジ時間 9,264 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
57,288 KB
testcase_01 AC 123 ms
57,188 KB
testcase_02 AC 123 ms
57,368 KB
testcase_03 AC 126 ms
57,040 KB
testcase_04 AC 120 ms
57,124 KB
testcase_05 AC 124 ms
57,456 KB
testcase_06 AC 117 ms
57,268 KB
testcase_07 AC 118 ms
57,300 KB
testcase_08 AC 121 ms
57,424 KB
testcase_09 AC 118 ms
57,456 KB
testcase_10 AC 108 ms
56,152 KB
testcase_11 AC 117 ms
57,392 KB
testcase_12 AC 109 ms
56,232 KB
testcase_13 AC 118 ms
56,272 KB
testcase_14 AC 119 ms
57,492 KB
testcase_15 WA -
testcase_16 AC 126 ms
57,460 KB
testcase_17 AC 121 ms
57,464 KB
testcase_18 AC 117 ms
57,420 KB
testcase_19 AC 116 ms
57,424 KB
testcase_20 AC 120 ms
57,156 KB
testcase_21 AC 125 ms
57,640 KB
testcase_22 AC 126 ms
57,420 KB
testcase_23 AC 119 ms
56,300 KB
testcase_24 AC 126 ms
57,336 KB
testcase_25 AC 129 ms
57,696 KB
testcase_26 AC 124 ms
57,476 KB
testcase_27 AC 113 ms
56,296 KB
testcase_28 AC 127 ms
57,424 KB
testcase_29 AC 126 ms
57,412 KB
testcase_30 AC 117 ms
56,316 KB
testcase_31 AC 121 ms
57,172 KB
testcase_32 AC 126 ms
57,672 KB
testcase_33 AC 110 ms
55,828 KB
testcase_34 AC 116 ms
56,292 KB
testcase_35 AC 126 ms
57,132 KB
testcase_36 AC 125 ms
57,188 KB
testcase_37 AC 123 ms
56,168 KB
testcase_38 AC 118 ms
56,220 KB
testcase_39 AC 126 ms
57,576 KB
testcase_40 AC 125 ms
57,420 KB
testcase_41 AC 115 ms
56,332 KB
testcase_42 AC 122 ms
57,252 KB
testcase_43 AC 124 ms
57,276 KB
testcase_44 AC 128 ms
57,460 KB
testcase_45 AC 127 ms
57,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

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

		while(x%4==0) x=x/4;

		for(long i=3; i*i<x; i += 2){
			while(x%(i*i) == 0) x=x/(i*i);
		}

		System.out.println(x);

	}
}
0