結果

問題 No.593 4進FizzBuzz
ユーザー nobigomunobigomu
提出日時 2018-03-23 17:39:14
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 263 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 5,232 KB
実行使用メモリ 11,588 KB
最終ジャッジ日時 2023-09-07 02:49:47
合計ジャッジ時間 7,426 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 261 ms
11,544 KB
testcase_17 AC 260 ms
11,576 KB
testcase_18 AC 251 ms
11,544 KB
testcase_19 AC 252 ms
11,384 KB
testcase_20 AC 254 ms
11,160 KB
testcase_21 AC 257 ms
11,588 KB
testcase_22 AC 263 ms
11,416 KB
testcase_23 AC 251 ms
11,548 KB
testcase_24 AC 255 ms
11,456 KB
testcase_25 AC 253 ms
11,432 KB
testcase_26 AC 254 ms
11,232 KB
testcase_27 AC 256 ms
11,464 KB
testcase_28 AC 251 ms
11,504 KB
testcase_29 AC 258 ms
11,360 KB
testcase_30 AC 237 ms
9,092 KB
testcase_31 AC 237 ms
8,980 KB
testcase_32 AC 242 ms
9,092 KB
testcase_33 AC 229 ms
9,868 KB
testcase_34 AC 227 ms
9,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

print((function (f, s)
	return f(s)
end)(function (s)
	function mod15()
		local band, lshift = bit.band, bit.lshift
		local r, i = 0, #s
		s:gsub(".", function (e)
			e = tonumber(e)
			if band(i,1) == 0 then e = lshift(e,2) end
			r, i = r+e, i-1 end)
		return r%15
	end
	local n = mod15()
	return n == 0 and "FizzBuzz" or
		n%3 == 0 and "Fizz" or n%5 == 0 and "Buzz" or s
end, io.stdin:read("*l")))
0