結果
| 問題 |
No.73 helloworld
|
| コンテスト | |
| ユーザー |
nobigomu
|
| 提出日時 | 2018-05-09 17:11:01 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 634 bytes |
| コンパイル時間 | 124 ms |
| コンパイル使用メモリ | 5,120 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-30 06:41:10 |
| 合計ジャッジ時間 | 694 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
local ffi = require 'ffi'
local C = ffi.C
ffi.cdef 'int printf(const char *, ...);'
C.printf("%lu\n", (function (f, g, h)
local h,r={[4]={1,f},[5]={1,f},[8]={1,f},[12]={3,h},[15]={2,g},[18]={1,f},[23]={1,f}},1ULL
for i=1,26 do
local n=io.stdin:read("*n")
if h[i]~=nil then if n<h[i][1] then return 0ULL end r=r*h[i][2](n) end
end
return r
end)(function (n)
return n
end, function (n)
return n%2==0 and (n/2)^2 or math.floor(n/2)*(math.floor(n/2)+1)
end, function (n)
function f(n) return (n-1)*n/2 end
local r=f(n-1)
for i=n-2,2,-1 do
local t=f(i)*(n-i)
if t>r then r=t elseif r<t then break end
end
return r
end))
nobigomu