Buggy python submission (verdict: Runtime Error):
import sys
import math
import time
sys.setrecursionlimit(20000)
INT_MAX = 2**31 - 1
def lazy_tree_merge(lazy,tree,i,N):
    if(lazy[i] is not None):
        tree[i] = lazy[i]
        if(i < N-1):
            lazy[i*2+1] = lazy[i]
            lazy[i*2+2] = lazy[i]
        lazy[i] = None

def update(tree,lazy,x,y,k,l,r,i,z,N):
    if (r <= x or y <= l):
        lazy_tree_merge(lazy,tree,k,N)
        return True
    if ( x <= l and r <= y):
        lazy[k] = z
        lazy_tree_merge(lazy,tree,k,N)
        return True

    lazy_tree_merge(lazy,tree,k,N)
    center = int((l+r)/2)
    update(tree, lazy, x, y, k*2 + 1, l, center, i, z, N)
    #update(tree, lazy, x, y, k*2 + 2, l, int((l+r)/2), i, z, N)
    update(tree, lazy, x, y, k*2 + 2, center, r, i, z, N)
    tree[k] = min(tree[k*2+1],tree[k*2+2])

def find(tree,lazy,x,y,k,l,r,N):

    if (r <= x or y <= l):
        return INT_MAX
    if ( x <= l and r <= y):
        lazy_tree_merge(lazy,tree,k,N)
        return tree[k]

    lazy_tree_merge(lazy,tree,k,N)
    v_left = find(tree, lazy_A, x, y, k*2 + 1, l, int((l+r)/2), N)
    v_right = find(tree, lazy_A, x, y, k*2 + 2, int((l+r)/2), r, N)
    #print(v_left)
    #print(v_right)
    return min(v_left, v_right)

if __name__ == '__main__':
    _N,query_num = map(int, input().split())
    N = 1
    while True:
        if(N >= _N):
            break
        N <<= 1
    if not (N == 1):
        A = [INT_MAX]*(2*N - 1)
        lazy_A = [None]*(2*N - 1)
    else:
        A = [INT_MAX]*(2*N)
        lazy_A = [None]*(2*N)
    #start = time.time()
    for i in range(query_num):
        query = list(map(int,input().split()))
        # update
        if(query[0]==0):
            update(A,lazy_A,query[1],query[2]+1,0,0,N,i,query[3],N)
            #print(A,lazy_A)
        # find
        if(query[0]==1):
            z = find(A,lazy_A,query[1],query[2]+1,0,0,N,N)
            print(z)
    #elapsed_time = time.time() - start
    #print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")



Fixed submission:
import sys
input = sys.stdin.readline
INT_MAX = (1<<31) - 1
_N,num = map(int, input().split())
Q = [list(map(int, input().split())) for i in range(num)]
N = 1<<17
N1 = N - 1
N2 = N1 // 2
ars = 2*N - 1
A = [INT_MAX]*(ars)
L = [-1]*(ars)

def propagate(k):

    if(L[k] == -1):
        return
    left = k*2+1
    right = k*2+2
    if(k < N2):
        A[left] = A[right] = L[left] = L[right] = L[k]
        L[k] = -1
        return
    if(k < N1):
        A[left] = A[right] = L[k]
        L[k] = -1

def update(s,t,x,k,l,r):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N1):
            L[k] = x
        return

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    update(s, t, x, left, l, mid)
    update(s, t, x, right, mid, r)

    A[k] = min(A[left], A[right])

def find(s,t,k,l,r):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return A[k]

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    v_left = find(s, t, left, l, mid)
    v_right = find(s, t, right, mid, r)
    return min(v_left,v_right)

res = []
for q in Q:
    # update
    if(q[0]==0):
        update(q[1],q[2]+1,q[3],0,0,N)
    # find
    else:
        res.append(find(q[1],q[2]+1,0,0,N))

print("\n".join([str(r) for r in res]))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import time
sys.setrecursionlimit(20000)
INT_MAX = 2**31 - 1
def lazy_tree_merge(lazy,tree,i,N):
    if(lazy[i] is not None):
        tree[i] = lazy[i]
        if(i < N-1):
            lazy[i*2+1] = lazy[i]
            lazy[i*2+2] = lazy[i]
        lazy[i] = None

