結果

問題 No.300 平方数
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-19 16:15:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 393 bytes
コンパイル時間 3,119 ms
コンパイル使用メモリ 71,560 KB
実行使用メモリ 56,196 KB
最終ジャッジ日時 2023-09-22 08:01:54
合計ジャッジ時間 10,891 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,636 KB
testcase_01 AC 119 ms
55,660 KB
testcase_02 AC 120 ms
55,752 KB
testcase_03 AC 122 ms
55,664 KB
testcase_04 AC 119 ms
55,660 KB
testcase_05 AC 122 ms
55,636 KB
testcase_06 AC 122 ms
55,360 KB
testcase_07 AC 118 ms
55,636 KB
testcase_08 AC 123 ms
53,980 KB
testcase_09 AC 122 ms
56,132 KB
testcase_10 AC 119 ms
55,636 KB
testcase_11 AC 120 ms
55,636 KB
testcase_12 AC 123 ms
55,728 KB
testcase_13 AC 136 ms
55,920 KB
testcase_14 AC 120 ms
55,896 KB
testcase_15 AC 122 ms
55,752 KB
testcase_16 AC 120 ms
55,656 KB
testcase_17 AC 120 ms
55,836 KB
testcase_18 AC 120 ms
55,684 KB
testcase_19 AC 120 ms
55,840 KB
testcase_20 AC 125 ms
55,316 KB
testcase_21 AC 120 ms
55,532 KB
testcase_22 AC 120 ms
55,896 KB
testcase_23 AC 126 ms
55,856 KB
testcase_24 AC 129 ms
55,672 KB
testcase_25 AC 132 ms
55,332 KB
testcase_26 AC 129 ms
55,664 KB
testcase_27 AC 128 ms
55,536 KB
testcase_28 AC 132 ms
55,764 KB
testcase_29 AC 134 ms
55,332 KB
testcase_30 AC 127 ms
55,640 KB
testcase_31 AC 126 ms
56,196 KB
testcase_32 AC 125 ms
55,640 KB
testcase_33 AC 132 ms
55,624 KB
testcase_34 AC 135 ms
55,648 KB
testcase_35 AC 133 ms
55,908 KB
testcase_36 AC 131 ms
55,760 KB
testcase_37 AC 128 ms
55,600 KB
testcase_38 AC 120 ms
55,572 KB
testcase_39 AC 122 ms
55,880 KB
testcase_40 AC 118 ms
55,892 KB
testcase_41 AC 129 ms
55,728 KB
testcase_42 AC 119 ms
55,552 KB
testcase_43 AC 120 ms
55,348 KB
testcase_44 AC 122 ms
55,760 KB
testcase_45 AC 120 ms
55,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No300 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		long y = 1;
		int cnt = 0;
		
		for(long i = 2;i * i <= x;i++) {
			while(x % i == 0) {
				x /= i;
				cnt++;
			}
			if(cnt % 2 != 0) {
				y *= i;
			}
			cnt = 0;
			if(x == 1) {
				break;
			}
		}
		System.out.println(x * y);
	}
}
0