Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int( input() )
l = [[]] * n
for i in range( n ):
  a = int( input() )
  k = [ -1 ] * n
  for _ in range( a ):
    x, y = map( int, input().split() )
    k[ x - 1 ] = y
  l[ i ] = k

ret = 0
for i in range( 2 ** n - 1, 0, -1 ):
  o = [int(i) for i in str( "{:b}".format(i).zfill(n) )]
  is_right = True
  for j in range( n ):
    for m in range( n ):
      if o[j] == 1:
        is_rzight &= ( l[j][m] in [-1, o[m]] )
    if not is_right:
      break
        
  if is_right:
    ret = sum(o)
    break
          
print( ret )


Fixed submission:
n = int( input() )
l = [[]] * n
for i in range( n ):
  a = int( input() )
  k = [ -1 ] * n
  for _ in range( a ):
    x, y = map( int, input().split() )
    k[ x - 1 ] = y
  l[ i ] = k

ret = 0
for i in range( 2 ** n - 1, 0, -1 ):
  o = [int(i) for i in str( "{:b}".format(i).zfill(n) )]
  is_right = True
  for j in range( n ):
    for m in range( n ):
      if o[j] == 1:
        is_right &= ( l[j][m] in [-1, o[m]] )
    if not is_right:
      break
        
  if is_right:
    ret = sum(o)
    break
          
print( ret )
Buggy python submission (verdict: Runtime Error):
a, b = map( int, input())

print( max( 0, a - 2 * b ))


Fixed submission:
a, b = map( int, input().split())
print( max( 0, a - b * 2 ))

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())


print(min( 0, a - 2 * b ))
  

Fixed submission:
a, b = map( int, input().split())
print( max( 0, a - b * 2 ))
Buggy python submission (verdict: Time Limit Exceeded):
n = int( input() )
l = list( map( int, input().split() ) )
 
l = sorted( l )
cnt = 0
for i in range( n ):
  for j in range( i + 1, n ):
    for k in range( j + 1, n ):
      if l[ i ] + l[ j ] <= l[ k ]:
        break
      else:
        cnt += 1

print( cnt )

Fixed submission:
import bisect
n = int( input() )
l = sorted( list( map( int, input().split() ) ))

cnt = 0
for i in range( n ):
  for j in range( i + 1, n ):
    cnt += bisect.bisect_left( l, l[ i ] + l[ j ] ) - ( j + 1 )
    
print( cnt )
Buggy python submission (verdict: Runtime Error):
A, B = map( int, input().split() )

# Euclid
a = max( A, B )
b = min( A, B )
r = a % b
while r != 0:
  a = b
  b = r
  r = a % b

prime = [0] * ( b + 1 )
for i in range( b + 1 ):
  prime[i] = i

for i in range( 2, b + 1 ):
  for k in range( 2, b + 1 ):
    if len( prime ) > i * k:
      prime[ i * k ] = 0
    else:
      break
prime = set( prime )
prime.remove( 0 )

cnt = 0
for i in prime:
  if ( ( A % i ) == 0 ) and ( ( B % i ) == 0 ):
    cnt += 1

print( cnt )


Fixed submission:
import math
A, B = map( int, input().split() )
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    if ( n!=1 ) and ( arr==[] ):
        arr.append(n)

    return set( arr )

a = factorization(A)
b = factorization(B)
cnt = 0
for i in a:
  if i in b:
    cnt += 1

print( cnt + 1 )
Buggy python submission (verdict: Runtime Error):
s = input()

oddStep = ['R','U','D']
evenStep = ['L','U','D']
CNST_NO = 'No'
CNST_YES = 'Yes'
good_step = CNST_NO

for i, c in s:
  if i % 2 == 0:
    if c in oddStep:
		good_step = CNST_YES
  else:
    if c in evenStep:
		good_step = CNST_YES
  if good_step==CNST_YES:
    break
print( good_step )


Fixed submission:
s = input()
 