def update(tree,lazy,x,y,k,l,r,i,z,N):
    if (r <= x or y <= l):
        lazy_tree_merge(lazy,tree,k,N)
        return True
    if ( x <= l and r <= y):
        lazy[k] = z
        lazy_tree_merge(lazy,tree,k,N)
        return True

    lazy_tree_merge(lazy,tree,k,N)
    center = int((l+r)/2)
    update(tree, lazy, x, y, k*2 + 1, l, center, i, z, N)
    #update(tree, lazy, x, y, k*2 + 2, l, int((l+r)/2), i, z, N)
    update(tree, lazy, x, y, k*2 + 2, center, r, i, z, N)
    tree[k] = min(tree[k*2+1],tree[k*2+2])

def find(tree,lazy,x,y,k,l,r,N):

    if (r <= x or y <= l):
        return INT_MAX
    if ( x <= l and r <= y):
        lazy_tree_merge(lazy,tree,k,N)
        return tree[k]

    lazy_tree_merge(lazy,tree,k,N)
    v_left = find(tree, lazy_A, x, y, k*2 + 1, l, int((l+r)/2), N)
    v_right = find(tree, lazy_A, x, y, k*2 + 2, int((l+r)/2), r, N)
    #print(v_left)
    #print(v_right)
    return min(v_left, v_right)

if __name__ == '__main__':
    _N,query_num = map(int, input().split())
    N = 1
    while True:
        if(N >= _N):
            break
        N <<= 1
    if not (N == 1):
        A = [INT_MAX]*(2*N - 1)
        lazy_A = [None]*(2*N - 1)
    else:
        A = [INT_MAX]*(2*N)
        lazy_A = [None]*(2*N)
    #start = time.time()
    for i in range(query_num):
        query = list(map(int,input().split()))
        # update
        if(query[0]==0):
            update(A,lazy_A,query[1],query[2]+1,0,0,N,i,query[3],N)
            #print(A,lazy_A)
        # find
        if(query[0]==1):
            z = find(A,lazy_A,query[1],query[2]+1,0,0,N,N)
            print(z)
    #elapsed_time = time.time() - start
    #print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")



Fixed submission:
import sys
input = sys.stdin.readline
INT_MAX = (1<<31) - 1
_N,num = map(int, input().split())
Q = [list(map(int, input().split())) for i in range(num)]
N = 1<<17
N1 = N - 1
N2 = N1 // 2
ars = 2*N - 1
A = [INT_MAX]*(ars)
L = [-1]*(ars)

def propagate(k):

    if(L[k] == -1):
        return
    left = k*2+1
    right = k*2+2
    if(k < N2):
        A[left] = A[right] = L[left] = L[right] = L[k]
        L[k] = -1
        return
    if(k < N1):
        A[left] = A[right] = L[k]
        L[k] = -1

def update(s,t,x,k,l,r):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N1):
            L[k] = x
        return

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    update(s, t, x, left, l, mid)
    update(s, t, x, right, mid, r)

    A[k] = min(A[left], A[right])

def find(s,t,k,l,r):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return A[k]

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    v_left = find(s, t, left, l, mid)
    v_right = find(s, t, right, mid, r)
    return min(v_left,v_right)

res = []
for q in Q:
    # update
    if(q[0]==0):
        update(q[1],q[2]+1,q[3],0,0,N)
    # find
    else:
        res.append(find(q[1],q[2]+1,0,0,N))

print("\n".join([str(r) for r in res]))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
#import time
sys.setrecursionlimit(20000)
INT_MAX = 2**31 - 1

