結果
| 問題 | No.1957 Xor Min |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-05 11:04:33 |
| 言語 | Lua (LuaJit 2.1.1787165859) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 89µs | |
| コード長 | 310 bytes |
| 記録 | |
| コンパイル時間 | 4 ms |
| コンパイル使用メモリ | 7,732 KB |
| 実行使用メモリ | 9,724 KB |
| 最終ジャッジ日時 | 2026-09-01 10:10:01 |
| 合計ジャッジ時間 | 1,450 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
local a, b = io.read("*n", "*n")
if b < a then a, b = b, a end
local c, d = 0, 0
z = a
while 0 < z do
c = c + 1
z = math.floor(z / 2)
end
z = b
while 0 < z do
d = d + 1
z = math.floor(z / 2)
end
if c < d then
print(a)
else
local mul = 1
for i = 1, c - 1 do mul = mul * 2 end
print(mul - 1)
end