結果

問題 No.2379 Burnside's Theorem
ユーザー YTOKYTOK
提出日時 2023-07-14 22:32:43
言語 Julia
(1.10.2)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 244,852 KB
最終ジャッジ日時 2024-04-09 14:16:56
合計ジャッジ時間 7,593 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 266 ms
242,512 KB
testcase_01 AC 261 ms
241,944 KB
testcase_02 AC 263 ms
243,904 KB
testcase_03 AC 265 ms
244,852 KB
testcase_04 AC 262 ms
241,728 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 261 ms
241,312 KB
testcase_09 WA -
testcase_10 AC 262 ms
241,652 KB
testcase_11 AC 264 ms
242,572 KB
testcase_12 AC 262 ms
241,640 KB
testcase_13 AC 268 ms
242,956 KB
testcase_14 AC 270 ms
241,596 KB
testcase_15 AC 272 ms
242,036 KB
testcase_16 AC 264 ms
241,780 KB
testcase_17 AC 262 ms
242,220 KB
testcase_18 AC 266 ms
243,408 KB
testcase_19 AC 263 ms
242,004 KB
testcase_20 AC 266 ms
244,240 KB
testcase_21 AC 265 ms
242,288 KB
testcase_22 AC 261 ms
241,852 KB
testcase_23 AC 265 ms
243,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

toI(s=readline()) = parse(Int,s)
pYesNo(b) = ifelse(b,"Yes","No") |> println

function main()
	n = toI()
	solve(n) |> pYesNo
end

function solve(n)
	length(factor(n)) ≤ 2
end

function factor(n)
	xs = Pair{Int,Int}[]
	x = n
	for i in 2:isqrt(n)
		x % i == 0 || continue
		cnt = 0
		while x % i == 0
			cnt += 1
			x ÷= i
		end
		push!(xs,i=>cnt)
	end
	if isempty(xs)
		push!(xs,x=>1)
	end
	xs
end

main()
0