def tree_propagate(tree,lazy,k,N):
    if(lazy[k] is None):
        return
    if(k < N // 2):
        tree[k*2+1] = tree[k*2+2] = lazy[k]
        lazy[k*2+1] = lazy[k*2+2] = lazy[k]
        lazy[k] = None
        return
    if(k < N-1):
        tree[k*2+1] = tree[k*2+2] = lazy[k]
        lazy[k] = None

def update(tree,lazy,s,t,x,k,l,r,N):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        tree[k] = x
        if(k < N-1):
            lazy[k] = x
        #tree_propagate(tree,lazy,k,N)
        return

    tree_propagate(tree,lazy,k,N)
    center = int((l+r)/2)
    update(tree, lazy, s, t, x, k*2 + 1, l, center, N)
    update(tree, lazy, s, t, x, k*2 + 2, center, r, N)

    tree[k] = min(tree[k*2+1], tree[k*2+2])

def find(tree,lazy,s,t,k,l,r,N):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return tree[k]

    tree_propagate(tree,lazy,k,N)
    center = int((l+r)/2)
    v_left = find(tree, lazy, s, t, k*2 + 1, l, center, N)
    v_right = find(tree, lazy, s, t, k*2 + 2, center, r, N)
    return min(v_left,v_right)

if __name__ == '__main__':
    _N,query_num = map(int, input().split())
    queries = [list(map(int, input().split())) for i in range(query_num)]
    N = 1
    while True:
        if(N >= _N):
            break
        N <<= 1

    A = [INT_MAX]*(2*N - 1)
    lazy_A = [None]*(2*N - 1)
    #start = time.time()
    answers = []
    #for i in range(query_num):
    for query in queries:
        #query = list(map(int,input().split()))
        # update
        if(query[0]==0):
            update(A,lazy_A,query[1],query[2]+1,query[3],0,0,N,N)
        # find
        if(query[0]==1):
            z = find(A,lazy_A,query[1],query[2]+1,0,0,N,N)
            answers.append(z)
            #print(z)
    for ans in answers:
        print(ans)
    #elapsed_time = time.time() - start
    #print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")



Fixed submission:
import sys
input = sys.stdin.readline
INT_MAX = (1<<31) - 1
_N,num = map(int, input().split())
Q = [list(map(int, input().split())) for i in range(num)]
N = 1<<17
N1 = N - 1
N2 = N1 // 2
ars = 2*N - 1
A = [INT_MAX]*(ars)
L = [-1]*(ars)

def propagate(k):

    if(L[k] == -1):
        return
    left = k*2+1
    right = k*2+2
    if(k < N2):
        A[left] = A[right] = L[left] = L[right] = L[k]
        L[k] = -1
        return
    if(k < N1):
        A[left] = A[right] = L[k]
        L[k] = -1

def update(s,t,x,k,l,r):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N1):
            L[k] = x
        return

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    update(s, t, x, left, l, mid)
    update(s, t, x, right, mid, r)

    A[k] = min(A[left], A[right])

def find(s,t,k,l,r):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return A[k]

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    v_left = find(s, t, left, l, mid)
    v_right = find(s, t, right, mid, r)
    return min(v_left,v_right)

res = []
for q in Q:
    # update
    if(q[0]==0):
        update(q[1],q[2]+1,q[3],0,0,N)
    # find
    else:
        res.append(find(q[1],q[2]+1,0,0,N))

print("\n".join([str(r) for r in res]))

Buggy python submission (verdict: Time Limit Exceeded):
INT_MAX = (1<<31) - 1
_N,query_num = map(int, input().split())
queries = [list(map(int, input().split())) for i in range(query_num)]
N = 1<<17

arr_size = 2*N - 1
A = [INT_MAX]*(arr_size)
lazy_A = [None]*(arr_size)

def tree_propagate(k):
    if(lazy_A[k] is None):
        return
    if(k < N // 2):
        A[k*2+1] = A[k*2+2] = lazy_A[k*2+1] = lazy_A[k*2+2] = lazy_A[k]
        lazy_A[k] = None
        return
    if(k < N-1):
        A[k*2+1] = A[k*2+2] = lazy_A[k]
        lazy_A[k] = None

def update(s,t,x,k,l,r):
    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N-1):
            lazy_A[k] = x
        return

    tree_propagate(k)
    center = (l+r)//2
    update(s, t, x, k*2 + 1, l, center)
    update(s, t, x, k*2 + 2, center, r)
    A[k] = min(A[k*2+1], A[k*2+2])

