結果
| 問題 |
No.624 Santa Claus and The Last Dungeon
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-24 01:16:30 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 653 bytes |
| コンパイル時間 | 478 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 30,160 KB |
| 平均クエリ数 | 747.22 |
| 最終ジャッジ日時 | 2024-07-16 15:07:36 |
| 合計ジャッジ時間 | 11,962 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 24 |
コンパイルメッセージ
Syntax OK
ソースコード
@local_answer = ["0"]*200
def query_local(strs)
p strs
res = []
strs.zip(@local_answer) do |x, a|
res << (x == a ? 1 : 0)
end
cnt = [0,0,0]
res.each_slice(2){|a,b| cnt[a+b] += 1}
return cnt
end
def query(q)
#return query_local(q.map{|e| e ? e.to_s : "?"})
str = ""
q.map{|e| e ? e.to_s : "?"}.each_slice(2){|a,b| str << a << b << " "}
puts str
STDOUT.flush
return gets.split.map(&:to_i)
end
idx = 0
qu = [nil]*200
gets.to_i.times do |lop|
qu[idx] = lop%10
res = query(qu)
res[1] += res[2]*2
idx += 1 if res[1] > idx
break if idx == 200
end