結果

問題 No.300 平方数
ユーザー fjafjafjafjafjafja
提出日時 2017-09-20 00:32:01
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 311 bytes
コンパイル時間 3,410 ms
コンパイル使用メモリ 75,376 KB
実行使用メモリ 61,460 KB
最終ジャッジ日時 2024-04-25 18:21:37
合計ジャッジ時間 9,029 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
61,208 KB
testcase_01 AC 129 ms
54,296 KB
testcase_02 AC 130 ms
54,156 KB
testcase_03 AC 128 ms
54,208 KB
testcase_04 AC 129 ms
53,864 KB
testcase_05 AC 129 ms
53,880 KB
testcase_06 AC 128 ms
54,132 KB
testcase_07 AC 130 ms
54,004 KB
testcase_08 AC 129 ms
54,016 KB
testcase_09 AC 132 ms
54,220 KB
testcase_10 AC 128 ms
54,040 KB
testcase_11 AC 127 ms
54,132 KB
testcase_12 AC 128 ms
54,300 KB
testcase_13 AC 158 ms
54,048 KB
testcase_14 AC 130 ms
54,104 KB
testcase_15 AC 132 ms
54,124 KB
testcase_16 AC 130 ms
54,240 KB
testcase_17 AC 130 ms
54,212 KB
testcase_18 AC 128 ms
54,228 KB
testcase_19 AC 115 ms
52,816 KB
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

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)
		{
			for(int i=2;i<=x;i++)
			{
				if(x%i==0){ans=(ans%i==0)?ans/i:ans*i;x/=i;break;}
			}
		}
		System.out.println(ans);
	}
}
0