Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s=input()
con=[0]*2
for i in range(4):
    if s[i]=='+':
        c[0]+=1
    else:
        c[1]+=1
print(c[0]-c[1])           

Fixed submission:
s=input()
con=[0]*2
for i in range(4):
    if s[i]=='+':
        con[0]+=1
    else:
        con[1]+=1
print(con[0]-con[1])

Buggy python submission (verdict: Runtime Error):
s=input()
con=[0]*2
for i in range(4):
    if s[i]=='+':
        c[0]+=1
     else:
         c[1]+=1
print(c[0]-c[1])           

Fixed submission:
s=input()
con=[0]*2
for i in range(4):
    if s[i]=='+':
        con[0]+=1
    else:
        con[1]+=1
print(con[0]-con[1])

Buggy python submission (verdict: Runtime Error):
s=input()
con=[0]*2
for i in raange(4):
    if s[i]=='+':
        c[0]+=1
     else:
         c[1]+=1
print(c[0]-c[1])           

Fixed submission:
s=input()
con=[0]*2
for i in range(4):
    if s[i]=='+':
        con[0]+=1
    else:
        con[1]+=1
print(con[0]-con[1])
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

if K % 2 == 0:
    print(-1)

for i in range(1, 10**5):
    n = "7" * i
    n = int(n)
    if n % K == 0:
        print(i)
        exit()
print(-1)

Fixed submission:
K = int(input())

# k_keta = len(str(K))
# print(k_keta)

#偶数は弾く
if K % 2 == 0:
    print(-1)
    exit()

r = 0
for i in range(1, 10**6): #何回目のループか
    r = (10 * r + 7) % K
    if r % K == 0:
        print(i)
        break
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
N, K = map(int, input().split())
P = list(map(int, input().split()))

buy = list(combinations(P, K))
sum_money = [sum(b) for b in buy]
print(min(sum_money))

Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
P.sort()
print(sum(P[:K]))
Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
P = list(map(int, input().split()))
Q = [i for i in range(1, 101)]
P = list(set(Q) - set(P))
dif = 100
for p in P:
    if abs(X-p) < dif:
        dif = abs(X-p)
        ans = p
print(ans)

Fixed submission:
X, N = map(int, input().split())
P = list(map(int, input().split()))
Q = [i for i in range(-150, 150)]
P = list(set(Q) - set(P))
P.sort()
dif = 100
for p in P:
    if abs(X-p) < dif:
        dif = abs(X-p)
        ans = p
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ans=1
for i in range(N):
	ans*=A[i]
if ans<=10**18:
	print(ans)
else:
	print(-1)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
pro = 1

if 0 in A:
    print(0)
else:
    for a in A:
        pro *= a
        if pro > 1000000000000000000:
            print(-1)
            break
    else:
        print(pro)
Buggy python submission (verdict: Runtime Error):
from itertools import product

N, M, X = map(int, input().split())
inp = [list(map(int, input().split())) for _ in range(N)]

C, A = [], []
for i in range(N):
    C.append(inp[i][0])
    A.append(inp[i][1:])

#判定
z_A = list(zip(*A))
for i in range(N):
    if sum(z_A[i]) < X:
        print(-1)
        exit()

ans = sum(C)

for buy_bit in product(range(2), repeat=N):
    buy = 0
    tmp = 0
    skill = [0] * M
    for i in range(N):
        if buy_bit[i]:
            for j in range(M):
                skill[j] += A[i][j]
            buy += C[i]
    
    f = True
    for s in skill:
        if s < X:
            f = False
            break
    if f:
        ans = min(ans, buy)

print(ans)

Fixed submission:
from itertools import product

N, M, X = map(int, input().split())
inp = [list(map(int, input().split())) for _ in range(N)]

C, A = [], []
for i in range(N):
    C.append(inp[i][0])
    A.append(inp[i][1:])

#判定
z_A = list(zip(*A))
for i in range(M):
    if sum(z_A[i]) < X:
        print(-1)
        exit()

ans = sum(C)

for buy_bit in product(range(2), repeat=N):
    buy = 0
    tmp = 0
    skill = [0] * M
    for i in range(N):
        if buy_bit[i]:
            for j in range(M):
                skill[j] += A[i][j]
            buy += C[i]
    
    f = True
    for s in skill:
        if s < X:
            f = False
            break
    if f:
        ans = min(ans, buy)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
K = int(input())
sum = 0

for a in range(1, K + 1):
    for b in range(1, K + 1):
        d = gcd(a , b)
        for c in range(1, K + 1):
            sum += gcd(d, c)