def find(s,t,k,l,r):
    if (r <= s or t <= l):
        return INT_MAX
    if(s <= l and r <= t):
        return A[k]

    tree_propagate(k)
    center = (l+r)//2
    v_left = find(s, t, k*2 + 1, l, center)
    v_right = find(s, t, k*2 + 2, center, r)
    return min(v_left,v_right)

answers = []
for query in queries:
    if(query[0]==0):
        update(query[1],query[2]+1,query[3],0,0,N)
    else:
        answers.append(find(query[1],query[2]+1,0,0,N))

print("\n".join([str(ans) for ans in answers]))



Fixed submission:
import sys
input = sys.stdin.readline
INT_MAX = (1<<31) - 1
_N,num = map(int, input().split())
Q = [list(map(int, input().split())) for i in range(num)]
N = 1<<17
N1 = N - 1
N2 = N1 // 2
ars = 2*N - 1
A = [INT_MAX]*(ars)
L = [-1]*(ars)

def propagate(k):

    if(L[k] == -1):
        return
    left = k*2+1
    right = k*2+2
    if(k < N2):
        A[left] = A[right] = L[left] = L[right] = L[k]
        L[k] = -1
        return
    if(k < N1):
        A[left] = A[right] = L[k]
        L[k] = -1

def update(s,t,x,k,l,r):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N1):
            L[k] = x
        return

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    update(s, t, x, left, l, mid)
    update(s, t, x, right, mid, r)

    A[k] = min(A[left], A[right])

def find(s,t,k,l,r):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return A[k]

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    v_left = find(s, t, left, l, mid)
    v_right = find(s, t, right, mid, r)
    return min(v_left,v_right)

res = []
for q in Q:
    # update
    if(q[0]==0):
        update(q[1],q[2]+1,q[3],0,0,N)
    # find
    else:
        res.append(find(q[1],q[2]+1,0,0,N))

print("\n".join([str(r) for r in res]))

Buggy python submission (verdict: Time Limit Exceeded):
INT_MAX = (1<<31) - 1
_N,query_num = map(int, input().split())
queries = [list(map(int, input().split())) for i in range(query_num)]
N = 1<<17

arr_size = 2*N - 1
A = [INT_MAX]*(arr_size)
lazy_A = [None]*(arr_size)

def tree_propagate(k):
    if(lazy_A[k] is None):
        return
    if(k < N // 2):
        A[k*2+1] = A[k*2+2] = lazy_A[k*2+1] = lazy_A[k*2+2] = lazy_A[k]
        lazy_A[k] = None
        return
    if(k < N-1):
        A[k*2+1] = A[k*2+2] = lazy_A[k]
        lazy_A[k] = None

def update(s,t,x,k,l,r):
    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N-1):
            lazy_A[k] = x
        return

    tree_propagate(k)
    center = (l+r)//2
    update(s, t, x, k*2 + 1, l, center)
    update(s, t, x, k*2 + 2, center, r)
    A[k] = min(A[k*2+1], A[k*2+2])

def find(s,t,k,l,r):
    if (r <= s or t <= l):
        return INT_MAX
    if(s <= l and r <= t):
        return A[k]

    tree_propagate(k)
    center = (l+r)//2
    v_left = find(s, t, k*2 + 1, l, center)
    v_right = find(s, t, k*2 + 2, center, r)
    return min(v_left,v_right)

answers = []
for query in queries:
    if(query[0]==0):
        update(query[1],query[2]+1,query[3],0,0,N)
    else:
        answers.append(find(query[1],query[2]+1,0,0,N))

print("\n".join([str(ans) for ans in answers]))



Fixed submission:
import sys
input = sys.stdin.readline
INT_MAX = (1<<31) - 1
_N,num = map(int, input().split())
Q = [list(map(int, input().split())) for i in range(num)]
N = 1<<17
N1 = N - 1
N2 = N1 // 2
ars = 2*N - 1
A = [INT_MAX]*(ars)
L = [-1]*(ars)

