Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
limit = int(input())
string = input()

if limit < len(string):
    ans = string[:limit] + '...'

print(ans)

Fixed submission:
limit = int(input())
string = input()

if limit < len(string):
    string = string[:limit] + '...'

print(string)

Buggy python submission (verdict: Runtime Error):
limit = int(input())
string = input()

if limit <= len(string):
    ans = string[:limit] + '...'

print(ans)

Fixed submission:
limit = int(input())
string = input()

if limit < len(string):
    string = string[:limit] + '...'

print(string)

Buggy python submission (verdict: Runtime Error):
limit = int(input())
string = input()

if limit <= len(string):
    print(string[:7] + '...')
else:
    print(stirng)

Fixed submission:
limit = int(input())
string = input()

if limit < len(string):
    string = string[:limit] + '...'

print(string)

Buggy python submission (verdict: Runtime Error):
limit = int(input())
string = input()

if limit < len(string):
    print(string[:7] + '...')
else:
    print(stirng)

Fixed submission:
limit = int(input())
string = input()

if limit < len(string):
    string = string[:limit] + '...'

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

if a % 2 == 0 or b % 2 == 0:
  print('Even')
else:
  print('Odd)
  



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

multiplication = a * b
if multiplication % 2 == 0:
  print('Even')
  
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
from itertools import combinations

def main():
    N = int(input())
    A = tuple(map(int, input().split()))
    answer = solve(N, A)
    print(answer)


def solve(N, A):
    return sum(x * y for x, y in combinations(A, 2)) % (10**9 + 7)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    D, T, S = map(int, input().split())
    answer = solve(D, T, S)
    print(answer)


def solve(D, T, S):
    return 'Yes' if D <= S * T else 'No'


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    S = input()
    answer = solve(S)
    print(answer)


def solve(S):
    assert len(S) == 3
    assert all([x in ('S', 'R') for x in S])

    chain = []
    count = 0
    for i in range(len(S)):
        if S[i] == 'R':
            count += 1
        else:
            chain.append(count)

    return max(chain)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    S = input()
    answer = solve(S)
    print(answer)


def solve(S):
    patterns = {
        'SSS': 0,
        'SSR': 1,
        'SRS': 1,
        'SRR': 2,
        'RRR': 3,
        'RRS': 2,
        'RSR': 1,
        'RSS': 1
    }

    return patterns[S]


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    S = input()
    answer = solve(S)
    print(answer)


def solve(S):
    chain = []
    count = 0
    for i in range(len(S)):
        if S[i] == 'R':
            count += 1
        else:
            chain.append(count)

    return max(chain)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    S = input()
    answer = solve(S)
    print(answer)


def solve(S):
    patterns = {
        'SSS': 0,
        'SSR': 1,
        'SRS': 1,
        'SRR': 2,
        'RRR': 3,
        'RRS': 2,
        'RSR': 1,
        'RSS': 1
    }

    return patterns[S]


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
nums = input().split(" ")
N = int(nums[0])
A = int(nums[1])
B = int(nums[2])
time = 0

while N > (A + B):
  N -= (A + B)
  time += 1
if N - A <= 0:
  print(N + A*time)
else:
  print(A + A*time)

Fixed submission:
nums = input().split(" ")
N = int(nums[0])
A = int(nums[1])
B = int(nums[2])

time = int(N / (A + B))

if time == 0 or (time == 1 and N / (A + B) == 1):
  if N - A <= 0:
    print(N)
  else:
    print(A)
else:
  N -= (A + B) * time
  if N - A <= 0:
    print(N + A*time)
  else:
    print(A + A*time)
Buggy python submission (verdict: Runtime Error):
nums = input().split(" ")
A = int(nums[0])
B = int(nums[1])
K = int(nums[2])

for i in tqdm(range(0,K)):
  if A >= 1:
    A -= 1
  elif B >= 1:
    B -= 1

print(A, end=" ")
print(B)

Fixed submission:
nums = input().split(" ")
A = int(nums[0])
B = int(nums[1])
K = int(nums[2])

"""
ここで、まずはAとKの比較を行って、Aの方が大きければその場で試行は終了
し、Kの方が大きければ、A=0となり、その差|A-K|は残りのBから引くものになる。
"""
if A >= K:
  A -= K
  print(A, end=" ")
  print(B)
else:
  K -= A
  A = 0
  B -= K
  if B < 0:
    B = 0
  print(A, end=" ")
  print(B)
Buggy python submission (verdict: Runtime Error):
nums = [1,2,3]
a = int(input())
b = int(input())
c = 0

for i in nums:
  if i != a || i != b:
    c = i
    
print(c)


Fixed submission:
nums = [1,2,3]
a = int(input())
b = int(input())
c = 0

for i in nums:
  if int(i) != a and int(i) != b:
    c = int(i)
    
print(c)

Buggy python submission (verdict: Runtime Error):
nums = [1,2,3]
a = int(input())
b = int(input())
c = 0

for i in nums:
  if i != a && i != b:
    c = i
    
print(c)

Fixed submission:
nums = [1,2,3]
a = int(input())
b = int(input())
c = 0

for i in nums:
  if int(i) != a and int(i) != b:
    c = int(i)
    
print(c)
Buggy python submission (verdict: Runtime Error):
word = list(input())

count = 0  # 入れ替える個数を用意

if len(word) % 2 == 0:  # もしアルファベットの数が偶数の時
	for i in range(0,int(len(word)/2)):
    	if word[i] != word[int(len(word))-1-i]:
        	count += 1    
    print(count)

else:
	for j in range(0,int((len(word)+1)/2-1)):
    	if word[j] != word[int(len(word))-1-j]:
        	count += 1            
    print(count)


Fixed submission:
word = list(input())

count = 0  # 入れ替える個数を用意

if len(word) % 2 == 0:  # もしアルファベットの数が偶数の時
  for i in range(0,int(len(word)/2)):
    if word[i] != word[int(len(word))-1-i]:
      count += 1    
  print(count)

else:
  for j in range(0,int((len(word)+1)/2-1)):
    if word[j] != word[int(len(word))-1-j]:
      count += 1
  print(count)

Buggy python submission (verdict: Runtime Error):
word = list(input())

count = 0  # 入れ替える個数を用意

if len(word) % 2 == 0:  # もしアルファベットの数が偶数の時
	for i in range(0,int(len(word)/2)):
    	if word[i] != word[len(word)-1-i]:
        	count += 1    
    print(count)

else:
	for j in range(0,int((len(word)+1)/2-1)):
    	if word[j] != word[len(word)-1-j]:
        	count += 1            
    print(count)

Fixed submission:
word = list(input())

count = 0  # 入れ替える個数を用意

if len(word) % 2 == 0:  # もしアルファベットの数が偶数の時
  for i in range(0,int(len(word)/2)):
    if word[i] != word[int(len(word))-1-i]:
      count += 1    
  print(count)

else:
  for j in range(0,int((len(word)+1)/2-1)):
    if word[j] != word[int(len(word))-1-j]:
      count += 1
  print(count)
Buggy python submission (verdict: Runtime Error):
N= int(input())
if N%9 =0:
    print("Yes")
else:
    print("No")

Fixed submission:
N= int(input())
if N%9 ==0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N= int(input())
if N%9 ==0
    print("Yes")
else:
    print("No")

Fixed submission:
N= int(input())
if N%9 ==0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = input()
q = int(input())
for _ in range(q):
    b, q = map(str, input().split())
    ls = ls.replace(b, q)
    print(sum(map(int, ls.split())))


Fixed submission:
from collections import Counter
n = int(input())
ls = list(map(int, input().split()))
q = int(input())
count = Counter(ls)
sm = sum(ls)

for _ in range(q):
    b, q = map(int, input().split())
    if b in count:
        sm -= count[b] * b
        sm += count[b] * q
        print(sm)
    else:
        print(sm)
    if q in count:
        count[q] += count[b]

        count[b] = 0
    else:
        count[q] = count[b]

        count[b] = 0
Buggy python submission (verdict: Runtime Error):
n = int(input())
ls = sorted(list(map(int, input().split())))
primes = [0] * (max(ls) + 1)
primes[0] == 1
primes[1] == 1
for i in range(round(n ** 0.5) + 1):
    if primes[ls[i]] == 0:
        for j in range(ls[i] * 2, max(ls) + 1, ls[i]):
            primes[j] = 1

count = 0
for i in ls:
    if primes[i] == 0:
        count += 1
print(count)


Fixed submission:
n = int(input())
ls = sorted(list(map(int, input().split())))
dp = [0] * (ls[-1] + 1)
for i in ls:
    dp[i] += 1
    if dp[i] == 1:
        for j in range(i*2, ls[-1] + 1, i):
            dp[j] += 2

print(dp.count(1))

Buggy python submission (verdict: Runtime Error):
n = int(input())
ls = sorted(list(map(int, input().split())))
dead = []
for i in range(round(n ** 0.5) + 1):
    if ls[i] not in dead:
        for j in range(ls[i], ls[-1] + 1, ls[i]):
            if j in ls: 
                dead.append(j)

print(n - len(dead))


Fixed submission:
n = int(input())
ls = sorted(list(map(int, input().split())))
dp = [0] * (ls[-1] + 1)
for i in ls:
    dp[i] += 1
    if dp[i] == 1:
        for j in range(i*2, ls[-1] + 1, i):
            dp[j] += 2

print(dp.count(1))
Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
ls = list(map(int, input().split()))
ans = math.prod(ls)
if ans > 10**18:
    print(-1)
else:
    print(ans)


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

ans = 1
if 0 in num:
    print(0)
    exit()
else:
    for i in num:
        ans *= i
        if ans > 10**18:
            print(-1)
            exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = list(map(int, input().split()))
if 0 in ls:
    print(0)
else:
    ans = 1
    for i in ls:
        ans *= i

    if ans > 10**18:
        print(-1)
    else:
        print(ans)


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

ans = 1
if 0 in num:
    print(0)
    exit()
else:
    for i in num:
        ans *= i
        if ans > 10**18:
            print(-1)
            exit()

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
if s == 'ABC'
	print('ARC')
else:
	print('ABC')

Fixed submission:
s = input()
if s == 'ABC':
    print('ARC')
else:
    print('ABC')
Buggy python submission (verdict: Runtime Error):
s = int(input())
w = int(input())
if w >= s:
  print("unsafe")
else:
  print('safe')

Fixed submission:
s, w = map(int, input().split())
if w >= s:
  print('unsafe')
else:
  print("safe")

Buggy python submission (verdict: Runtime Error):
s = input()
w = input()
if w >= s:
  print("unsafe")
else:
  print('safe')

Fixed submission:
s, w = map(int, input().split())
if w >= s:
  print('unsafe')
else:
  print("safe")
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
score_card = [k for _ in range(n)]
for i in range(q):
    tmp = int(input())
    for j in range(len(score_card)):
        if j + 1 == tmp:
            pass
        else:
            score_card[j] = score_card[j] - 1

for i in score_card:
    if i > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
n, k, q = map(int, input().split())
score_list = [k-q for _ in range(n)]
for i in range(q):
    tmp = int(input())
    score_list[tmp - 1] = score_list[tmp - 1] + 1

for j in score_list:
    if j > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

v.sort()
c.sort()

maximum = 0
profit = []
for i in range(len(v)):
    tmp = v[i] - c[i]
    if tmp > 0:
        maximum += tmp
    tmp = 0

print(maximum)


Fixed submission:
from fractions import gcd
N=int(input())
A=list(map(int,input().split()))
tA=list(reversed(A))
l=[0]
r=[0]
m=[]
for i in range(N):
  tmpl = l[i]
  tmpa = A[i]
  tmpta = tA[i]
  l.append(gcd(l[i],A[i]))
  r.append(gcd(r[i],tA[i]))
r=list(reversed(r))
for i in range(N):
  m.append(gcd(l[i],r[i+1]))
print(max(m))
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
div = []
for i in range(1, max(a, b)):
    if (a % i == 0) and (b % i == 0):
        div.append(i)
if len(div) == 0:
    print(1)
else:
    div.sort()
    print(div[-k])


Fixed submission:
a, b, k = map(int, input().split())
div = []
for i in range(1, 105):
    if (a % i == 0) and (b % i == 0):
        div.append(i)

if len(div) < k: 
    print(max(div))
else:
    div.sort()
    print(div[-k])

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
div = []
for i in range(1, max(a, b)):
    if (a % i == 0) and (b % i == 0):
        div.append(i)
if a == 1 and b == 1:
    print(1)
else:
    div.sort()
    print(div[-k])


Fixed submission:
a, b, k = map(int, input().split())
div = []
for i in range(1, 105):
    if (a % i == 0) and (b % i == 0):
        div.append(i)

if len(div) < k: 
    print(max(div))
else:
    div.sort()
    print(div[-k])
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
s = list(s)
idx = 0
blocks = 0
while idx != len(s) - 1:
    if s[idx] == '0' and s[idx+1] == '1':

        tmp1 = s[idx]
        tmp2 = s[idx+1]

        s.remove(tmp1)
        s.remove(tmp2)

        idx = 0
        blocks += 2

    elif s[idx] == '1' and s[idx+1] == '0':

        tmp1 = s[idx]
        tmp2 = s[idx+1]

        s.remove(tmp1)
        s.remove(tmp2)

        idx = 0
        blocks += 2

    else:
        idx += 1
        
    if len(s) == 0:
        break

print(blocks)


Fixed submission:
s = input()
num_0 = s.count('0')
num_1 = s.count('1')
print(2 * min(num_0, num_1))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = list(map(int,input().split()))

ans = 1

for i in l:
    ans *= i
if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
import sys
N = int(input())
l = list(map(int,input().split()))

if 0 in l:
    print(0)
    sys.exit()

ans = 1

for i in l:
    ans *= i
    if ans > 10**18:
        print(-1)
        sys.exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
N%=10
if N == 3:
    print("bon")
elif N == 0 or N == 1 or N == 6 N == 8:
    print("pon")
else:
    print("hon")

Fixed submission:
N = int(input())
N%=10
if N == 3:
    print("bon")
elif N == 0 or N == 1 or N == 6 or N == 8:
    print("pon")
else:
    print("hon")
Buggy python submission (verdict: Time Limit Exceeded):
import sys 
N,K = map(int,input().split())
l = list(map(int,input().split()))
m = [0 for i in range(N)]
location = 0
count = 0
for i in range(K):
    location = l[location] -1
    m[location] += 1
    if m[location] == 2:
        start = location
        for j in range(K-i-1):
            location = l[location] -1
            count += 1
            if location == start:
                print(count)
                for k in range((K-i-j-2)//count):
                    location = l[location] -1
                print(location + 1)
                sys.exit()
        print(location + 1)
        sys.exit()
print(location + 1)


Fixed submission:
import sys 
N,K = map(int,input().split())
l = list(map(int,input().split()))
m = [0 for i in range(N)]
location = 0
count = 0
for i in range(K):
    location = l[location] -1
    m[location] += 1
    if m[location] == 2:
        start = location
        for j in range(K-i-1):
            location = l[location] -1
            count += 1
            if location == start:
                for k in range((K-i-j-2)%count):
                    location = l[location] -1
                print(location + 1)
                sys.exit()
        print(location + 1)
        sys.exit()
print(location + 1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

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

K = int(input())
ans = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans+=gcd(i,j,k)
print(ans)

Fixed submission:
import math
from functools import reduce

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

K = int(input())
ans = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans+=gcd(i,j,k)
print(ans)
Buggy python submission (verdict: Runtime Error):
X,Y,Z = map(int,input().split())
X,Y = Y,X
X,Z = Z,X
print(f"{X} {Y} {Z}")

Fixed submission:
X,Y,Z = map(int,input().split())
X,Y = Y,X
X,Z = Z,X
print(str(X)+" "+str(Y)+" "+str(Z))
Buggy python submission (verdict: Runtime Error):
L=int(input())
print(f"{(L/3)**3:.6f}")

Fixed submission:
L=float(input())
print((L/3)**3)
Buggy python submission (verdict: Runtime Error):
import math

R = int(input())
print(2 * R * math.pi)



Fixed submission:
a,b = [int(i) for i in input().split()]
print(a*b)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input.split())

if a == b:
    print(c)
elif a == c:
    print(b) 
else:
    print(a)
           

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

if a == b:
    print(c)
elif a == c:
    print(b) 
else:
    print(a)

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

if a == b:
    print(c)
elif a == c:
    print(b) 
else:
    print(a)
           

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

if a == b:
    print(c)
elif a == c:
    print(b) 
else:
    print(a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(2 * n,end = "\n")

Fixed submission:
a,b = map(int,input().split())
print((a-1) * (b-1))
Buggy python submission (verdict: Runtime Error):
x,y,z = map(int,input().split())
print(z,x,y)

Fixed submission:
a,b,c = input().split(",")
print(a,b,c)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
Sum = []
A = list(map(int, input().split()))
Sum = [A[i]*A[j] for j in range(N) for i in range(j)]
print(np.array(Sum).sum()%(1000000000+7))

Fixed submission:
D,T,S = map(int, input().split())
if D<=S*T:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
edge = []
for i in range(M):
    a,b = map(int,input().split())
    add = []
    for j in range(len(edge)):
        if a in edge[j] or b in edge[j]:
            edge[j].append(a)
            edge[j].append(b)
            add.append(j)
    if len(add) == 0:
        edge.append([a,b])
    elif len(add) >= 2:
        for j in range(1,len(add)):
            edge[add[0]].extend(edge[add[j]])
        for j in range(1,len(add)):
            edge.pop(add[j])
ans = 0
for i in range(len(edge)):
    x = list(set(edge[i]))
    if len(x) > ans:
        ans = len(x)
print(ans)


Fixed submission:
d,t,s = map(int,input().split())
if d <= t*s:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int,input().split()))
temp = 1
for i in range(N):
    before = temp
    temp *= A[i]
    if i >= K:
        temp /= A[i-K]
        if temp > before:
            print("Yes")
        else:
            print("No")


Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(N):
    if i >= K:
        if A[i] > A[i-K]:
            print("Yes")
        else:
            print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a = 0
b = 0
ans = 0
t = sum(A)
temp = 0
if t <= K:
    ans = N
for i in range(0,N+1):
    if i != 0:
        t -= A[-i]
    temp = t
    j = 0
    ans2 = 0
    while temp < K and j < len(B):
        if temp + B[j] <= K:
            ans2 += 1
            temp += B[j]
            j += 1
        else:
            break
    if temp <= K:
        ans = max(ans,len(A)-i+ans2)
print(ans)


Fixed submission:
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a = 0
b = 0
ans = 0
t = sum(A)
temp = 0
if t <= K:
    ans = N
j = 0
ans2 = 0
for i in range(0,N+1):
    if i != 0:
        t -= A[-i]
    while t < K and j < len(B):
        if t + B[j] <= K:
            ans2 += 1
            t += B[j]
            j += 1
        else:
            break
    if t <= K:
        ans = max(ans,len(A)-i+ans2)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
#葉
A = list(map(int,input().split()))

B = [0] * (N+1)
B[0] = 1 - A[0]
for i in range(0,N):
    if 2*B[i] < A[i+1]:
        print("-1")
        exit()
    B_max = sum(A[i+2:])
    B[i+1] = min(2*B[i]-A[i+1],B_max)
if B[-1] != 0:
    print("-1")
else:
    print(sum(A)+sum(B))


Fixed submission:
N = int(input())
#葉
A = list(map(int,input().split()))
s = sum(A[1:])
B = [0] * (N+1)
B[0] = 1 - A[0]
for i in range(0,N):
    s -= A[i+1]
    if 2*B[i] < A[i+1]:
        print("-1")
        exit()
    B[i+1] = min(2*B[i]-A[i+1],s)
if B[-1] != 0:
    print("-1")
else:
    print(sum(A)+sum(B))
Buggy python submission (verdict: Runtime Error):
temp = input().split(" ")
N = int(temp[0])
M = int(temp[1])
H = input().split(" ")
good = [1] * N
for i in range(M):
    root = input().split(" ")
    a = int(root[0])-1
    b = int(root[1])-1
    if H[a]=>H[b]:
        good[b] = 0
    if H[a]<H[b]:
        good[a] = 0

print(sum(good))

Fixed submission:
temp = input().split(" ")
N = int(temp[0])
M = int(temp[1])
H = input().split(" ")
good = [1] * N
for i in range(M):
    root = input().split(" ")
    a = int(root[0])-1
    b = int(root[1])-1
    if int(H[a])>=int(H[b]):
        good[b] = 0
    if int(H[a])<=int(H[b]):
        good[a] = 0
print(sum(good))

Buggy python submission (verdict: Time Limit Exceeded):
temp = input().split(" ")
N = int(temp[0])
M = int(temp[1])
H = input().split(" ")
good = list(range(N))
for i in range(M):
    root = input().split(" ")
    a = int(root[0])-1
    b = int(root[1])-1
    if H[a]>H[b]:
        good = [i for i in good if i!=b]
    elif H[a]<H[b]:
        good = [i for i in good if i!=a]
    else:
        good = [i for i in good if i!=a and i!=b]
print(len(good))

Fixed submission:
temp = input().split(" ")
N = int(temp[0])
M = int(temp[1])
H = input().split(" ")
good = [1] * N
for i in range(M):
    root = input().split(" ")
    a = int(root[0])-1
    b = int(root[1])-1
    if int(H[a])>=int(H[b]):
        good[b] = 0
    if int(H[a])<=int(H[b]):
        good[a] = 0
print(sum(good))

Buggy python submission (verdict: Time Limit Exceeded):
temp = input().split(" ")
N = int(temp[0])
M = int(temp[1])
H = input().split(" ")
good = list(range(N))
for i in range(M):
    root = input().split(" ")
    a = int(root[0])-1
    b = int(root[1])-1
    if H[a]>H[b]:
        try:
            good.remove(b)
        except ValueError:
            pass
    elif H[a]<H[b]:
        try:
            good.remove(a)
        except ValueError:
            pass
    else:
        try:
            good.remove(a)
        except ValueError:
            pass
        try:
            good.remove(b)
        except ValueError:
            pass
print(len(good))

Fixed submission:
temp = input().split(" ")
N = int(temp[0])
M = int(temp[1])
H = input().split(" ")
good = [1] * N
for i in range(M):
    root = input().split(" ")
    a = int(root[0])-1
    b = int(root[1])-1
    if int(H[a])>=int(H[b]):
        good[b] = 0
    if int(H[a])<=int(H[b]):
        good[a] = 0
print(sum(good))
Buggy python submission (verdict: Runtime Error):
D, T, S = map(int, input.split())
if (D / S) <= T:
  print("Yes")
else:
  print("No")

Fixed submission:
D, T, S = map(int, input().split())
print("Yes" if (D / S) <= T else "No")

Buggy python submission (verdict: Runtime Error):
D, T, S = map(int, input.split())
print("Yes" if (D / S) <= T else "No")

Fixed submission:
D, T, S = map(int, input().split())
print("Yes" if (D / S) <= T else "No")
Buggy python submission (verdict: Runtime Error):
S,W = map(int, input().split())
print "unsafe" if W >= S else "safe"


Fixed submission:
S, W = map(int, input().split())
print("unsafe" if W >= S else "safe")

Buggy python submission (verdict: Runtime Error):
S,W = map(int, input.split())
print "unsafe" if W >= S else "safe"

Fixed submission:
S, W = map(int, input().split())
print("unsafe" if W >= S else "safe")