結果

問題 No.300 平方数
ユーザー prime_mgmprime_mgm
提出日時 2016-03-08 15:52:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 1,000 ms
コード長 298 bytes
コンパイル時間 2,192 ms
コンパイル使用メモリ 78,588 KB
実行使用メモリ 57,724 KB
最終ジャッジ日時 2023-10-24 19:44:02
合計ジャッジ時間 9,224 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
57,324 KB
testcase_01 AC 116 ms
56,232 KB
testcase_02 AC 126 ms
57,188 KB
testcase_03 AC 127 ms
57,312 KB
testcase_04 AC 127 ms
57,212 KB
testcase_05 AC 126 ms
57,184 KB
testcase_06 AC 129 ms
57,272 KB
testcase_07 AC 127 ms
57,520 KB
testcase_08 AC 126 ms
57,152 KB
testcase_09 AC 131 ms
57,272 KB
testcase_10 AC 127 ms
57,372 KB
testcase_11 AC 128 ms
57,440 KB
testcase_12 AC 128 ms
57,376 KB
testcase_13 AC 138 ms
57,404 KB
testcase_14 AC 126 ms
57,352 KB
testcase_15 AC 116 ms
56,220 KB
testcase_16 AC 133 ms
57,376 KB
testcase_17 AC 118 ms
56,308 KB
testcase_18 AC 132 ms
57,496 KB
testcase_19 AC 129 ms
57,364 KB
testcase_20 AC 134 ms
57,520 KB
testcase_21 AC 139 ms
57,664 KB
testcase_22 AC 135 ms
57,556 KB
testcase_23 AC 120 ms
56,344 KB
testcase_24 AC 132 ms
57,524 KB
testcase_25 AC 138 ms
57,632 KB
testcase_26 AC 135 ms
57,528 KB
testcase_27 AC 132 ms
57,412 KB
testcase_28 AC 137 ms
57,528 KB
testcase_29 AC 136 ms
57,428 KB
testcase_30 AC 135 ms
57,516 KB
testcase_31 AC 117 ms
56,308 KB
testcase_32 AC 135 ms
57,464 KB
testcase_33 AC 135 ms
57,528 KB
testcase_34 AC 139 ms
57,160 KB
testcase_35 AC 137 ms
57,404 KB
testcase_36 AC 125 ms
56,312 KB
testcase_37 AC 135 ms
57,152 KB
testcase_38 AC 127 ms
57,184 KB
testcase_39 AC 139 ms
57,580 KB
testcase_40 AC 139 ms
57,552 KB
testcase_41 AC 132 ms
57,532 KB
testcase_42 AC 131 ms
55,612 KB
testcase_43 AC 136 ms
57,724 KB
testcase_44 AC 124 ms
56,308 KB
testcase_45 AC 135 ms
57,604 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