結果

問題 No.300 平方数
ユーザー nobigomu
提出日時 2018-05-09 18:11:00
言語 Lua
(LuaJit 2.1.1734355927)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 7,200 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-28 02:49:26
合計ジャッジ時間 1,489 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 1 WA * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

print((function (n)
	local h,i,t,r = {},2,n,1
	while i^2<=n do
		if t%i==0 then if h[i]==nil then h[i]=0 end h[i],t=h[i]+1,t/i else i=i+1 end
	end
	if t~=1 then if h[t]==nil then h[t]=0 end h[t]=h[t]+1 end
	for k,v in pairs(h) do print(k,v) if v%2~=0 then r=r*k end end
	return r
end)(io.stdin:read("*n")))
0