結果

問題 No.1429 Simple Dowsing
ユーザー maimai
提出日時 2021-03-14 14:06:00
言語 Ruby
(3.2.2)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 11,524 KB
実行使用メモリ 31,552 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:00:09
合計ジャッジ時間 3,256 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
31,000 KB
testcase_01 AC 109 ms
30,848 KB
testcase_02 AC 106 ms
31,552 KB
testcase_03 AC 111 ms
31,100 KB
testcase_04 AC 111 ms
30,768 KB
testcase_05 AC 108 ms
31,132 KB
testcase_06 AC 110 ms
31,044 KB
testcase_07 AC 110 ms
31,160 KB
testcase_08 AC 108 ms
31,124 KB
testcase_09 AC 109 ms
31,076 KB
testcase_10 AC 107 ms
31,240 KB
testcase_11 AC 108 ms
30,940 KB
testcase_12 AC 107 ms
30,860 KB
testcase_13 AC 108 ms
30,964 KB
testcase_14 AC 107 ms
30,864 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

puts "? 0 0"
STDOUT.flush
d1 = gets.to_f
puts "? 0 100"
STDOUT.flush
d2 = gets.to_i

(0..100).each do |x|
  (0..100).each do |y|
    v1 = x**2+y**2
    v2 = x**2+(100-y)**2
    if d1 == v1 && d2 == v2
      puts "! #{x} #{y}"
      STDOUT.flush
      exit
    end
  end
end
0