print(sum)

Fixed submission:
from math import gcd
K = int(input())
sum = 0

for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            sum += gcd(a, gcd(b, c))

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
K = int(input())
sum = 0

for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            sum += gcd(a, gcd(b, c))

print(sum)

Fixed submission:
from math import gcd
K = int(input())
sum = 0

for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            sum += gcd(a, gcd(b, c))

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
K = int(input())
sum = 0

for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            sum += gcd(a, gcd(b, c))

print(sum)

Fixed submission:
from math import gcd
K = int(input())
sum = 0

for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            sum += gcd(a, gcd(b, c))

print(sum)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(M)]

ans = [10] * N
for l in lst:
    if ans[l[0]-1] < 10 and ans[l[0]-1] != l[1]:
        print(-1)
        exit()
    ans[l[0]-1] = l[1]

for i in range(M):
    if ans[i] == 10:
        ans[i] = 0

if N != 1 and ans[0] == 0:
    print(-1)
    exit()

ans = list(map(str, ans))
print("".join(ans))

Fixed submission:
N, M = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(M)]

ans = [10] * N
for l in lst:
    if ans[l[0]-1] < 10 and ans[l[0]-1] != l[1]:
        print(-1)
        exit()
    ans[l[0]-1] = l[1]

if ans[0] == 10:
    if N == 1:
        ans[0] = 0
    else:
        ans[0] = 1
for i in range(1, N):
    if ans[i] == 10:
        ans[i] = 0

if N != 1 and ans[0] == 0:
    print(-1)
    exit()

ans = list(map(str, ans))
print("".join(ans))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(M)]

S = C = []
for i in range(M):
    S.append(lst[i][0])
    C.append(lst[i][1])

ans = [10] * N
for l in lst:
    if ans[l[0]-1] < 10 and ans[l[0]-1] != l[1]:
        print(-1)
        exit()
    ans[l[0]-1] = l[1]

for i in range(M):
    if ans[i] == 10:
        ans[i] = 0

if N != 1 and ans[0] == 0:
    print(-1)
    exit()

ans = list(map(str, ans))
print("".join(ans))

Fixed submission:
N, M = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(M)]

ans = [10] * N
for l in lst:
    if ans[l[0]-1] < 10 and ans[l[0]-1] != l[1]:
        print(-1)
        exit()
    ans[l[0]-1] = l[1]

if ans[0] == 10:
    if N == 1:
        ans[0] = 0
    else:
        ans[0] = 1
for i in range(1, N):
    if ans[i] == 10:
        ans[i] = 0

if N != 1 and ans[0] == 0:
    print(-1)
    exit()

ans = list(map(str, ans))
print("".join(ans))
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int,input().split()))

p = X[0]
sum = 0
for x in X:
  sum += (x - p)**2
ans = sum

for p in range(X[1], X[N-1]): #Pの位置
  sum = 0
  for x in X: #Xの要素を１つずつ取得
    sum += (x - p)**2
  ans = min(sum, ans)

print(ans)
    

Fixed submission:
N = int(input())
X = list(map(int, input().split()))
P = [p for p in range(1, max(X) + 1)]
min = 0
energy = 0

for x in X:
    min += (1 - x) ** 2

for p in P:
    for x in X:
        energy += (x - p) ** 2

    if energy < min:
        min = energy
    energy = 0
print(min)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

cnt = 0
for i in range(N):
    if P[i] == min(P[:i+1]):
        cnt += 1
print(cnt)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))

m = P[0] #その時点での最小値
cnt = 1 #P[0]の時点でcnt=1
for i in range(N):
    if P[i] < m:
        m = P[i]
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ans = 1
X = []
while(ans<N+1):
    for i in range(N):
        if A[i] == ans:
            ans += 1
            X.append(str(i+1))
L=' '.join(X)
print(L)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
X = [0 for _ in range(N)]

for i in range(N):
    X[A[i] - 1] = i + 1

L = " ".join([str(i) for i in X])
print(L)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ans = 1
X = []
while(ans<N+1):
    for i in range(N):
        if A[i] == ans:
            ans += 1
            X.append(str(i+1))
L=' '.join(X)
print(L)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
X = [0 for _ in range(N)]

for i in range(N):
    X[A[i] - 1] = i + 1

L = " ".join([str(i) for i in X])
print(L)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
hp = Q - K
for i in range(N):
    if A.count(i+1) > hp:
        print("Yes")
    else:
        print("No")

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
correct = [0] * N

