結果
問題 | No.589 Counting Even |
ユーザー |
👑 |
提出日時 | 2022-06-26 21:02:40 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 262 ms |
コンパイル使用メモリ | 5,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 10:34:50 |
合計ジャッジ時間 | 1,312 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
local ffi = require("ffi")local C = ffi.Cffi.cdef[[long long atoll(const char*);]]local function lltonumber(str)return C.atoll(str)endlocal n = io.read()n = lltonumber(n)local z = nlocal mul = 1LLwhile 0LL < z doif z % 2LL == 1LL then mul = mul * 2LL endz = z / 2LLendlocal ans = n + 1 - mulans = tostring(ans):gsub("LL", "")print(ans)