Language: C++

# sum??????????????????
module Main
  extend self

  def make_combination(n)
    [0, 1].repeated_permutaion(n).to_a
  end

  @@memo = {}
  def can_assemble?(elements, index, sum, raw_elements_length)
    unless @@memo[index].nil?
      return @@memo[index][sum] unless @@memo[index][sum].nil?
    else
      @@memo[index] = []
    end

    if sum == 0
      true
    elsif index >= raw_elements_length
      false
    else
      @@memo[index][sum] = can_assemble?(elements, index + 1, sum, raw_elements_length) || can_assemble?(elements, index + 1, sum - elements[index], raw_elements_length)
      @@memo[index][sum]
    end
  end

  def solve(i, m)

  end

  def main
    lines = STDIN.read.split(/\n/)
    lines.shift

    elements = lines.shift.split(' ').map{|s|s.to_i}
    lines.shift

    sums = lines.shift.split(' ').map{|s|s.to_i}
    sums.each{ |sum|
      puts can_assemble?(elements, 0, sum, elements.size) ? 'yes' : 'no'
    }

  end
end

Main::main

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #sum
    1 | # sum??????????????????
      |   ^~~
a.cc:9:3: error: stray '@' in program
    9 |   @@memo = {}
      |   ^
a.cc:9:4: error: stray '@' in program
    9 |   @@memo = {}
      |    ^
a.cc:11:12: error: stray '@' in program
   11 |     unless @@memo[index].nil?
      |            ^
a.cc:11:13: error: stray '@' in program
   11 |     unless @@memo[index].nil?
      |             ^
a.cc:12:14: error: stray '@' in program
   12 |       return @@memo[index][sum] unless @@memo[index][sum].nil?
      |              ^
a.cc:12:15: error: stray '@' in program
   12 |       return @@memo[index][sum] unless @@memo[index][sum].nil?
      |               ^
a.cc:12:40: error: stray '@' in program
   12 |       return @@memo[index][sum] unless @@memo[index][sum].nil?
      |                                        ^
a.cc:12:41: error: stray '@' in program
   12 |       return @@memo[index][sum] unless @@memo[index][sum].nil?
      |                                         ^
a.cc:14:7: error: stray '@' in program
   14 |       @@memo[index] = []
      |       ^
a.cc:14:8: error: stray '@' in program
   14 |       @@memo[index] = []
      |        ^
a.cc:22:7: error: stray '@' in program
   22 |       @@memo[index][sum] = can_assemble?(elements, index + 1, sum, raw_elements_length) || can_assemble?(elements, index + 1, sum - elements[index], raw_elements_length)
      |       ^
a.cc:22:8: error: stray '@' in program
   22 |       @@memo[index][sum] = can_assemble?(elements, index + 1, sum, raw_elements_length) || can_assemble?(elements, index + 1, sum - elements[index], raw_elements_length)
      |        ^
a.cc:23:7: error: stray '@' in program
   23 |       @@memo[index][sum]
      |       ^
a.cc:23:8: error: stray '@' in program
   23 |       @@memo[index][sum]
      |        ^
a.cc:32:31: error: stray '\' in program
   32 |     lines = STDIN.read.split(/\n/)
      |                               ^
a.cc:40:61: warning: multi-character character constant [-Wmultichar]
   40 |       puts can_assemble?(elements, 0, sum, elements.size) ? 'yes' : 'no'
      |                                                             ^~~~~
a.cc:40:69: warning: multi-character character constant [-Wmultichar]
   40 |       puts can_assemble?(elements, 0, sum, elements.size) ? 'yes' : 'no'
      |                                                                     ^~~~
a.cc:2:1: error: 'module' does not name a type
    2 | module Main
      | ^~~~~~
a.cc:2:1: note: C++20 'module' only available with '-fmodules-ts'
a.cc:10:3: error: 'def' does not name a type
   10 |   def can_assemble?(elements, index, sum, raw_elements_length)
      |   ^~~
a.cc:36:5: error: 'lines' does not name a type
   36 |     lines.shift
      |     ^~~~~
a.cc:39:5: error: 'sums' does not name a type
   39 |     sums.each{ |sum|
      |     ^~~~
a.cc:43:3: error: 'end' does not name a type
   43 |   end
      |   ^~~