結果
| 問題 |
No.1429 Simple Dowsing
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2021-05-17 14:22:15 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 2,000 ms |
| コード長 | 392 bytes |
| コンパイル時間 | 271 ms |
| コンパイル使用メモリ | 6,684 KB |
| 実行使用メモリ | 25,220 KB |
| 平均クエリ数 | 3.00 |
| 最終ジャッジ日時 | 2024-07-17 11:24:38 |
| 合計ジャッジ時間 | 1,965 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
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