結果

問題 No.24 数当てゲーム
ユーザー hashimotohashimoto
提出日時 2015-05-22 15:28:32
言語 Ruby
(3.2.2)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 461 bytes
コンパイル時間 51 ms
コンパイル使用メモリ 11,236 KB
実行使用メモリ 15,292 KB
最終ジャッジ日時 2023-09-20 09:04:59
合計ジャッジ時間 1,832 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,116 KB
testcase_01 AC 84 ms
15,196 KB
testcase_02 AC 83 ms
15,292 KB
testcase_03 AC 84 ms
15,288 KB
testcase_04 AC 83 ms
15,276 KB
testcase_05 AC 84 ms
15,148 KB
testcase_06 AC 86 ms
15,148 KB
testcase_07 AC 85 ms
15,144 KB
testcase_08 AC 84 ms
15,176 KB
testcase_09 AC 84 ms
15,064 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i

answer = (0..9).to_a

taro_reply = []
n.times do |i|
    taro_reply[i] = gets.split
    taro_reply[i][0..3] = taro_reply[i][0..3].map(&:to_i)

    if taro_reply[i][4] == "NO"
        0.upto(3) do |j|
            answer[taro_reply[i][j]] = "x"
        end
    else
        0.upto(9) do |k|
            if !taro_reply[i].include?(k)
                answer[k] = "x"
            end
        end
    end
end

answer.each do |i|
    p i if i != "x"
end
0