結果

問題 No.300 平方数
ユーザー fjafjafjafjafjafja
提出日時 2017-09-20 00:45:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 1,000 ms
コード長 394 bytes
コンパイル時間 3,106 ms
コンパイル使用メモリ 74,696 KB
実行使用メモリ 54,552 KB
最終ジャッジ日時 2024-04-25 19:49:37
合計ジャッジ時間 9,812 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
54,108 KB
testcase_01 AC 119 ms
54,004 KB
testcase_02 AC 118 ms
53,992 KB
testcase_03 AC 118 ms
54,164 KB
testcase_04 AC 116 ms
53,904 KB
testcase_05 AC 116 ms
54,088 KB
testcase_06 AC 122 ms
54,016 KB
testcase_07 AC 123 ms
54,100 KB
testcase_08 AC 120 ms
54,036 KB
testcase_09 AC 107 ms
52,844 KB
testcase_10 AC 122 ms
54,000 KB
testcase_11 AC 115 ms
54,272 KB
testcase_12 AC 114 ms
54,100 KB
testcase_13 AC 134 ms
54,344 KB
testcase_14 AC 118 ms
54,248 KB
testcase_15 AC 121 ms
54,304 KB
testcase_16 AC 118 ms
53,764 KB
testcase_17 AC 109 ms
52,876 KB
testcase_18 AC 117 ms
54,148 KB
testcase_19 AC 125 ms
54,552 KB
testcase_20 AC 126 ms
54,068 KB
testcase_21 AC 120 ms
52,888 KB
testcase_22 AC 118 ms
54,240 KB
testcase_23 AC 107 ms
54,284 KB
testcase_24 AC 116 ms
53,676 KB
testcase_25 AC 132 ms
54,252 KB
testcase_26 AC 108 ms
53,052 KB
testcase_27 AC 120 ms
54,256 KB
testcase_28 AC 119 ms
53,244 KB
testcase_29 AC 125 ms
54,036 KB
testcase_30 AC 117 ms
53,204 KB
testcase_31 AC 107 ms
53,044 KB
testcase_32 AC 118 ms
53,904 KB
testcase_33 AC 121 ms
54,032 KB
testcase_34 AC 121 ms
53,016 KB
testcase_35 AC 117 ms
53,120 KB
testcase_36 AC 127 ms
54,524 KB
testcase_37 AC 125 ms
54,260 KB
testcase_38 AC 120 ms
54,000 KB
testcase_39 AC 118 ms
54,248 KB
testcase_40 AC 111 ms
53,664 KB
testcase_41 AC 124 ms
54,276 KB
testcase_42 AC 104 ms
53,048 KB
testcase_43 AC 119 ms
54,192 KB
testcase_44 AC 118 ms
53,988 KB
testcase_45 AC 107 ms
52,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class N300
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		long x=sc.nextLong();
		long ans=1;
		while(x!=1)
		{
			int br=0;
			for(int i=2;i<=(int)Math.sqrt(x);i++)
			{
				if(x%i==0){ans=(ans%i==0)?ans/i:ans*i;x/=i;br++;break;}
			}
			if(br==0){ans=(ans%x==0)?ans/x:ans*x;break;}

		}
		System.out.println(ans);
	}
}
0