結果
| 問題 | No.300 平方数 |
| コンテスト | |
| ユーザー |
nobigomu
|
| 提出日時 | 2018-05-09 18:13:17 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 1,000 ms |
| コード長 | 295 bytes |
| コンパイル時間 | 34 ms |
| コンパイル使用メモリ | 6,684 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-28 02:49:28 |
| 合計ジャッジ時間 | 1,344 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
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 if v%2~=0 then r=r*k end end
return r
end)(io.stdin:read("*n")))
nobigomu