結果
| 問題 |
No.492 IOI数列
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2020-04-22 12:58:49 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 984 bytes |
| コンパイル時間 | 98 ms |
| コンパイル使用メモリ | 6,820 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-11 04:47:55 |
| 合計ジャッジ時間 | 995 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 1 |
ソースコード
local mod = 1000000007
local mfl = math.floor
local function bmul(x, y)
local x1, y1 = mfl(x / 31623), mfl(y / 31623)
local x0, y0 = x - x1 * 31623, y - y1 * 31623
return (x1 * y1 * 14122 + (x1 * y0 + x0 * y1) * 31623 + x0 * y0) % mod
end
local function modpow(src, pow)
local res = 1
while 0LL < pow do
if pow % 2LL == 1LL then
res = bmul(res, src)
pow = pow - 1LL
end
src = bmul(src, src)
pow = pow / 2LL
end
return res
end
local function modinv(src)
return modpow(src, mod - 2LL)
end
local function lltonumber(str)
local ret = 0LL
for i = 1, #str do
ret = ret * 10LL + str:sub(i, i):byte() - 48
end
return ret
end
local n = lltonumber(io.read())
local function solve2()
local z = n % 11LL
z = tostring(z):gsub("LL", "")
z = tonumber(z)
for i = 2, z do
io.write("10")
end
io.write("1\n")
end
local function solve1()
local r = modpow(100, n)
r = bmul(modinv(99), r - 1)
print(r)
end
solve1()
solve2()