for a in A:
    correct[a-1] += 1

hp = Q - K
for i in range(N):
    if correct[i] > hp:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

#正答数のカウント
correct = []
for i in range(N):
    correct.append(A.count(i+1))
hp = Q - K
for i in range(N):
    if correct[i] > hp:
        print("Yes")
    else:
        print("No")

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
correct = [0] * N

for a in A:
    correct[a-1] += 1

hp = Q - K
for i in range(N):
    if correct[i] > hp:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

#正答数のカウント
correct = []
for i in range(N):
    correct.append(A.count(i+1))
hp = Q - K
for i in range(N):
    if correct[i] > hp:
        print("Yes")
    else:
        print("No")

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
correct = [0] * N

for a in A:
    correct[a-1] += 1

hp = Q - K
for i in range(N):
    if correct[i] > hp:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

def print_ans(lst):
    for l in lst:
        if l:
            print("Yes")
        else:
            print("No")
    exit()

hp = K - Q

if hp > 0:
    #はじめから全員Yes
    tmp = [True] * N
    print_ans(tmp)
else:
    tmp = []
    for i in range(N):
        if hp + A.count(i+1) > 0:
            tmp.append(True)
        else:
            tmp.append(False)
    print_ans(tmp)

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
correct = [0] * N

for a in A:
    correct[a-1] += 1

hp = Q - K
for i in range(N):
    if correct[i] > hp:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

H.append(10**10) 
r, ans = 0, 0
for l in range(N):
    while r < N and H[r] >= H[r+1]:
        r += 1
    ans = max(ans, r-l)
    if l == r:
        r += 1
        l += 1
    print(H[l:r+1])
print(ans)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))

H.append(10**10) 
r, ans = 0, 0
for l in range(N):
    while r < N and H[r] >= H[r+1]:
        r += 1
    ans = max(ans, r-l)
    if l == r:
        r += 1
        l += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

if (B-A+1) < 2*K:
    for i in range(A, B+1):
        print(i)
    exit()

lst = list(range(A, B+1))
x = [lst[i] for i in range(0, K)]
y = [lst[i] for i in range(-1, -K-1, -1)]

ans = list(set(x) | set(y))
ans.sort()

for i in ans:
    print(i)


Fixed submission:
a, b, k = map(int, input().split())
for i in range(a, min(b, a + k - 1) + 1):
    print(i)
for i in range(max(b - k + 1, a + k), b + 1):
    print(i)

Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

if (B-A+1) < K:
    for i in range(A, B+1):
        print(i)
    exit()

lst = list(range(A, B+1))
x = [lst[i] for i in range(0, K)]
y = [lst[i] for i in range(-1, -K-1, -1)]

ans = list(set(x) | set(y))
ans.sort()

for i in ans:
    print(i)

Fixed submission:
a, b, k = map(int, input().split())
for i in range(a, min(b, a + k - 1) + 1):
    print(i)
for i in range(max(b - k + 1, a + k), b + 1):
    print(i)

Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

if (B-A+1) < K:
    for i in range(A, B+1):
        print(i)
    exit()

lst = list(range(A, B+1))
lst.sort()

x = [lst[i] for i in range(0, K)]
y = [lst[i] for i in range(-1, -K-1, -1)]

ans = list(set(x) | set(y))
ans.sort()

for i in ans:
    print(i)

Fixed submission:
a, b, k = map(int, input().split())
for i in range(a, min(b, a + k - 1) + 1):
    print(i)
for i in range(max(b - k + 1, a + k), b + 1):
    print(i)

Buggy python submission (verdict: Runtime Error):

if (B-A+1) < K:
    for i in range(A, B+1):
        print(i)
    exit()

lst = list(range(A, B+1))
lst.sort()

x = [lst[i] for i in range(0, K)]
y = [lst[i] for i in range(-1, -K-1, -1)]

ans = list(set(x) | set(y))
ans.sort()

for i in ans:
    print(i)

Fixed submission:
a, b, k = map(int, input().split())
for i in range(a, min(b, a + k - 1) + 1):
    print(i)
for i in range(max(b - k + 1, a + k), b + 1):
    print(i)

Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

if (B-A+1) < K:
    for i in range(A, B+1):
        print(i)
    exit()

lst = list(range(A, B+1))
lst.sort()

x = [lst[i] for i in range(0, K)]
y = [lst[i] for i in range(-1, -K-1, -1)]

ans = list(set(x) | set(y))
ans.sort()

for i in ans:
    print(i)

