結果
問題 | No.188 HAPPY DAY |
ユーザー |
![]() |
提出日時 | 2018-03-02 14:16:07 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 516 bytes |
コンパイル時間 | 835 ms |
コンパイル使用メモリ | 5,632 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-02 23:45:32 |
合計ジャッジ時間 | 1,264 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
local calc = (function ()local t = {}return function (n)if t[n] ~= nil thenreturn t[n]elselocal s = tostring(n)local r = tonumber(s:sub(1,1))if s:sub(2,2) ~= "" thenr = r + tonumber(s:sub(2,2))endt[n] = rreturn rendendend)()function count(m, d, r)if d > 0 thenreturn count(m, d-1, m == calc(d) and r+1 or r)endreturn rendlocal t = {31; 28; 31; 30; 31; 30; 31; 31; 30; 31; 30; 31}local r = 0for i,v in ipairs(t) dor = r + count(i, v, 0)endprint(r)