結果

問題 No.24 数当てゲーム
ユーザー arucaraparucarap
提出日時 2021-08-23 13:28:23
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-25 05:36:42
合計ジャッジ時間 1,812 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
12,160 KB
testcase_01 AC 79 ms
12,288 KB
testcase_02 AC 79 ms
12,288 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 75 ms
12,288 KB
testcase_06 AC 76 ms
12,288 KB
testcase_07 AC 77 ms
12,160 KB
testcase_08 WA -
testcase_09 AC 80 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

ary = Array.new(10)
N = gets.to_i
N.times do
    tmp = gets.split
    nums = tmp[0..-2].map(&:to_i)
    answer = tmp[-1]
    if answer == 'YES'
        ary.each_with_index do |status, idx|
            if nums.index(idx)
                ary[idx] ||= true
            else
                ary[idx] = false
            end
        end
    else
        nums.each{ |num| ary[num] = false }
    end
end
puts (ary.index(true) || ary.index(nil))
0