結果
問題 | No.1450 nahco314's First Problem |
ユーザー |
👑 |
提出日時 | 2021-06-08 22:52:29 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 662 bytes |
コンパイル時間 | 95 ms |
コンパイル使用メモリ | 5,376 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 14:29:31 |
合計ジャッジ時間 | 1,757 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
local ffi = require("ffi")local C = ffi.Cffi.cdef[[long long atoll(const char*);]]local function lltonumber(str)return C.atoll(str)endlocal x = io.read()x = lltonumber(x)for i = -300, 300 dolocal v = x + iif v <= 1LL then v = 1LL endlocal c = 0local tv = vfor j = 1, 60 doif tv % 2LL == 1LL then c = c + 1 endtv = tv / 2LLendlocal mul = 1LLlocal ret = 0LLtv = vfor j = 1, 60 doif tv % 2LL ~= c % 2LL thenret = ret + mulendtv = tv / 2LLc = c / 2LLmul = mul * 2LLendif ret == x thenlocal a = tostring(v):gsub("LL", "")print(a)os.exit()endendprint(-1)