結果

問題 No.1429 Simple Dowsing
ユーザー 👑 obakyanobakyan
提出日時 2021-05-17 14:22:15
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 24,396 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:34:12
合計ジャッジ時間 1,782 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
23,616 KB
testcase_01 AC 21 ms
23,616 KB
testcase_02 AC 21 ms
24,204 KB
testcase_03 AC 22 ms
24,384 KB
testcase_04 AC 22 ms
24,048 KB
testcase_05 AC 22 ms
24,024 KB
testcase_06 AC 21 ms
24,360 KB
testcase_07 AC 24 ms
23,832 KB
testcase_08 AC 22 ms
23,616 KB
testcase_09 AC 24 ms
24,396 KB
testcase_10 AC 23 ms
23,640 KB
testcase_11 AC 23 ms
24,348 KB
testcase_12 AC 23 ms
23,388 KB
testcase_13 AC 23 ms
24,012 KB
testcase_14 AC 23 ms
24,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local function query(str)
  io.write(str .. "\n")
  io.flush()
  local ret = io.read("*l")
  return ret
end

local d1 = query("? 0 0")
local d2 = query("? 0 100")
d1 = tonumber(d1)
d2 = tonumber(d2)
for i = 0, 100 do for j = 0, 100 do
  if i * i + j * j == d1 and i * i + (100 - j) * (100 - j) == d2 then
    io.write("! " .. i .. " " .. j .. "\n")
    io.flush()
    os.exit()
  end
end end
0