結果

問題 No.1429 Simple Dowsing
ユーザー maguroflymagurofly
提出日時 2021-03-14 14:22:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 273 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 11,572 KB
実行使用メモリ 31,360 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:03:15
合計ジャッジ時間 2,654 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
31,352 KB
testcase_01 AC 98 ms
31,224 KB
testcase_02 AC 96 ms
31,100 KB
testcase_03 AC 97 ms
31,192 KB
testcase_04 AC 98 ms
30,788 KB
testcase_05 AC 100 ms
30,880 KB
testcase_06 AC 96 ms
31,060 KB
testcase_07 AC 100 ms
30,884 KB
testcase_08 AC 97 ms
30,812 KB
testcase_09 AC 97 ms
30,816 KB
testcase_10 AC 98 ms
31,360 KB
testcase_11 AC 100 ms
30,596 KB
testcase_12 AC 100 ms
31,084 KB
testcase_13 AC 99 ms
30,860 KB
testcase_14 AC 97 ms
31,304 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

STDIN.sync = true
STDOUT.sync = true

puts "? 0 0"
d1 = gets.to_i

puts "? 0 100"
d2 = gets.to_i

(0 .. 100).each do |x|
    (0 .. 100).each do |y|
        next unless x**2 + y**2 == d1 and x**2 + (y - 100)**2 == d2
        puts "! %d %d" % [x, y]
        exit
    end
end
0