結果

問題 No.785 色食い虫
ユーザー Takuya Noguchi
提出日時 2020-06-28 21:27:08
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-07-08 07:22:02
合計ジャッジ時間 3,389 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

color_code = [*'0'..'9', *'A'..'F'].repeated_permutation(2).to_a

r = gets.chomp.split(',')
g = gets.chomp.split(',')
b = gets.chomp.split(',')

count = 1

[r, g, b].each do |reject_color_codes|
  count *= if r.first == 'NONE'
             color_code.count
           else
             color_code.select { |c| (c & reject_color_codes).size == 0 }.count
           end
end

puts count
0