Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


def main(init=int(2**31-1)):
    n, q = (int(s) for s in stdin.readline().split())

    a = [init] * n

    for _ in range(q):
        com, x, y = (int(s) for s in stdin.readline().split())
        if com:
            print(min(a[x:y+1]))
        else:
            a[x] = y


main()

Fixed submission:
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


def main(init=int(2**31-1), readline=stdin.readline):
    n, q = (int(s) for s in readline().split())

    a = [init] * n
    b = [init] * ((n // 100) + 1)

    for _ in range(q):
        com, x, y = (int(s) for s in readline().split())
        if com:
            bx = x - (x % 100) + 100
            by = y - (y % 100)
            if bx < by:
                m = min(min(a[x:bx]), min(b[bx//100:by//100]),
                        min(a[by:y+1]))
            else:
                m = min(a[x:y+1])
            print(m)
        else:
            a[x] = y
            bx = x - (x % 100)
            b[x//100] = min(a[bx:bx+100])


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


def main(init=int(2**31-1)):
    n, q = (int(s) for s in stdin.readline().split())

    a = [init] * n
    px = py = init

    for _ in range(q):
        com, x, y = (int(s) for s in stdin.readline().split())
        if com:
            if x != px or py != y:
                m = min(a[x:y+1])
                px = x
                py = y
            print(m)
        else:
            a[x] = y
            px = py = init


main()

Fixed submission:
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


def main(init=int(2**31-1), readline=stdin.readline):
    n, q = (int(s) for s in readline().split())

    a = [init] * n
    b = [init] * ((n // 100) + 1)

    for _ in range(q):
        com, x, y = (int(s) for s in readline().split())
        if com:
            bx = x - (x % 100) + 100
            by = y - (y % 100)
            if bx < by:
                m = min(min(a[x:bx]), min(b[bx//100:by//100]),
                        min(a[by:y+1]))
            else:
                m = min(a[x:y+1])
            print(m)
        else:
            a[x] = y
            bx = x - (x % 100)
            b[x//100] = min(a[bx:bx+100])


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


def main(init=int(2**31-1)):
    n, q = (int(s) for s in stdin.readline().split())

    a = [init] * n
    b = {}

    for _ in range(q):
        com, x, y = (int(s) for s in stdin.readline().split())
        if com:
            try:
                m = b[(x, y)]
            except KeyError:
                m = min(a[x:y+1])
                b[(x, y)] = m
            print(m)
        else:
            a[x] = y
            for i, j in b.keys():
                if i <= x <= j:
                    del b[(i, j)]


main()

Fixed submission:
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


def main(init=int(2**31-1), readline=stdin.readline):
    n, q = (int(s) for s in readline().split())

    a = [init] * n
    b = [init] * ((n // 100) + 1)

    for _ in range(q):
        com, x, y = (int(s) for s in readline().split())
        if com:
            bx = x - (x % 100) + 100
            by = y - (y % 100)
            if bx < by:
                m = min(min(a[x:bx]), min(b[bx//100:by//100]),
                        min(a[by:y+1]))
            else:
                m = min(a[x:y+1])
            print(m)
        else:
            a[x] = y
            bx = x - (x % 100)
            b[x//100] = min(a[bx:bx+100])


main()