Language: C++

from collections import deque


class Bt(object):
    def __init__(self):
        self.used = [False] * 10  # 0-9????????°???????????¨?????????????????????????????°
        self.answers = []  # ?????¶???????????????????????????
        self.Q = deque()  # ????????§???????????¢??????????????°???????¨???¶??¨

    def solve(self, num, remain):
        # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
        try:
            min_choice = max(self.Q) + 1
        except ValueError:
            min_choice = 0

        if min_choice <= remain < 10 and self.used[remain] == False and num == 1:
            self.Q.append(remain)
            # print('{0}'.format(self.Q))
            ans = [*self.Q]
            ans.sort()
            if not ans in self.answers:
                self.answers.append(ans)
            self.Q.pop()
            # self.answers.append(1)
            return
        elif num < 0:
            return

        for i in range(min_choice, 10):
            if self.used[i] == False and (remain - i) >= 0:
                self.used[i] = True
                self.Q.append(i)
                self.solve(num - 1, remain - i)
                self.used[i] = False
                self.Q.pop()


if __name__ == '__main__':
    while True:
        # ??????????????\???
        n, s = [int(x) for x in input().split(' ')]
        if n == 0 and s == 0:
            break

        if 0 <= s <= 45:
            # ????????????
            a = Bt()
            a.solve(n, s)

            # ???????????¨???
            print(len(a.answers))
        else:
            print(0)

Compiler output:
a.cc:6:35: error: stray '#' in program
    6 |         self.used = [False] * 10  # 0-9????????°???????????¨?????????????????????????????°
      |                                   ^
a.cc:6:48: error: extended character ° is not valid in an identifier
    6 |         self.used = [False] * 10  # 0-9????????°???????????¨?????????????????????????????°
      |                                                ^
a.cc:6:90: error: extended character ° is not valid in an identifier
    6 |         self.used = [False] * 10  # 0-9????????°???????????¨?????????????????????????????°
      |                                                                                          ^
a.cc:7:28: error: stray '#' in program
    7 |         self.answers = []  # ?????¶???????????????????????????
      |                            ^
a.cc:7:35: error: extended character ¶ is not valid in an identifier
    7 |         self.answers = []  # ?????¶???????????????????????????
      |                                   ^
a.cc:8:27: error: stray '#' in program
    8 |         self.Q = deque()  # ????????§???????????¢??????????????°???????¨???¶??¨
      |                           ^
a.cc:8:37: error: extended character § is not valid in an identifier
    8 |         self.Q = deque()  # ????????§???????????¢??????????????°???????¨???¶??¨
      |                                     ^
a.cc:8:49: error: extended character ¢ is not valid in an identifier
    8 |         self.Q = deque()  # ????????§???????????¢??????????????°???????¨???¶??¨
      |                                                 ^
a.cc:8:64: error: extended character ° is not valid in an identifier
    8 |         self.Q = deque()  # ????????§???????????¢??????????????°???????¨???¶??¨
      |                                                                ^
a.cc:8:76: error: extended character ¶ is not valid in an identifier
    8 |         self.Q = deque()  # ????????§???????????¢??????????????°???????¨???¶??¨
      |                                                                            ^
a.cc:11:11: error: invalid preprocessing directive #?
   11 |         # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
      |           ^
a.cc:11:15: error: extended character ¢ is not valid in an identifier
   11 |         # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
      |               ^
a.cc:11:27: error: extended character ° is not valid in an identifier
   11 |         # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
      |                           ^
a.cc:11:34: error: extended character § is not valid in an identifier
   11 |         # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
      |                                  ^
a.cc:11:64: error: extended character § is not valid in an identifier
   11 |         # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
      |                                                                ^
a.cc:11:85: error: extended character § is not valid in an identifier
   11 |         # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
      |                                                                                     ^
a.cc:11:94: error: extended character ° is not valid in an identifier
   11 |         # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
      |                                                                                              ^
a.cc:19:15: error: invalid preprocessing directive #print
   19 |             # print('{0}'.format(self.Q))
      |               ^~~~~
a.cc:25:15: error: invalid preprocessing directive #self
   25 |             # self.answers.append(1)
      |               ^~~~
a.cc:39:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   39 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:41:11: error: invalid preprocessing directive #?
   41 |         # ??????????????\???
      |           ^
a.cc:47:15: error: invalid preprocessing directive #?
   47 |             # ????????????
      |               ^
a.cc:51:15: error: invalid preprocessing directive #?
   51 |             # ???????????¨???
      |               ^
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import deque
      | ^~~~