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: import sys
  
  input = sys.stdin.readline
  
  
  class SegmentTree:
      # リストからセグメントツリーを構成
      def __init__(self, list_, ide_ele=0):
          tmp = 1
          while tmp < len(list_):
              tmp *= 2
          self.n = tmp
          self.l = [ide_ele] * (2 * self.n - 1)
          self.ide_ele = ide_ele
          self.init_val(list_)
  
      def func(self, x, y):
          return min(x, y)
  
      def init_val(self, list_):
          # list_の値で葉を埋める
          for i, val in enumerate(list_):
              self.l[self.n - 1 + i] = val
          # 下の段から初期値を埋めていく
          for i in range(self.n - 2, -1, -1):
              self.l[i] = self.func(self.l[i * 2 + 1], self.l[i * 2 + 2])
  
      # i番目をvalで更新
      def update(self, i, val):
          i = self.n - 1 + i
          self.l[i] = val
          while i > 0:
              i = (i - 1) // 2
              self.l[i] = self.func(self.l[i * 2 + 1], self.l[i * 2 + 2])
  
      # [a, b)の最小値を返す. l, rはノードkに対応した区間
      def query(self, a, b, k, l, r):
          if r <= a or b <= l:  # 存在しない区間を参照
              return self.ide_ele  # エラーを返す
          if a <= l and r <= b:  # 区間を完全に含む
              return self.l[k]
          vl = self.query(a, b, k * 2 + 1, l, (l + r) // 2)
          vr = self.query(a, b, k * 2 + 2, (l + r) // 2, r)
          return self.func(vl, vr)
  
  
  def main():
      N, Q = map(int, input().split())
      tmp = (1 << 31) - 1
      seg = SegmentTree([tmp] * N, ide_ele=tmp)
  
      # print("init")
      # print(seg.l)
  
      for i in range(Q):
          c, x, y = map(int, input().split())
          if c == 0:
              # print("update: l[{}]={} -> {}".format(x, seg.l[x], y))
              seg.update(x, y)
          else:
              # print("min: {}~{}".format(x, y))
              print(seg.query(x, y + 1, 0, 0, seg.n))
          # print(seg.l)
  
  
  if __name__ == "__main__":
      main()
  
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"}]