Buggy python submission (verdict: Time Limit Exceeded):
#-*-coding:utf-8-*-
import bisect

def main():

    n = int(input())
    a_list = list(map(int, input().split()))
    b_list = list(map(int, input().split()))
    c_list = list(map(int, input().split()))

    a_list.sort()
    b_list.sort()
    c_list.sort()

    cnt = 0
    
    for i in range(n):
        for j in range(n):
            if a_list[i] < b_list[j]:
                position = bisect.bisect_right(c_list, b_list[j])
                cnt += n - position
    
    print(cnt)
    

if __name__ == '__main__':
    main()

Fixed submission:
#-*-coding:utf-8-*-
import bisect

def main():

    n = int(input())
    a_list = list(map(int, input().split()))
    b_list = list(map(int, input().split()))
    c_list = list(map(int, input().split()))

    a_list.sort()
    b_list.sort()
    c_list.sort()

    cnt = 0
    
    for b in b_list:
        i = bisect.bisect_left(a_list, b)
        j = n - bisect.bisect_right(c_list, b)
        cnt += i * j
    
    print(cnt)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#-*-coding:utf-8-*-

def main():
    n = int(input())
    a_list = list(set(list(map(int, input().split()))))
    b_list = list(set(list(map(int, input().split()))))
    c_list = list(set(list(map(int, input().split()))))

    a_list.sort()
    b_list.sort()
    c_list.sort()

    cnt = 0

    for i in range(n):
        for j in range(n):
            if a_list[i] < b_list[j]:
                for k in range(n):
                    if b_list[j] < c_list[k]:
                        cnt += n - k
                        break
    
    print(cnt)


if __name__ == '__main__':
    main()

Fixed submission:
#-*-coding:utf-8-*-
import bisect

def main():

    n = int(input())
    a_list = list(map(int, input().split()))
    b_list = list(map(int, input().split()))
    c_list = list(map(int, input().split()))

    a_list.sort()
    b_list.sort()
    c_list.sort()

    cnt = 0
    
    for b in b_list:
        i = bisect.bisect_left(a_list, b)
        j = n - bisect.bisect_right(c_list, b)
        cnt += i * j
    
    print(cnt)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#-*-coding:utf-8-*-

def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    b_list = list(map(int, input().split()))
    c_list = list(map(int, input().split()))

    a_list.sort()
    b_list.sort()
    c_list.sort()

    cnt = 0

    for i in range(n):
        for j in range(n):
            if a_list[i] < b_list[j]:
                for k in range(n):
                    if b_list[j] < c_list[k]:
                        cnt += n - k
                        break
    
    print(cnt)


if __name__ == '__main__':
    main()

Fixed submission:
#-*-coding:utf-8-*-
import bisect

def main():

    n = int(input())
    a_list = list(map(int, input().split()))
    b_list = list(map(int, input().split()))
    c_list = list(map(int, input().split()))

    a_list.sort()
    b_list.sort()
    c_list.sort()

    cnt = 0
    
    for b in b_list:
        i = bisect.bisect_left(a_list, b)
        j = n - bisect.bisect_right(c_list, b)
        cnt += i * j
    
    print(cnt)
    
if __name__ == '__main__':
    main()