結果
| 問題 | No.589 Counting Even |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-26 21:02:40 |
| 言語 | Lua (LuaJit 2.1.1774638290) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 362 bytes |
| 記録 | |
| コンパイル時間 | 199 ms |
| コンパイル使用メモリ | 6,528 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-12 08:27:23 |
| 合計ジャッジ時間 | 1,232 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
ソースコード
local ffi = require("ffi")
local C = ffi.C
ffi.cdef[[
long long atoll(const char*);
]]
local function lltonumber(str)
return C.atoll(str)
end
local n = io.read()
n = lltonumber(n)
local z = n
local mul = 1LL
while 0LL < z do
if z % 2LL == 1LL then mul = mul * 2LL end
z = z / 2LL
end
local ans = n + 1 - mul
ans = tostring(ans):gsub("LL", "")
print(ans)