結果

問題 No.305 鍵(2)
ユーザー gemmarogemmaro
提出日時 2020-08-05 07:15:51
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 381 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 11,412 KB
実行使用メモリ 30,760 KB
平均クエリ数 0.85
最終ジャッジ日時 2023-09-24 03:59:59
合計ジャッジ時間 4,706 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
30,760 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

cs = Array.new(10)
(0..9).each do |i|
  puts i.to_s * 10
  STDOUT.flush
  c, l = gets.split.then { |c, l| [c, l == 'unlocked'] }
  if l
    exit
  else
    cs[i] = c.to_i
  end
end
(0..9).zip(cs).map { _1.to_s * _2 }.flatten.permutation.each do |k|
  puts k.join
  STDOUT.flush
  _, l = gets.split.then { |c, l| [c, l == 'unlocked'] }
  exit if l
end
0