結果

問題 No.355 数当てゲーム(2)
ユーザー tubo28tubo28
提出日時 2016-04-02 00:39:20
言語 Ruby
(3.3.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 11,520 KB
実行使用メモリ 31,532 KB
平均クエリ数 31.73
最終ジャッジ日時 2023-09-23 23:33:41
合計ジャッジ時間 7,723 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
31,312 KB
testcase_01 AC 89 ms
31,316 KB
testcase_02 AC 89 ms
31,316 KB
testcase_03 AC 86 ms
31,032 KB
testcase_04 AC 87 ms
31,096 KB
testcase_05 AC 91 ms
30,616 KB
testcase_06 AC 89 ms
31,092 KB
testcase_07 AC 95 ms
31,104 KB
testcase_08 AC 93 ms
30,840 KB
testcase_09 AC 95 ms
31,360 KB
testcase_10 AC 93 ms
31,192 KB
testcase_11 AC 86 ms
30,980 KB
testcase_12 AC 87 ms
30,896 KB
testcase_13 AC 89 ms
30,916 KB
testcase_14 AC 89 ms
30,828 KB
testcase_15 AC 89 ms
31,056 KB
testcase_16 AC 87 ms
30,916 KB
testcase_17 AC 87 ms
31,304 KB
testcase_18 AC 90 ms
30,880 KB
testcase_19 AC 89 ms
31,392 KB
testcase_20 AC 89 ms
31,268 KB
testcase_21 AC 102 ms
31,260 KB
testcase_22 AC 98 ms
31,116 KB
testcase_23 AC 90 ms
31,388 KB
testcase_24 AC 90 ms
30,752 KB
testcase_25 AC 92 ms
31,380 KB
testcase_26 AC 96 ms
30,972 KB
testcase_27 AC 88 ms
31,060 KB
testcase_28 AC 86 ms
30,920 KB
testcase_29 AC 88 ms
30,720 KB
testcase_30 AC 89 ms
30,636 KB
testcase_31 AC 89 ms
30,844 KB
testcase_32 AC 87 ms
31,104 KB
testcase_33 AC 87 ms
31,024 KB
testcase_34 AC 91 ms
30,848 KB
testcase_35 AC 87 ms
30,940 KB
testcase_36 AC 87 ms
30,736 KB
testcase_37 AC 87 ms
30,804 KB
testcase_38 AC 86 ms
31,368 KB
testcase_39 AC 89 ms
31,508 KB
testcase_40 AC 88 ms
30,776 KB
testcase_41 AC 86 ms
30,720 KB
testcase_42 AC 92 ms
31,076 KB
testcase_43 AC 89 ms
31,072 KB
testcase_44 AC 89 ms
30,728 KB
testcase_45 AC 91 ms
31,016 KB
testcase_46 AC 88 ms
30,960 KB
testcase_47 AC 90 ms
30,672 KB
testcase_48 AC 89 ms
31,532 KB
testcase_49 AC 88 ms
31,456 KB
testcase_50 AC 88 ms
31,036 KB
testcase_51 AC 88 ms
31,264 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:24: warning: assigned but unused variable - y
Syntax OK

ソースコード

diff #

def ask a
  $stdout.puts a.join(' ')
  $stdout.flush
  x,y = gets.split.map(&:to_i)
  exit 0 if x == 4
  [x,y]
end

a = nil

[*0...10].combination(4).to_a.shuffle.each { |c|
  x,y = ask c
  if x == 0 && y == 0
    a = c
    break
  end
}

4.times { |i|
  x = nil
  10.times { |j|
    next if a.include? j
    a[i] = j
    x,y = ask a
    if x == i+1
      break
    end
  }
}
0