結果

問題 No.2379 Burnside's Theorem
ユーザー YTOKYTOK
提出日時 2023-07-14 22:36:43
言語 Julia
(1.10.2)
結果
AC  
実行時間 273 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 244,400 KB
最終ジャッジ日時 2024-04-09 14:17:37
合計ジャッジ時間 7,970 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 265 ms
244,096 KB
testcase_01 AC 265 ms
242,772 KB
testcase_02 AC 266 ms
242,032 KB
testcase_03 AC 267 ms
243,752 KB
testcase_04 AC 266 ms
243,896 KB
testcase_05 AC 263 ms
244,400 KB
testcase_06 AC 263 ms
243,036 KB
testcase_07 AC 265 ms
241,668 KB
testcase_08 AC 264 ms
241,740 KB
testcase_09 AC 263 ms
243,400 KB
testcase_10 AC 265 ms
242,948 KB
testcase_11 AC 272 ms
242,244 KB
testcase_12 AC 265 ms
242,008 KB
testcase_13 AC 271 ms
242,408 KB
testcase_14 AC 271 ms
242,548 KB
testcase_15 AC 273 ms
242,076 KB
testcase_16 AC 270 ms
241,880 KB
testcase_17 AC 266 ms
242,920 KB
testcase_18 AC 271 ms
242,276 KB
testcase_19 AC 268 ms
241,756 KB
testcase_20 AC 269 ms
242,892 KB
testcase_21 AC 270 ms
241,984 KB
testcase_22 AC 265 ms
244,388 KB
testcase_23 AC 270 ms
241,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

toI(s=readline()) = parse(Int,s)
toVI(s=readline()) = toI.(split(s))
rep(f,n) = [f() for _ in 1:n]
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}[]
	n == 1 && return xs
	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 x > 1
		push!(xs,x=>1)
	end
	xs
end

main()
0