def propagate(k):

    if(L[k] == -1):
        return
    left = k*2+1
    right = k*2+2
    if(k < N2):
        A[left] = A[right] = L[left] = L[right] = L[k]
        L[k] = -1
        return
    if(k < N1):
        A[left] = A[right] = L[k]
        L[k] = -1

def update(s,t,x,k,l,r):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N1):
            L[k] = x
        return

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    update(s, t, x, left, l, mid)
    update(s, t, x, right, mid, r)

    A[k] = min(A[left], A[right])

def find(s,t,k,l,r):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return A[k]

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    v_left = find(s, t, left, l, mid)
    v_right = find(s, t, right, mid, r)
    return min(v_left,v_right)

res = []
for q in Q:
    # update
    if(q[0]==0):
        update(q[1],q[2]+1,q[3],0,0,N)
    # find
    else:
        res.append(find(q[1],q[2]+1,0,0,N))

print("\n".join([str(r) for r in res]))

Buggy python submission (verdict: Time Limit Exceeded):
INT_MAX = (1<<31) - 1
_N,query_num = map(int, input().split())
queries = [list(map(int, input().split())) for i in range(query_num)]
N = 1<<17
N1 = N - 1
N2 = N1 // 2
arr_size = 2*N - 1
A = [INT_MAX]*(arr_size)
lazy_A = [-1]*(arr_size)

def tree_propagate(k):

    if(lazy_A[k] == -1):
        return

    if(k < N2):
        A[k*2+1] = A[k*2+2] = lazy_A[k*2+1] = lazy_A[k*2+2] = lazy_A[k]
        lazy_A[k] = -1
        return
    if(k < N1):
        A[k*2+1] = A[k*2+2] = lazy_A[k]
        lazy_A[k] = -1

def update(s,t,x,k,l,r):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N1):
            lazy_A[k] = x
        return

    tree_propagate(k)
    center = (l+r)//2
    update(s, t, x, k*2 + 1, l, center)
    update(s, t, x, k*2 + 2, center, r)

    A[k] = min(A[k*2+1], A[k*2+2])

def find(s,t,k,l,r):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return A[k]

    tree_propagate(k)
    center = (l+r)//2
    v_left = find(s, t, k*2 + 1, l, center)
    v_right = find(s, t, k*2 + 2, center, r)
    return min(v_left,v_right)

answers = []
for query in queries:
    if(query[0]==0):
        update(query[1],query[2]+1,query[3],0,0,N)
    else:
        answers.append(find(query[1],query[2]+1,0,0,N))

print("\n".join([str(ans) for ans in answers]))


Fixed submission:
import sys
input = sys.stdin.readline
INT_MAX = (1<<31) - 1
_N,num = map(int, input().split())
Q = [list(map(int, input().split())) for i in range(num)]
N = 1<<17
N1 = N - 1
N2 = N1 // 2
ars = 2*N - 1
A = [INT_MAX]*(ars)
L = [-1]*(ars)

def propagate(k):

    if(L[k] == -1):
        return
    left = k*2+1
    right = k*2+2
    if(k < N2):
        A[left] = A[right] = L[left] = L[right] = L[k]
        L[k] = -1
        return
    if(k < N1):
        A[left] = A[right] = L[k]
        L[k] = -1

def update(s,t,x,k,l,r):

    if (r <= s or t <= l):
        return
    if (s <= l and r <= t):
        A[k] = x
        if(k < N1):
            L[k] = x
        return

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    update(s, t, x, left, l, mid)
    update(s, t, x, right, mid, r)

    A[k] = min(A[left], A[right])

def find(s,t,k,l,r):

    if (r <= s or t <= l):
        return INT_MAX

    if(s <= l and r <= t):
        return A[k]

    propagate(k)
    mid = (l+r)//2
    left = k*2 + 1
    right = k*2 + 2
    v_left = find(s, t, left, l, mid)
    v_right = find(s, t, right, mid, r)
    return min(v_left,v_right)

res = []
for q in Q:
    # update
    if(q[0]==0):
        update(q[1],q[2]+1,q[3],0,0,N)
    # find
    else:
        res.append(find(q[1],q[2]+1,0,0,N))

print("\n".join([str(r) for r in res]))