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 ABSsegtree:  # 必要な配列の長さN,単位元ie,関数(2項演算)func,を渡す
      def __init__(self, N, ie, func):
          self.func = func
          self.getLEN = 1  # Length of list
          while self.getLEN < N:
              self.getLEN *= 2
          self.getsize = self.getLEN * 2  # =len(ST)
          self.getLIN = self.getsize - self.getLEN  # internal nodes without ST[0]
          self.ST = [ie] * self.getsize
  
      def update(self, i, x):  # i(0-index)にxをいれる
          i += self.getLIN
          self.ST[i] = x
          while i > 1:
              i //= 2
              self.ST[i] = self.func(self.ST[2 * i], self.ST[2 * i + 1])
  
      def get_interval(self, a, b):  # [a,b)での最小値を求めたい
          a += self.getLIN
          b += self.getLIN
          ret = self.func(self.ST[a], self.ST[b - 1])
          while a + 1 < b:  # 階層ごとに見る
              if a % 2 == 1:
                  ret = self.func(self.ST[a], ret)
                  a += 1
              a //= 2
              if b % 2 == 1:
                  ret = self.func(self.ST[b - 1], ret)
              b //= 2
          if a == b:
              pass
          else:
              ret = self.func(ret, self.ST[a])
          return ret
  
  
  N, Q = map(int, input().split())
  ins = ABSsegtree(N, pow(2, 31) - 1, min)
  for _ in range(Q):
      P, X, Y = map(int, input().split())
      if P == 0:
          ins.update(X, Y)
      else:
          print(ins.get_interval(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"}]