結果

問題 No.624 Santa Claus and The Last Dungeon
ユーザー maimai
提出日時 2017-12-24 01:16:30
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 653 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 11,576 KB
実行使用メモリ 31,672 KB
平均クエリ数 747.22
最終ジャッジ日時 2023-09-23 15:22:58
合計ジャッジ時間 13,226 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 251 ms
30,972 KB
testcase_01 AC 247 ms
31,164 KB
testcase_02 AC 243 ms
31,128 KB
testcase_03 AC 244 ms
31,296 KB
testcase_04 AC 246 ms
31,448 KB
testcase_05 AC 249 ms
31,340 KB
testcase_06 AC 247 ms
30,972 KB
testcase_07 AC 244 ms
31,264 KB
testcase_08 AC 241 ms
30,788 KB
testcase_09 AC 242 ms
31,120 KB
testcase_10 AC 252 ms
31,376 KB
testcase_11 AC 241 ms
31,052 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

@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


0