oddStep = ['R','U','D']
evenStep = ['L','U','D']
CNST_NO = 'No'
CNST_YES = 'Yes'
good_step = CNST_YES
 
for i in range( len( s ) ):
  if i % 2 == 1: # 0 start
    if not ( s[ i ] in evenStep ):
      good_step = CNST_NO
  else:
    if not( s[ i ] in oddStep ):
      good_step = CNST_NO
  if good_step == CNST_NO:
    break
print( good_step )
Buggy python submission (verdict: Runtime Error):
n = input()

a = list( map( int, input.split()))
b = list( map( int, input.split()))
c = list( map( int, input.split()))

satisfaction = 0
for i in a:
  satisfaction += b[ i ]
  if i > 0:
    if a[ i ] == a[ i - 1 ] + 1:
    satisfaction += c[ i ]
print( satisfaction )

Fixed submission:
n = input()
 
a = list( map( int, input().split()))
b = list( map( int, input().split()))
c = list( map( int, input().split()))
 
satisfaction = 0
for i in range( len( a )):
  a_i = a[ i ] - 1
  satisfaction += b[ a_i ]
  if i > 0:
    if a[ i ] == a[ i - 1 ] + 1:
      satisfaction += c[ a_i - 1 ]
print( satisfaction )
Buggy python submission (verdict: Time Limit Exceeded):
N = int( input() )
 
I = range( 1, N + 1 )
P = [ i for i in range(2, N + 1) ] + [ 1 ]
 
cnt = 0
for i in range( N ):
  cnt = cnt + I[ i ] % P[ i ]

print( cnt )

