結果

問題 No.934 Explosive energy drink
ユーザー gemmarogemmaro
提出日時 2020-04-26 16:22:53
言語 Ruby
(3.3.0)
結果
AC  
実行時間 627 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 579 ms
コンパイル使用メモリ 11,544 KB
実行使用メモリ 31,800 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-24 03:22:54
合計ジャッジ時間 8,459 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
30,864 KB
testcase_01 AC 626 ms
31,112 KB
testcase_02 AC 91 ms
31,500 KB
testcase_03 AC 332 ms
31,704 KB
testcase_04 AC 627 ms
31,224 KB
testcase_05 AC 91 ms
31,308 KB
testcase_06 AC 86 ms
31,004 KB
testcase_07 AC 89 ms
30,768 KB
testcase_08 AC 88 ms
30,820 KB
testcase_09 AC 87 ms
30,984 KB
testcase_10 AC 87 ms
31,248 KB
testcase_11 AC 90 ms
31,056 KB
testcase_12 AC 92 ms
31,060 KB
testcase_13 AC 97 ms
30,972 KB
testcase_14 AC 97 ms
31,620 KB
testcase_15 AC 233 ms
31,316 KB
testcase_16 AC 134 ms
31,596 KB
testcase_17 AC 178 ms
31,156 KB
testcase_18 AC 154 ms
31,568 KB
testcase_19 AC 274 ms
31,444 KB
testcase_20 AC 427 ms
31,460 KB
testcase_21 AC 443 ms
31,800 KB
testcase_22 AC 625 ms
31,800 KB
testcase_23 AC 626 ms
31,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

def interact
  t = R.select do |x|
    i = x - 1
    s = R.dup
    s.delete_at(i)
    puts("? #{s.size}\n#{s.join(' ')}")
    $stdout.flush
    gets.chomp == '0'
  end

  "! #{t.size}\n#{t.join(' ')}"
end

N = gets.to_i

R = (1..N).to_a
RESULT = interact

puts RESULT
$stdout.flush
0