Fixed submission:
a, b, k = map(int, input().split())
for i in range(a, min(b, a + k - 1) + 1):
    print(i)
for i in range(max(b - k + 1, a + k), b + 1):
    print(i)
Buggy python submission (verdict: Runtime Error):
N = int(input())
max_cnt = 0

for n in range(1, N+1):
    cnt = 0
    for div in range(1, 7):
        if n % 2**div == 0:
            cnt += 1
    if cnt > max_cnt:
        max_cnt = cnt
        ans = n
print(ans)

Fixed submission:
N = int(input())
max_cnt = 0
ans = 0
for n in range(1, N+1):
    cnt = 0
    for div in range(0, 7):
        if n % 2**div == 0:
            cnt += 1
    if cnt > max_cnt:
        max_cnt = cnt
        ans = n
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())
cnt = 0
for i in range(a, b+1):
    if i % x == 0:
        cnt += 1
print(cnt)

Fixed submission:
a,b,x = map(int, input().split())
print((b//x) - ((a-1)//x))
Buggy python submission (verdict: Runtime Error):
S = [input() for _ in range(3)]
for i in range(3):
    S[i] = list(S[i])
p = 0 #プレイヤー
while True:
    if not S[0] and p == 0:
        print("A")
        break
    if not S[1] and p == 1:
        print("B")
        break
    if not S[2] and p == 3:
        print("C")
        break
    p_t = S[p].pop(0)
    if p_t == "a":
        p = 0
    elif p_t == "b":
        p = 1
    elif p_t == "c":
        p = 2

Fixed submission:
S = [input() for _ in range(3)]
for i in range(3):
    S[i] = list(S[i])
p = 0 #プレイヤー
while True:
    if not S[0] and p == 0:
        print("A")
        break
    if not S[1] and p == 1:
        print("B")
        break
    if not S[2] and p == 2:
        print("C")
        break
    p_t = S[p].pop(0)
    if p_t == "a":
        p = 0
    elif p_t == "b":
        p = 1
    elif p_t == "c":
        p = 2
Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce


def cmb(n, r):
    if n <= r:
        return 1
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


N, K = map(int, input().split(" "))
A = list(map(int, input().split(" ")))
A.sort()
fmax = 0
fmin = 0
for i in range(K, N+1):
    fmax += A[i-1] * cmb(i-1, K-1)
    fmin += A[-i] * cmb(i-1, K-1)
print((fmax - fmin) % 1000000007)


Fixed submission:
n = input()
print(chr(ord(n) + 1))
Buggy python submission (verdict: Runtime Error):
(N, Y) = map(int, input().split(" "))

ans = '-1 -1 -1'
for x in range(0, N+1):
    y = (Y / 1000 - 9 * x - N) / 4
    if 0 <= y <= N:
        if y.is_integer():
            y = int(y)
            z = N - x - y
            if 0 <= z <= N:
                ans = f'{x} {y} {z}'
                break
print(ans)


Fixed submission:
(N, Y) = map(int, input().split(" "))

ans = '-1 -1 -1'
for x in range(0, N+1):
    y = (Y / 1000 - 9 * x - N) / 4
    if 0 <= y <= N:
        if y.is_integer():
            y = int(y)
            z = N - x - y
            if 0 <= z <= N:
                ans = " ".join([str(x), str(y), str(z)])
                break
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
 
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
S = sum(A)
 
for _ in range(int(input())):
    p, q = map(int, input().split())
    k = count[p]
    count[p] = 0
    count[q] += k
    S += (q - p) * k
    print(S)

Fixed submission:
from collections import Counter
 
N = int(input())
A = list(map(int, input().split()))
count = Counter(A)
S = sum(A)
 
for _ in range(int(input())):
    b, c = map(int, input().split())
    k = count[b]
    count[b] = 0
    count[c] += k
    S += (c - b) * k
    print(S)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
for i in A:
    count ^= x
for i in range(len(A)):
    A[i] ^= count
    
    
    
print(*A)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
for i in A:
    count ^= i
for i in range(len(A)):
    A[i] ^= count
    
    
print(*A)
Buggy python submission (verdict: Runtime Error):
import math
A, B, H, M = map(int, input().split())
 
t = (H + (M / 60)) * math.pi / 6
m = (M / 60) * 2 *math.pi
totalangle = m - t
result = sqrt(A ** 2 + B ** 2 - 2 * A * B *math.cos(totalangle))
print(result)

Fixed submission:
import math
 
A, B, H, M = map(int, input().split())
 
m = (M / 60) * 2 * math.pi
t = (H + (M / 60)) * math.pi / 6
angle = m-t
res = math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(angle))
print(res)

Buggy python submission (verdict: Runtime Error):
import math
A, B, H, M = map(int, input().split())

t = (H + (M / 60)) * pi / 6
m = (M / 60) * 2 *pi
totalangle = m - t
result = sqrt(A ** 2 + B ** 2 - 2 * A * B *cos(totalangle))
print(result)

Fixed submission:
import math
 
A, B, H, M = map(int, input().split())
 
m = (M / 60) * 2 * math.pi
t = (H + (M / 60)) * math.pi / 6
angle = m-t
res = math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(angle))
print(res)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
h=list(map(int,input().split()))
final=[1]*n
for i in range(m):
  a,b=map(int,input().split())
    if h[a-1]<h[b-1]:
         final[a-1]=0
    elif h[a-1]>h[b-1]:
         final[b-1]= 0
    else:
         final[a-1]=0
         final[b-1]=0

