結果

問題 No.300 平方数
ユーザー rf141rf141
提出日時 2015-12-03 17:51:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 489 bytes
コンパイル時間 3,183 ms
コンパイル使用メモリ 72,264 KB
実行使用メモリ 56,516 KB
最終ジャッジ日時 2023-10-12 09:31:58
合計ジャッジ時間 11,499 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,588 KB
testcase_01 AC 124 ms
55,764 KB
testcase_02 AC 123 ms
55,328 KB
testcase_03 AC 122 ms
55,932 KB
testcase_04 AC 135 ms
55,740 KB
testcase_05 AC 125 ms
55,736 KB
testcase_06 AC 126 ms
55,988 KB
testcase_07 AC 124 ms
55,736 KB
testcase_08 AC 125 ms
55,864 KB
testcase_09 AC 123 ms
55,856 KB
testcase_10 AC 124 ms
55,424 KB
testcase_11 AC 122 ms
55,920 KB
testcase_12 AC 123 ms
55,328 KB
testcase_13 AC 141 ms
55,796 KB
testcase_14 AC 124 ms
56,388 KB
testcase_15 AC 121 ms
55,576 KB
testcase_16 AC 122 ms
55,940 KB
testcase_17 AC 122 ms
55,424 KB
testcase_18 AC 125 ms
55,416 KB
testcase_19 AC 122 ms
55,968 KB
testcase_20 AC 126 ms
55,720 KB
testcase_21 AC 124 ms
55,536 KB
testcase_22 AC 121 ms
56,276 KB
testcase_23 AC 126 ms
55,712 KB
testcase_24 AC 130 ms
55,900 KB
testcase_25 AC 136 ms
56,068 KB
testcase_26 AC 128 ms
55,504 KB
testcase_27 AC 130 ms
55,756 KB
testcase_28 AC 136 ms
56,084 KB
testcase_29 AC 132 ms
56,064 KB
testcase_30 AC 123 ms
55,928 KB
testcase_31 AC 126 ms
55,540 KB
testcase_32 AC 129 ms
56,076 KB
testcase_33 AC 127 ms
56,300 KB
testcase_34 AC 133 ms
55,792 KB
testcase_35 AC 130 ms
55,848 KB
testcase_36 AC 130 ms
55,932 KB
testcase_37 AC 132 ms
55,736 KB
testcase_38 AC 122 ms
56,248 KB
testcase_39 AC 122 ms
56,196 KB
testcase_40 AC 123 ms
55,840 KB
testcase_41 AC 128 ms
56,516 KB
testcase_42 AC 121 ms
55,844 KB
testcase_43 AC 123 ms
56,108 KB
testcase_44 AC 125 ms
56,000 KB
testcase_45 AC 126 ms
55,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Sqrt{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		long X = scan.nextLong();
                System.out.println(makeAns(X));
	}

	public static long makeAns(long number){
		long res = number;
		long answer = 1;
		for(long i = 2; i*i <= res; i++){
			int count = 0;
			while(res%i == 0){
				res /= i;
				count++;
			}

			if(count%2 != 0)answer *= i;
		}

		if(res > 1){
			answer *= res;
		}

		return answer;
	}
}
0