output_description: For each find operation, print the minimum element.
input_description: n q
      com0 x0 y0
      com1 x1 y1
      ...
      comq−1 xq−1 yq−1
      
  
  In the first line, n (the number of elements in A) and q (the number of
  queries) are given. Then, q queries are given where com represents the type of
  queries. '0' denotes update(xi, yi) and '1' denotes find(xi, yi).
attempt: class SegmentTreeRMQ:
      """Range Minimum Query"""
  
      def __init__(self, lst, max_num=float("inf")):
          """
          Args:
              lst: 元のリスト
              max_num: セグ木の各ノードの初期値
          """
          self.MAX_NUM = max_num  # セグ木のノードの最大値
          N = len(lst)
          i, total = 1, 1
          while True:
              if N <= i:
                  break
              i *= 2
              total += i
          self.N = i  # セグ木の葉の数
          self.nodes = [self.MAX_NUM for _ in range(total)]
          for i in range(len(lst)):
              self.update(i, lst[i])
  
      def update(self, i, x):
          """元のリストlst[i]に対応するセグ木のノード値をxに変更し、セグ木全体を更新する"""
          ni = self._lst2node(i)
          self.nodes[ni] = x
          while ni > 0:
              ni = (ni - 1) // 2
              l, r = ni * 2 + 1, ni * 2 + 2
              self.nodes[ni] = min(self.nodes[l], self.nodes[r])
  
      def query(self, a, b):
          """区間[a,b)のクエリに応答する"""
          return self._find(a, b, 0, 0, self.N)
  
      def _lst2node(self, i):
          """元の配列lst[i]は、セグ木のi+N-1番目のノード(Nは歯の数)"""
          return i + self.N - 1
  
      def _find(self, a, b, k, l, r):
          """区間[a,b)のクエリに対して、担当区間[l,r)のノードkが応答する"""
          if r <= a or b <= l:
              # 区間がかぶらない場合
              return self.MAX_NUM
          if a <= l and r <= b:
              # 担当区間がすっぽり含まれる場合
              return self.nodes[k]
          # それ以外
          ret1 = self._find(a, b, 2 * k + 1, l, (l + r) // 2)  # 左の子に聞く
          ret2 = self._find(a, b, 2 * k + 2, (l + r) // 2, r)  # 右の子に聞く
          return min(ret1, ret2)
  
  
  N, Q = map(int, input().split())
  lst = [2**31 - 1 for _ in range(N)]
  rmq = SegmentTreeRMQ(lst, 2**31 - 1)
  
  for q in range(Q):
      com, x, y = map(int, input().split())
  
      if com == 0:
          rmq.update(x, y)
      else:
          print(rmq.query(x, y + 1))
  
problem_description: Range Minimum Query (RMQ)
  
  Write a program which manipulates a sequence A = {a0, a1, . . . , an-1} with
  the following operations:
  
    * find(s, t): report the minimum element in as, as+1, . . . ,at.
    * update(i, x): change ai to x.
  
  Note that the initial values of ai (i = 0, 1, . . . , n−1) are 231-1.
samples: [{"input": "3 5\n    0 0 1\n    0 1 2\n    0 2 3\n    1 0 2\n    1 1 2", "output": "1\n    2"}, {"input": "1 3\n    1 0 0\n    0 0 5\n    1 0 0", "output": "2147483647\n    5"}]