結果

問題 No.300 平方数
ユーザー ぴろずぴろず
提出日時 2015-11-13 23:16:17
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 347 bytes
コンパイル時間 2,063 ms
コンパイル使用メモリ 71,840 KB
実行使用メモリ 60,140 KB
最終ジャッジ日時 2023-10-11 16:32:49
合計ジャッジ時間 7,856 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
60,140 KB
testcase_01 AC 126 ms
55,904 KB
testcase_02 AC 125 ms
55,676 KB
testcase_03 AC 125 ms
55,972 KB
testcase_04 AC 127 ms
55,804 KB
testcase_05 AC 125 ms
55,984 KB
testcase_06 AC 125 ms
55,608 KB
testcase_07 AC 127 ms
55,596 KB
testcase_08 AC 128 ms
55,840 KB
testcase_09 AC 126 ms
55,452 KB
testcase_10 AC 126 ms
55,444 KB
testcase_11 AC 127 ms
55,728 KB
testcase_12 AC 125 ms
55,576 KB
testcase_13 AC 142 ms
55,736 KB
testcase_14 AC 125 ms
55,540 KB
testcase_15 AC 125 ms
55,736 KB
testcase_16 AC 126 ms
55,376 KB
testcase_17 AC 125 ms
55,460 KB
testcase_18 AC 126 ms
55,708 KB
testcase_19 AC 125 ms
55,712 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 #

package no300;

import java.util.Scanner;

public class Main {

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

}
0