結果

問題 No.934 Explosive energy drink
ユーザー maimai
提出日時 2019-11-29 21:55:29
言語 Ruby
(3.3.0)
結果
AC  
実行時間 803 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 11,168 KB
実行使用メモリ 31,704 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:25:23
合計ジャッジ時間 10,255 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
31,048 KB
testcase_01 AC 801 ms
31,372 KB
testcase_02 AC 110 ms
31,052 KB
testcase_03 AC 428 ms
31,124 KB
testcase_04 AC 803 ms
31,288 KB
testcase_05 AC 109 ms
31,372 KB
testcase_06 AC 108 ms
31,024 KB
testcase_07 AC 109 ms
30,804 KB
testcase_08 AC 108 ms
31,272 KB
testcase_09 AC 109 ms
30,920 KB
testcase_10 AC 108 ms
31,292 KB
testcase_11 AC 109 ms
30,792 KB
testcase_12 AC 112 ms
31,280 KB
testcase_13 AC 116 ms
30,984 KB
testcase_14 AC 117 ms
31,472 KB
testcase_15 AC 291 ms
31,648 KB
testcase_16 AC 143 ms
31,588 KB
testcase_17 AC 190 ms
31,256 KB
testcase_18 AC 195 ms
31,656 KB
testcase_19 AC 332 ms
31,672 KB
testcase_20 AC 532 ms
31,180 KB
testcase_21 AC 560 ms
31,284 KB
testcase_22 AC 782 ms
31,480 KB
testcase_23 AC 795 ms
31,704 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

@n = gets.to_i
def query(items)
  items = items.compact
  puts "? #{items.size}"
  puts items.map(&:succ)*' '
  STDOUT.flush
  gets.to_i == 1
end

flg = [false]*@n
q = @n.times.to_a
monster = []
@n.times do |i|
  q[i] = nil
  bomb = query(q)
  if !bomb
    flg[i] = true
    monster << i
  end
  q[i] = i
end

puts "! #{monster.size}"
puts monster.map(&:succ)*' '
0