Fixed submission:
N = int( input() )
print( N * ( N - 1 ) // 2 )

Buggy python submission (verdict: Runtime Error):
N = int( input() )
 
I = range( 1, N + 1 )
P = [ i for i in range(2, N + 1) ] + [ 1 ]
 
cnt = 0
for i in range( N ):
  cnt =　cnt + I[ i ] % P[ i ]

print( cnt )

Fixed submission:
N = int( input() )
print( N * ( N - 1 ) // 2 )

Buggy python submission (verdict: Time Limit Exceeded):
N = int( input() )

I = range( 1, N + 1 )
P = [ i for i in range(2, N + 1) ] + [ 1 ]

cnt = 0
for i in range( N ):
  cnt += I[ i ] % P[ i ]

print( cnt )

Fixed submission:
N = int( input() )
print( N * ( N - 1 ) // 2 )
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
sntlist = [ input() for i in range( n ) ]

def is_anagram( a, b ):
    for chr in a:
        if a.count( chr ) != b.count( chr ):
            return False
    return True

count = 0
listcnt = len(sntlist)
for i in range( listcnt-1 ):
    for j in range( i+1, listcnt ):
        if is_anagram( sntlist[i], sntlist[j] ):
            count += 1
print(count)

Fixed submission:
n = int(input())
strList = [input() for i in range(n)]

dict = {} 
for i in range(n):
  charList = list(strList[i])
  charList.sort()
  key = "".join(charList)
  if not key in dict:
    dict[key] = 1
  else:
    dict[key] += 1  
 
count = 0;
for v in dict.values():
  count += (v * (v-1) // 2)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

sntlist = []
for i in range( n ):
    sntlist.append( input() )

def is_anagram( a, b ):
    for chr in a:
        if a.count( chr ) != b.count( chr ):
            return False
    return True

count = 0
for i in range( len( sntlist )-1 ):
    for j in range( i+1, len(sntlist) ):
        if is_anagram( sntlist[i], sntlist[j] ):
            count += 1
print(count)


Fixed submission:
n = int(input())
strList = [input() for i in range(n)]

dict = {} 
for i in range(n):
  charList = list(strList[i])
  charList.sort()
  key = "".join(charList)
  if not key in dict:
    dict[key] = 1
  else:
    dict[key] += 1  
 
count = 0;
for v in dict.values():
  count += (v * (v-1) // 2)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map( int, input().split() )
L = [[]] * M

for i in range( N ):
  a, b = map( int, input().split() )
  if a - 1 < M:
    if L[ a - 1 ] == []:
      L[ a - 1 ] = [ b ]
    else:
      L[ a - 1 ].append( b )
      
ret = 0
C = []
for i in range( M ):
  C = sorted( L[i] + C )
  if C != []:
    ret += C.pop( -1 )

print( ret )


Fixed submission:
import heapq as hp

N, M = map( int, input().split() )
L = [[]] * M

for i in range( N ):
  a, b = map( int, input().split() )
  if a - 1 < M:
    if L[ a - 1 ] == []:
      L[ a - 1 ] = [ b ]
    else:
      L[ a - 1 ].append( b )
      
ret = 0
C = []
hp.heapify( C )
for i in range( M ):
  for i in L[i]:
    hp.heappush( C, -i)
  if C != []:
    ret -= hp.heappop( C )

print( ret )
Buggy python submission (verdict: Runtime Error):
a, b, c = map( int, input().split())

print( max( 0, c - ( a - b ) )

Fixed submission:
a, b, c = map( int , input().split())

print( max( 0, c - ( a - b )))
Buggy python submission (verdict: Runtime Error):
N, K = map( int, input().split() )
MOD = 10 ** 9 + 7
 
def Combi( n, r ):
  n1 = 1
  n2 = 1
  for i in range( 1, min( n - k, k ) + 1 ):
    n1 = n1 * i % MOD
    n2 = n2 * ( n - i + 1 ) % MOD
  return ( n2 * pow( n1, MOD - 2, MOD ) ) % MOD
 
for i in range( 1, K + 1 ):
  if K - N + 1 >= i:
    print( ( Combi( N - K + 1, i ) * Combi( K - 1, i - 1 ) ) % MOD )
  else:
    print( 0 )

Fixed submission:
N, K = map( int, input().split() )
MOD = 10 ** 9 + 7
 
def Combi( n, r ):
  n1 = 1
  n2 = 1
  for i in range( 1, r + 1 ):
    n1 = n1 * i % MOD
    n2 = n2 * ( n - i + 1 ) % MOD
  return ( n2 * pow( n1, MOD - 2, MOD ) ) % MOD
 
for i in range( 1, K + 1 ):
  if N - K + 1 >= i:
    print( ( Combi( N - K + 1, i ) * Combi( K - 1, i - 1 ) ) % MOD )
  else:
    print( 0 )
Buggy python submission (verdict: Runtime Error):
N, M = map( int, input().split() )
a = list( map( int, input().split() ) )
 
d = []
for i in range( M ):
  b, c = map( int, input().split() )
  d += [ c ] * b
d.sort()
a += d
a.sort()
print(sum(a[-N:]))

Fixed submission:
a, b = map(int, input().split())

price = b
if ( 6 <= a ) & ( a <= 12 ):
  price //=2
elif ( a < 6 ):
  price = 0

print(price)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

left  = 0
right = n
for i in range(m):z
  l, r = map( int, input().split() )
  left = max( left, l )
  right = min( right, r )

print( right - left + 1 )

Fixed submission:
n, m = map(int, input().split())
 
left  = 0
right = n
for i in range(m):
  l, r = map( int, input().split() )
  left = max( left, l )
  right = min( right, r )

ans =  right - left + 1
if ans <= 0:
  ans = 0
print( ans )
Buggy python submission (verdict: Runtime Error):
n = int( input() )
a = sorted( list( map( int, input().split())))

import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print( gcd_list(  a ) )

Fixed submission:
n = int( input() )
a = sorted( list( map( int, input().split())))

res = a[0]

while True:
    base = res
    total = 0
    for i in a:
        if  i % base > 0:
            res = min( res, i % base)
        total +=  i % base
    if total == 0:
        break

print(base)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

n = int( input() )
a = sorted( list( map( int, input().split())))

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print( gcd_list(  a ) )

Fixed submission:
n = int( input() )
a = sorted( list( map( int, input().split())))

res = a[0]

while True:
    base = res
    total = 0
    for i in a:
        if  i % base > 0:
            res = min( res, i % base)
        total +=  i % base
    if total == 0:
        break

print(base)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map( int, input().split() )
h = list( map( int, input().split() ))
 
l = [0] + [ 10**18 ] * ( N - 1 )
for i in range( N ):
  for j in range( 1, K + 1 ):
    if i - j >= 0:
      l[ i ] = min( l[ i ], l[ i - j ] + abs( h[ i ] - h[ i - j ]))
 
print( l[ - 1 ] )

Fixed submission:
N, K, *h = map( int, open( 0 ).read().split() )

d = [ 0 ] + [ 10**18 ] * ( N - 1 )
for i in range( N ):
  for k in range( 1, K + 1 ):
    if i - k >= 0: 
      d[ i ] = min( abs( h[ i ] - h[ i - k ] ) + d[ i - k ], d[ i ] )
print( d[-1] )

Buggy python submission (verdict: Time Limit Exceeded):
N, K, *h = map( int, open( 0 ).read().split() )

d = [ 0 ] + [ 10**18 ] * ( N - 1 )
for i in range( N ):
  for k in range( 1, K + 1 ):
    if i - k >= 0: 
      d[ i ] = min( abs( h[ i ] - h[ i - k ] ) + d[ i - k ], d[ i ] )
print( d[-1] )

Fixed submission:
N, K, *h = map( int, open( 0 ).read().split() )

d = [ 0 ] + [ 10**18 ] * ( N - 1 )
for i in range( N ):
  for k in range( 1, K + 1 ):
    if i - k >= 0: 
      d[ i ] = min( abs( h[ i ] - h[ i - k ] ) + d[ i - k ], d[ i ] )
print( d[-1] )
Buggy python submission (verdict: Time Limit Exceeded):
N, W, *t = map( int, open( 0 ).read().split() )
d = [[ 0 for _ in range( W + 1 ) ] for _ in range( N + 1 ) ]
ans = 0

i = 0
for w, v in zip( *[ iter( t )] * 2 ):
  for j in range( 1, W + 1 ):
    d[ i + 1 ][ j ] = d[ i ][ j ]
    if j - w >= 0:
      d[ i + 1 ][ j ] = max( d[ i ][ j - w ] + v, d[ i ][ j ] )
  i += 1
print( d[N][W])

Fixed submission:
N, W, *t = map( int, open( 0 ).read().split() )
d = [[ 0 for _ in range( W + 1 ) ] for _ in range( N + 1 ) ]
ans = 0
 
i = 0
for w, v in zip( *[ iter( t )] * 2 ):
  for j in range( 1, W + 1 ):
    d[ i + 1 ][ j ] = d[ i ][ j ]
    if j - w >= 0:
      d[ i + 1 ][ j ] = max( d[ i ][ j - w ] + v, d[ i ][ j ] )
  i += 1
print( d[N][W])
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map( int, input().split() )
x = list( map( int, input().split() ))
 
ret = 10 ** 18
for i in range( N - K + 1 ):
  s = x[ i: K + i ]
  l, r = s[ 0 ], s[ K - 1 ]
  ret = min( ret, abs( l - r ) + min( abs( r ), abs( l ) ) )
print( ret )

Fixed submission:
N, K = map( int, input().split() )
x = list( map( int, input().split() ))
 
ret = 10 ** 18
for i in range( N - K + 1 ):
  l, r = x[i], x[ K + i - 1 ]
  ret = min( ret, abs( l - r ) + min( abs( r ), abs( l ) ) )
print( ret )

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map( int, input().split() )
x = list( map( int, input().split() ))

'''
x = sorted( x, key = lambda x: abs(x) )[ : K ]
x.sort()

m, M = x[ 0 ], x[ - 1 ]
print( abs( M - m ) + min( abs( m ), abs( M ) ))
'''

ret = 10 ** 18
for i in range( N - K + 1 ):
  s = x[ i: K + i ]
  l, r = s[0], s[ -1 ]
  ret = min( ret, abs( l - r ) + min( abs( r ), abs( l ) ) )
print( ret )

Fixed submission:
N, K = map( int, input().split() )
x = list( map( int, input().split() ))
 
ret = 10 ** 18
for i in range( N - K + 1 ):
  l, r = x[i], x[ K + i - 1 ]
  ret = min( ret, abs( l - r ) + min( abs( r ), abs( l ) ) )
print( ret )
Buggy python submission (verdict: Runtime Error):
A, B, C, X, Y = map( int, input().split() )

if A + B > 2 * C:
  m = min( X, Y )
  print( min( 2 * C * m + ( X - m ) * A + ( Y - m ) * B, 
              2 * C * m + ( X - m ) * 2 * C + ( Y - m ) * 2 * C ) )
else:
  print( X * A + Y * B )

Fixed submission:
N = int( input() )
S = input()

R = len( S.replace("W", "") ) 
L = 0
ret = L + R 
for i in range( N ):
  if S[ i ] == "E":
    R -= 1
  ret = min( ret, L + R )
  if S[ i ] == "W":
    L += 1

print( ret )
Buggy python submission (verdict: Runtime Error):
s = input()
N = len( s )
K = int( input() )

s_set = set()
for i in range( N - K + 1 ):
  for j in range( 1, K + 1 ):
    t = s[ i : i + j ]
    s_set.add(t)

print( sorted( list( s_set ) )[ K - 1 ] )

Fixed submission:
s = input()
N = len( s )
K = int( input() )

s_set = set()
for j in range( 1, K + 1 ):
  for i in range( N - j + 1 ):
    t = s[ i : i + j ]
    s_set.add(t)

print( sorted( list( s_set ) )[ K - 1 ] )
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = int(input())
a = list( map( int, input().split()) )
b = list( map( int, input().split()) )
c = list( map( int, input().split()) )

a.sort()
b.sort()
c.sort()

total = 0
for i in c:
  index_b = bisect.bisect( b, i-1 )
  for j in b[:index_b]:
    index_c = bisect.bisect( a, j-1 )
    total += index_c
print(total)
    

Fixed submission:
import bisect

n = int(input())
a = sorted( list( map( int, input().split()) ))
b = sorted( list( map( int, input().split()) ))
c = sorted( list( map( int, input().split()) ))

total = 0
for i in b:
  index_a = bisect.bisect_right( a, i-1 )
  index_c = n - bisect.bisect_left( c, i+1 )
  total += index_a * index_c
print(total)
Buggy python submission (verdict: Runtime Error):
n=input()
length=len(n)
rs=0
for i in range(1,length-2):
    num=0
    start=0
    end=length-i
    gap=length-end
    for j in range(i):
        num=int(n[start+j:end+1+j])
        if num%2019==0:
            rs+=1
print(rs)

Fixed submission:
def compare():
    a,b=map(int,input().split())

    if a <= b:
        print("unsafe")
    else:
        print("safe")


compare()
Buggy python submission (verdict: Runtime Error):
a=map(int,input().split(" "))
Ai=map(int,input().split(" "))
n=a[0]
days=0
for i in range(a[1]):
    days+=Ai[i]
if days>n:
    print(-1)
else:
    print(n-days)

Fixed submission:
n,m=map(int,input().split(" "))
Ai=list(map(int,input().split(" ")))
days=0
for a in Ai:
    days+=a
if days>n:
    print(-1)
else:
    print(n-days)

Buggy python submission (verdict: Runtime Error):
a=map(int,input().split(" "))
Ai=map(int,input().split(" "))
n=a[0]
days=0
for A in Ai:
    days+=A
if days>n:
    print(-1)
else:
    print(n-days)

Fixed submission:
n,m=map(int,input().split(" "))
Ai=list(map(int,input().split(" ")))
days=0
for a in Ai:
    days+=a
if days>n:
    print(-1)
else:
    print(n-days)
Buggy python submission (verdict: Time Limit Exceeded):
def inlist(lista,item):
    for i in lista:
        if item==i:
            return True
    return False


itemsList=[]
num=int(input())
for i in range(num):
    temp=input()
    if not inlist(itemsList,temp):
        itemsList.append(temp)
print(len(itemsList))


Fixed submission:


itemsList={}
num=int(input())
for i in range(num):
    temp=input()
    if not temp in itemsList:
        itemsList[temp]=1
print(len(itemsList))
Buggy python submission (verdict: Runtime Error):
import math

def fac(x):
    if x<=1:
        return 1
    s=1
    for i in range(1,x+1):
        s=s*i
    return s
def com(m,n):
    return fac(m)/(fac(n)*fac(m-n))

temps=input().split()
n=int(temps[0])
m=int(temps[1])
sum=0
for i in range(m,n+1):
    sum=sum+com(n+1,i)
print(int(sum%(math.pow(10,9)+7)))



Fixed submission:
import math

def fac(x):
    if x<=1:
        return 1
    s=1
    for i in range(1,x+1):
        s=s*i
    return s
def com(m,n):
    return fac(m)/(fac(n)*fac(m-n))


temps=input().split()
n=int(temps[0])
m=int(temps[1])
sum=0
for i in range(m,n+2):
    min=int((i-1)*i/2)
    max=int((2*n-i+1)*i/2)
    sum=sum+max-min+1
print(int(sum%(math.pow(10,9)+7)))
Buggy python submission (verdict: Runtime Error):
def cal():
    k = int(input())
    string = input()
    if len(string) <= k:
        print(string)
    else:
        list1 = list(string)
        for i in range(k):
            print(list1[i], end='')
        print("...")

cal()

Fixed submission:
def cal():

    num = int(input())
    if num >= 10:
        ben = num % 10
    else:
        ben = num
    
    if ben == 3:
        print("bon")
    elif ben == 0 or ben == 1 or ben == 6 or ben == 8:
        print("pon")
    elif ben == 2 or ben == 4 or ben == 5 or ben == 7 or ben == 9:
        print("hon")
    


cal()

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=N%10
if a<10:
	if a==2 or a==4 or a==5 or a==7 or a==9:
    	print("hon")
    else if a==0 or a==1 or a==6 or a==8:
    	print("pon")
    else:
    	print("bon")


        
     
	

Fixed submission:
def cal():

    num = int(input())
    if num >= 10:
        ben = num % 10
    else:
        ben = num
    
    if ben == 3:
        print("bon")
    elif ben == 0 or ben == 1 or ben == 6 or ben == 8:
        print("pon")
    elif ben == 2 or ben == 4 or ben == 5 or ben == 7 or ben == 9:
        print("hon")
    


cal()
Buggy python submission (verdict: Runtime Error):
import math
def:
	A B H M=map(int,input().split(" "))
	if H>M/5:
		angle=(H/12-M/60)
	else:
		angle=(M/60-H/12)
    t=math.cos(math.pi*angle)
    d=(A^2+B^2-2AB*t)^0.5
    print(d)
    

Fixed submission:
import math


def cal():
    string = input()
    a, b, h, m = string.split(" ")
    a = int(a)
    b = int(b)
    h = int(h)
    m = int(m)
    minuteAngel = (float(m) * 360) / 60
    hourAngel = (float(h) % 12) * 30 + (float(m) * 30) / 60
    angel = abs(hourAngel - minuteAngel)
    angel=angel/180
    cosine = math.cos(math.pi*angel)
    ans = math.sqrt(a*a + b*b - 2*a*b*cosine)
    print(format(ans, '.20f'))
    # print(angle1)
    # print(angle2)
    # print(angle)
    # print(cosine)

cal()

Buggy python submission (verdict: Runtime Error):
import math
def:
	A B H M=map(int,input().split(" "))
	if H>M/5:
		angle=(H/12-M/60)*360
	else:
		angle=(M/60-H/12)*360
    t=cos(angle)
    d=(A^2+B^2-2AB*t)^0.5
    print(d)
    

Fixed submission:
import math


def cal():
    string = input()
    a, b, h, m = string.split(" ")
    a = int(a)
    b = int(b)
    h = int(h)
    m = int(m)
    minuteAngel = (float(m) * 360) / 60
    hourAngel = (float(h) % 12) * 30 + (float(m) * 30) / 60
    angel = abs(hourAngel - minuteAngel)
    angel=angel/180
    cosine = math.cos(math.pi*angel)
    ans = math.sqrt(a*a + b*b - 2*a*b*cosine)
    print(format(ans, '.20f'))
    # print(angle1)
    # print(angle2)
    # print(angle)
    # print(cosine)

cal()
Buggy python submission (verdict: Time Limit Exceeded):


def cal():
    number = int(input())
    str1 = input()
    strList1 = [str1]
    strList2 = [[strList1[0]]]
    for i in range(number-1):
        flag = 1
        strList1.append(list(map(str, input().rstrip().split())))
        for each in strList2:
            if each == strList1[i + 1]:
                flag = 0
                break
        if flag == 1:
            strList2.append(strList1[i+1])


    print(len(strList2))


cal()




Fixed submission:


def cal():
    number = int(input())
    strList = []
    for i in range(number):
        temp = input()
        strList.append(temp)

    count = {}

    for item in strList:
        count[item] = count.get(item, 0) + 1
    print(len(count))


cal()

Buggy python submission (verdict: Time Limit Exceeded):


def cal():
    number = int(input())
    strList1 = []
    for i in range(number):
        strList1.append(list(map(str, input().rstrip().split())))
    strList2 = [strList1[0]]
    for each in strList1:
        flag = 1
        for item in strList2:
            if item == each:
                flag = 0
                break
        if flag == 1:
            strList2.append(each)
    print(len(strList2))


cal()




Fixed submission:


def cal():
    number = int(input())
    strList = []
    for i in range(number):
        temp = input()
        strList.append(temp)

    count = {}

    for item in strList:
        count[item] = count.get(item, 0) + 1
    print(len(count))


cal()

Buggy python submission (verdict: Time Limit Exceeded):


def cal():
    number = int(input())
    strList1 = []
    for i in range(number):
        strList1.append(list(map(str, input().rstrip().split())))
    strList2 = [strList1[0]]
    for each in strList1:
        flag = 1
        for item in strList2:
            if item == each:
                flag = 0
        if flag == 1:
            strList2.append(each)
    print(len(strList2))


cal()




Fixed submission:


def cal():
    number = int(input())
    strList = []
    for i in range(number):
        temp = input()
        strList.append(temp)

    count = {}

    for item in strList:
        count[item] = count.get(item, 0) + 1
    print(len(count))


cal()

Buggy python submission (verdict: Time Limit Exceeded):


def cal():
    number = int(input())
    strList1 = []
    for i in range(number):
        strList1.append(list(map(str, input().rstrip().split())))
    strList2 = [strList1[0]]
    for each in strList1:
        flag = 1
        for item in strList2:
            if item == each:
                flag = 0
        if flag == 1:
            strList2.append(each)
    print(len(strList2))


cal()




Fixed submission:


def cal():
    number = int(input())
    strList = []
    for i in range(number):
        temp = input()
        strList.append(temp)

    count = {}

    for item in strList:
        count[item] = count.get(item, 0) + 1
    print(len(count))


cal()