結果

問題 No.2252 Find Zero
ユーザー maguroflymagurofly
提出日時 2023-03-24 21:26:33
言語 Ruby
(3.3.0)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 511 ms
コンパイル使用メモリ 11,860 KB
実行使用メモリ 32,556 KB
平均クエリ数 81.06
最終ジャッジ日時 2023-10-18 20:42:45
合計ジャッジ時間 4,903 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
32,544 KB
testcase_01 AC 139 ms
32,548 KB
testcase_02 AC 138 ms
32,548 KB
testcase_03 AC 165 ms
32,548 KB
testcase_04 AC 143 ms
32,556 KB
testcase_05 AC 140 ms
32,556 KB
testcase_06 AC 141 ms
32,556 KB
testcase_07 AC 142 ms
32,556 KB
testcase_08 AC 160 ms
32,548 KB
testcase_09 AC 164 ms
32,548 KB
testcase_10 AC 140 ms
32,556 KB
testcase_11 AC 137 ms
32,556 KB
testcase_12 AC 139 ms
32,556 KB
testcase_13 AC 139 ms
32,556 KB
testcase_14 AC 140 ms
32,556 KB
testcase_15 AC 138 ms
32,556 KB
testcase_16 AC 138 ms
32,556 KB
testcase_17 AC 139 ms
32,556 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

STDOUT.sync = true
N = gets.to_i

(N / 2).times do |i|
    x = i
    y = N - 1 - i
    puts "? #{x} #{y}"
    z = gets.to_i
    if z == x
        puts "! #{y}"
        exit
    elsif z == y
        puts "! #{x}"
        exit
    end
end
puts "! #{N / 2}"
0