結果

問題 No.785 色食い虫
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2020-06-28 21:27:08
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 11,464 KB
実行使用メモリ 15,312 KB
最終ジャッジ日時 2023-09-22 15:50:58
合計ジャッジ時間 4,567 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,204 KB
testcase_01 AC 81 ms
15,208 KB
testcase_02 AC 84 ms
15,200 KB
testcase_03 WA -
testcase_04 AC 81 ms
15,028 KB
testcase_05 AC 80 ms
15,208 KB
testcase_06 AC 79 ms
15,212 KB
testcase_07 AC 80 ms
15,288 KB
testcase_08 AC 78 ms
15,196 KB
testcase_09 AC 79 ms
14,984 KB
testcase_10 AC 78 ms
15,032 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 79 ms
15,244 KB
testcase_14 AC 79 ms
15,108 KB
testcase_15 AC 78 ms
15,284 KB
testcase_16 AC 78 ms
15,260 KB
testcase_17 AC 79 ms
15,096 KB
testcase_18 AC 79 ms
15,092 KB
testcase_19 AC 78 ms
15,028 KB
testcase_20 AC 78 ms
15,072 KB
testcase_21 AC 79 ms
15,068 KB
testcase_22 AC 80 ms
15,068 KB
testcase_23 AC 80 ms
15,152 KB
testcase_24 WA -
testcase_25 AC 79 ms
15,280 KB
testcase_26 AC 80 ms
15,280 KB
testcase_27 AC 80 ms
15,288 KB
testcase_28 AC 82 ms
15,072 KB
testcase_29 AC 79 ms
15,152 KB
testcase_30 AC 78 ms
15,208 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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