結果

問題 No.300 平方数
ユーザー tsuchinagatsuchinaga
提出日時 2019-03-13 15:50:06
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 10,270 ms
コンパイル使用メモリ 215,960 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-05 20:55:53
合計ジャッジ時間 12,004 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 14 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
4,380 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 12 ms
4,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 11 ms
4,376 KB
testcase_29 AC 9 ms
4,376 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 WA -
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 5 ms
4,376 KB
testcase_34 AC 13 ms
4,376 KB
testcase_35 AC 8 ms
4,376 KB
testcase_36 AC 4 ms
4,376 KB
testcase_37 AC 4 ms
4,376 KB
testcase_38 WA -
testcase_39 AC 1 ms
4,376 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 4 ms
4,376 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
)

func main() {
	var x int
	_, _ = fmt.Scan(&x)

	ans := 1
	i := 2
	for {
		if x%i == 0 {
			ans *= i
			x /= i
		} else {
			i++
		}

		if x == 1 || i*i > x {
			ans *= x
			break
		}
	}

	fmt.Println(ans)
}
0