print(sum(final))


Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
final=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]<h[b-1]:
         final[a-1]=0
  elif h[a-1]>h[b-1]:
         final[b-1]=0
  else:
         final[a-1]=0
         final[b-1]=0

print(sum(final))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
h=list(map(int,input().split()))
final=[0]*n
for i in range(m):
  a,b=map(int,input().split())
    if h[a-1]<h[b-1]:
         final[a-1]=0
    elif h[a-1]>h[b-1]:
         final[b-1]= 0
    else:
         final[a-1]=0
         final[b-1]=0

print(sum(final))


Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
final=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]<h[b-1]:
         final[a-1]=0
  elif h[a-1]>h[b-1]:
         final[b-1]=0
  else:
         final[a-1]=0
         final[b-1]=0

print(sum(final))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
h=list(map(int,input().split()))
final=[0]*n
for i in range(m):
  a,b=map(int,input().split())
    if h[a-1]<h[b-1]:
         final[a-1]=0
    elif h[a-1]>h[b-1]:
         final[b-1]= 0
    else:
         final[a-1]=0
         final[b-1]=0

print(sum(final))

Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
final=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]<h[b-1]:
         final[a-1]=0
  elif h[a-1]>h[b-1]:
         final[b-1]=0
  else:
         final[a-1]=0
         final[b-1]=0

print(sum(final))
Buggy python submission (verdict: Runtime Error):
n=int(input())
m=int(input())
k =(n*(n-1))//2
j=(m*(m-1))//2
print(j+k)

Fixed submission:
n, m = map(int, input().split())
 
ans = ((n*(n-1))+(m*(m-1)))//2
 
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
m=int(input())
ans = (((n*(n-1))+(m*(m-1)))//2
print(ans)

Fixed submission:
n, m = map(int, input().split())
 
ans = ((n*(n-1))+(m*(m-1)))//2
 
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
m=int(input())
ans = ((n*(n-1))+(m*(m-1)))//2
print(ans)

Fixed submission:
n, m = map(int, input().split())
 
ans = ((n*(n-1))+(m*(m-1)))//2
 
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

def main():
  N, X, T = input().split(' ')
  t = math.ceil(N/X) * T
  print(t)
 
if __name__=="__main__":
  main()

Fixed submission:
import math

def main():
  N, X, T = [int(i) for i in input().split(' ')]
  t = math.ceil(N/X) * T
  print(t)
 
if __name__=="__main__":
  main()
Buggy python submission (verdict: Runtime Error):
import math

def sum_of_digits(n):
    s = 0
    l = len(str(n))
    for i in range(l):
        s += n%10
        n = int(n/10)
    return s

def main():
    s = int(input())
    s = sum_of_digits(s)
    if s != 0 and s % 9==0:
        print('Yes')
    else:
        print('No')

if __name__=="__main__":
  main()

Fixed submission:
import math

def main():
    s = sum(list(map(int, input())))
    if s % 9==0:
        print('Yes')
    else:
        print('No')

if __name__=="__main__":
  main()

Buggy python submission (verdict: Runtime Error):
import math

def sum_of_digits(n):
    s = 0
    l = len(str(n))
    for i in range(l):
        s += n%10
        n = int(n/10)
    return s

def main():
    s = int(input())
    s = sum_of_digits(s)
    if s % 9==0:
        print('Yes')
    else:
        print('No')

if __name__=="__main__":
  main()

Fixed submission:
import math

def main():
    s = sum(list(map(int, input())))
    if s % 9==0:
        print('Yes')
    else:
        print('No')

if __name__=="__main__":
  main()