Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
ans = 0
right = 0
# print(l_list)
for i in range(n-2):
    for j in range(i+1,n-1):
        right = bisect.bisect_left(l_list[j+1:],l_list[i]+l_list[j])
        # print(right)
        ans += right
        
print(ans)

Fixed submission:
import bisect
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
ans = 0
right = 0
# print(l_list)
for i in range(n-2):
    for j in range(i+1,n-1):
        right = bisect.bisect_left(l_list[j+1:],l_list[i]+l_list[j])
        # print(right)
        ans += right
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort(reverse=True)
temp_sum = 0
check_break = 0
for i in range(n-2):
    check_break = 0
    for j in range(i+1,n-1):
        if check_break == 1:
            break
        # print(temp_sum)
        for k in range(j+1,n):
            if l_list[k] > l_list[i] - l_list[j]:
                temp_sum += 1
            elif k == j+1:
                check_break = 1
                break
            else:
                break


print(temp_sum)


Fixed submission:
import bisect
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
ans = 0
right = 0
# print(l_list)
for i in range(n-2):
    for j in range(i+1,n-1):
        right = bisect.bisect_left(l_list[j+1:],l_list[i]+l_list[j])
        # print(right)
        ans += right
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l_list = list(map(int,input().split()))
temp_sum = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        
        # print(temp_sum)
        for k in range(j+1,n):
            if l_list[i] < l_list[j] + l_list[k] and l_list[j] < l_list[k] + l_list[i] and l_list[k] < l_list[j] + l_list[i]:
                temp_sum += 1


print(temp_sum)


Fixed submission:
import bisect
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
ans = 0
right = 0
# print(l_list)
for i in range(n-2):
    for j in range(i+1,n-1):
        right = bisect.bisect_left(l_list[j+1:],l_list[i]+l_list[j])
        # print(right)
        ans += right
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort(reverse=True)
temp_sum = 0
check_break = 0
for i in range(n-2):
    check_break = 0
    for j in range(i+1,n-1):
        if check_break == 1:
            break
        # print(temp_sum)
        for k in range(j+1,n):
            if l_list[k] > l_list[i] - l_list[j]:
                temp_sum += 1
            elif k == j+1:
                check_break = 1
                break
            else:
                break


print(temp_sum)

Fixed submission:
import bisect
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
ans = 0
right = 0
# print(l_list)
for i in range(n-2):
    for j in range(i+1,n-1):
        right = bisect.bisect_left(l_list[j+1:],l_list[i]+l_list[j])
        # print(right)
        ans += right
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
temp_sum = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        
        # print(temp_sum)
        for k in range(j+1,n):
            if l_list[k] < l_list[i] + l_list[j]:
                temp_sum += 1
            else:
                break


print(temp_sum)

Fixed submission:
import bisect
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
ans = 0
right = 0
# print(l_list)
for i in range(n-2):
    for j in range(i+1,n-1):
        right = bisect.bisect_left(l_list[j+1:],l_list[i]+l_list[j])
        # print(right)
        ans += right
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l_list = list(map(int,input().split()))
temp_sum = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        
        # print(temp_sum)
        for k in range(j+1,n):
            if l_list[i] < l_list[j] + l_list[k] and l_list[j] < l_list[k] + l_list[i] and l_list[k] < l_list[j] + l_list[i]:
                temp_sum += 1


print(temp_sum)


Fixed submission:
import bisect
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
ans = 0
right = 0
# print(l_list)
for i in range(n-2):
    for j in range(i+1,n-1):
        right = bisect.bisect_left(l_list[j+1:],l_list[i]+l_list[j])
        # print(right)
        ans += right
        
print(ans)