Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left
N = input()
t_list = list ( map ( int, input().split() ) )
t_list.sort()

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)


Fixed submission:
from bisect import bisect_left
N = int ( input() )
t_list = list ( map ( int, input().split() ) )
t_list.sort()
ans = 0

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)

Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left
N = input()
t_list = list ( map ( int, ipnut().split() ) )
t_list.sort()

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)


Fixed submission:
from bisect import bisect_left
N = int ( input() )
t_list = list ( map ( int, input().split() ) )
t_list.sort()
ans = 0

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)

Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left
N = input()
t_list = list ( map ( int, ipnut().split() ) )
t_list.sort()

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans = c - j - 1
    
print(ans)

Fixed submission:
from bisect import bisect_left
N = int ( input() )
t_list = list ( map ( int, input().split() ) )
t_list.sort()
ans = 0

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def compose():
    N = int( input() )
    t_list = list( map( int, input().split() ) )
    t_list.sort()
    t_list.reverse()
    counter = 0
    a = 0
    for i in t_list:
        a += 1
        b = a
        for j in t_list[a:]:
            b += 1
            new_list = [ k for k in t_list[b:] if k > i - j ]
            counter += len(new_list)
    return counter

def main():
    print(compose())
    
main()

Fixed submission:
from bisect import bisect_left
N = int ( input() )
t_list = list ( map ( int, input().split() ) )
t_list.sort()
ans = 0

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int( input() )
t_list = list( map( int, input().split() ) )
counter = 0
a = 0
b = 1
for i in t_list:
  a += 1
  b = a
  for j in t_list[a:]:
    b += 1
    for k in t_list[b:]:
      if i < j + k:
        if j < i + k:
          if k < i + j:
            counter += 1
            
print(counter)
          
  


Fixed submission:
from bisect import bisect_left
N = int ( input() )
t_list = list ( map ( int, input().split() ) )
t_list.sort()
ans = 0

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int( input() )
list_t = list( map (int, input().split() )
counter = 0 
a = del list_t[0]
b = del list_t[0:2]
for i in list_t:
	for j in a:
		for k in b:
            if i == (len(list_t) - 3):
              break
            else:
              if i < j + k and j < i + k:
            	if k < i + j:
                	counter += 1
    a = del a[0]
    b = del b[0]

print ( counter )


Fixed submission:
from bisect import bisect_left
N = int ( input() )
t_list = list ( map ( int, input().split() ) )
t_list.sort()
ans = 0

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int( input() )
list_t = list( map (int, input().split() )
counter = 0 
a = del list_t[0]
b = del list_t[0:2]
for i in list_t:
	for j in a:
		for k in b:
            if i == (len(list_t) - 3)
              break
            else:
              if i < j + k and j < i + k:
            	if k < i + j:
                	counter += 1
    a = del a[0]
    b = del b[0]

print ( counter )

Fixed submission:
from bisect import bisect_left
N = int ( input() )
t_list = list ( map ( int, input().split() ) )
t_list.sort()
ans = 0

for i in range ( N - 2 ):
  a = t_list[i]
  for j in range ( i + 1, N - 1 ):
    b = t_list[j]
    c = bisect_left ( t_list , a + b)
    ans += c - j - 1
    
print(ans)