結果

問題 No.300 平方数
ユーザー gu_21816943gu_21816943
提出日時 2017-06-27 01:43:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 76 ms / 1,000 ms
コード長 540 bytes
コンパイル時間 2,353 ms
コンパイル使用メモリ 73,484 KB
実行使用メモリ 38,472 KB
最終ジャッジ日時 2024-04-15 02:03:24
合計ジャッジ時間 5,971 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
37,152 KB
testcase_01 AC 52 ms
36,752 KB
testcase_02 AC 71 ms
38,320 KB
testcase_03 AC 53 ms
37,152 KB
testcase_04 AC 52 ms
37,576 KB
testcase_05 AC 52 ms
37,280 KB
testcase_06 AC 52 ms
37,248 KB
testcase_07 AC 52 ms
37,368 KB
testcase_08 AC 51 ms
37,048 KB
testcase_09 AC 53 ms
37,368 KB
testcase_10 AC 53 ms
37,208 KB
testcase_11 AC 53 ms
37,236 KB
testcase_12 AC 53 ms
37,368 KB
testcase_13 AC 74 ms
37,772 KB
testcase_14 AC 57 ms
37,296 KB
testcase_15 AC 71 ms
38,284 KB
testcase_16 AC 69 ms
37,900 KB
testcase_17 AC 76 ms
38,352 KB
testcase_18 AC 57 ms
37,152 KB
testcase_19 AC 67 ms
38,048 KB
testcase_20 AC 62 ms
37,536 KB
testcase_21 AC 73 ms
38,084 KB
testcase_22 AC 73 ms
38,144 KB
testcase_23 AC 73 ms
38,300 KB
testcase_24 AC 70 ms
38,128 KB
testcase_25 AC 72 ms
38,472 KB
testcase_26 AC 71 ms
38,272 KB
testcase_27 AC 70 ms
38,164 KB
testcase_28 AC 72 ms
38,176 KB
testcase_29 AC 74 ms
37,936 KB
testcase_30 AC 72 ms
38,296 KB
testcase_31 AC 73 ms
38,028 KB
testcase_32 AC 73 ms
38,068 KB
testcase_33 AC 69 ms
38,044 KB
testcase_34 AC 73 ms
38,384 KB
testcase_35 AC 70 ms
38,092 KB
testcase_36 AC 72 ms
38,092 KB
testcase_37 AC 72 ms
38,472 KB
testcase_38 AC 72 ms
38,044 KB
testcase_39 AC 70 ms
37,772 KB
testcase_40 AC 71 ms
38,300 KB
testcase_41 AC 66 ms
37,128 KB
testcase_42 AC 70 ms
38,316 KB
testcase_43 AC 73 ms
38,224 KB
testcase_44 AC 76 ms
38,316 KB
testcase_45 AC 67 ms
38,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		double num=Double.parseDouble(br.readLine());
		br.close();

		long y=1;

		double len=Math.sqrt(num);

		int i,tmp;

		for(i=2;i<=len;i++){
			tmp=0;

			while(num%i==0){
				num/=i;
				tmp++;
			}

			if(tmp%2!=0){
				y*=i;
			}
		}
		if(num>1){
			y*=num;
		}
		System.out.println(y);
	}
}
0