Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03487 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
l=[0 for i in range(10**5+1)]
ans=0
for i in range(n):
    if a[i]>10**5:
        ans+=1
    else:
        l[a[i]]+=1
for i in range(10**5+1):
    if 0<l[i]<i:
        ans+=l[i]
    if i<l[i]:
        t=l[i]-i
        ans+=t
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
l=[0 for i in range(100001)]
ans=0
for i in range(n):
    l[a[i]]+=1
for i in range(100001):
    if 0<l[i]<i:
        ans+=l[i]
    if i<l[i]:
        t=l[i]-i
        ans+=t
print(ans)
Problem p03575 (python)

Fixed submission:
class UnionFind:
    def __init__(self, n):
        self.nodes = n
        self.parents = [i for i in range(n)]
        self.sizes = [1] * n
        self.rank = [0] * n

    def find(self, i): # どの集合に属しているか（根ノードの番号）
        if self.parents[i] == i:
            return i
        else:
            self.parents[i] = self.find(self.parents[i]) # 経路圧縮
            return self.parents[i]

    def unite(self, i, j): # 二つの集合を併合
        pi = self.find(i)
        pj = self.find(j)
        if pi != pj:
            if self.rank[pi] < self.rank[pj]:
                self.sizes[pj] += self.sizes[pi]
                self.parents[pi] = pj
            else:
                self.sizes[pi] += self.sizes[pj]
                self.parents[pj] = pi
                if self.rank[pi] == self.rank[pj]:
                    self.rank[pi] += 1
    def same(self, i, j): # 同じ集合に属するかを判定
        return self.find(i)==self.find(j)

    def get_parents(self): # 根ノードの一覧を取得
        for n in range(self.nodes): # findで経路圧縮する
            self.find(n)
        return self.parents

adj = []
N, M = map(int,input().split())
for m in range(M):
    a,b = map(int,input().split())
    adj.append([a-1,b-1])

ans = 0
for i in range(M): # 取り除く辺番号
    uf = UnionFind(N)
    for j in range(M):
        if (i==j): # 辺を追加しない（取り除く）
            continue
        uf.unite(*adj[j])
    
    if len(set(uf.get_parents()))!=1: # 複数の集合にわかれているか確認
        ans += 1
print (ans)

Buggy submission (verdict: Runtime Error):
class UnionFind:
    def __init__(self, n):
        self.nodes=n
        self.parents = [i for i in range(n)]
        self.sizes = [1] * n
        self.rank = [0] * n

    def find(self, i):
        if self.parents[i] == i:
            return i
        else:
            self.parents[i] = self.find(self.parents[i]) # 経路圧縮
            return self.parents[i]

    def unite(self, i, j):
        pi = self.find(i)
        pj = self.find(j)
        if pi != pj:
            if self.rank[pi] < self.rank[pj]:
                self.sizes[pj] += self.sizes[pi]
                self.parents[pi] = pj
            else:
                self.sizes[pi] += self.sizes[pj]
                self.parents[pj] = pi
                if self.rank[pi] == self.rank[pj]:
                    self.rank[pi] += 1
    def same(self, i, j):
        return self.find(i)==self.find(j)
    def get_parents(self):
        for n in range(self.nodes):
            selff.find(n)
        return self.parents

adj=[]
n, m = map(int,input().split())
for i in range(m):
    uf = UnionFind(n)
    for j in range(m):
        if i==j:
            continue
        uf.unite(adj[j])
    if len(set(uf.get_parents()))!=1:
        ans+=1
print(ans)
Problem p03597 (python)

Fixed submission:
n=int(input())
a=int(input())
print(n**2-a)

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
a=100*a
b=100*b
dp1=[0]*(f+1)
dp2=[0]*(f+1)
for i in range(f+1):
    if i%a==0:
        if i+a<=f:
            dp1[i+a]=1
for i in range(f+1):
    if i==0 or dp1[i]==1:
        if i+b<=f:
            dp1[i+b]=1
for i in range(f+1):
    if i%c==0:
        if i+c<=f:
            dp2[i+c]=1
for i in range(f+1):
    if i==0 or dp2[i]==1:
        if i+d<=f:
            dp2[i+d]=1

ans=[-1,-1,-1]
for i in range(f+1):
    if dp1[i]==1:
        x=min(f-i,(i//100)*e)
        k=-1
        for j in range(x,-1,-1):
            if dp2[j]==1 or j==0:
                k=j
                if ans[0]<100*k/(i+k):
                    ans=[100*k/(i+k),i+k,k]
                break
print(str(ans[1])+" "+str(ans[2]))
Problem p03607 (python)

Fixed submission:
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Buggy submission (verdict: Runtime Error):
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.append(a)
print(len(A))

Buggy submission (verdict: Runtime Error):
from collections import deque
n=int(input())
A=[]
for i in range(n):
    a=input()
    if a in A:
        A.append(a)
    else:
        A.remove(a)
print(len(A))
Problem p03608 (python)

Fixed submission:
n,m,r=map(int,input().split())
road=list(map(int,input().split()))
cost=[[float("inf")]*n for i in range(n)]
for i in range(n):
    cost[i][i]=0
for i in range(m):
    
    a,b,c=map(int,input().split())
    a,b=a-1,b-1
    cost[a][b]=c
    cost[b][a]=c
for k in range(n):
    for i in range(n):
        for j in range(n):
            cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j])
import itertools
ans=float("inf")
for i in itertools.permutations(road):
    tmp=0
    for j in range(len(i)-1):
        tmp+=cost[i[j]-1][i[j+1]-1]
    if tmp<ans:
        ans=tmp
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,r=map(int,input().split())
road=list(map(int,input().split()))
cost=[[float("inf")]*n for i in range(n)]
for i in range(m):
    cost[i][i]=0
    a,b,c=map(int,input().split())
    a,b=a-1,b-1
    cost[a][b]=c
    cost[b][a]=c
for k in range(n):
    for i in range(n):
        for j in range(n):
            cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j])
import itertools
ans=float("inf")
for i in itertools.permutations(road):
    tmp=0
    for j in range(len(i)-1):
        tmp+=cost[i[j]-1][i[j+1]-1]
    if tmp<ans:
        ans=tmp
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,r=map(int,input().split())
road=list(map(int,input().split()))
cost=[[float("inf")]*n for i in range(n)]
for i in range(n):
    cost[i][i]=0
    a,b,c=map(int,input().split())
    a,b=a-1,b-1
    cost[a][b]=c
    cost[b][a]=c
for k in range(n):
    for i in range(n):
        for j in range(n):
            cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j])
import itertools
ans=float("inf")
for i in itertools.permutations(road):
    tmp=0
    for j in range(len(i)-1):
        tmp+=cost[i[j]-1][i[j+1]-1]
    if tmp<ans:
        ans=tmp
print(ans)
Problem p03633 (python)

Fixed submission:
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
ans=t[0]
for i in range(1,n):
    ans=ans*t[i]//fractions.gcd(ans,t[i])
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
t=list(int(input()) for i in range(n))
ans=t[0]
for i in range(1,n):
    ans=ans*t[i]//math.gcd(ans,t[i])
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
t=[int(input()) for i in range(n)]
ans=t[0]
for i in range(1,n):
    ans=ans*t[i]//math.gcd(ans,t[i])
print(ans)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

n=int(input())
t=[int(input()) for i in range(n)]
print(lcm(t))
Problem p03675 (python)

Fixed submission:
from collections import *
n=int(input())
a=list(map(int,input().split()))
b=deque()
for i in range(n):
    if i%2==0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
b=list(b)
if n%2==0:
    print(*b)
else:
    print(*b[::-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=deque()
for i in range(n):
    if i%2==0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
b=list(b)
if n%2==0:
    print(*b)
else:
    print(*b[::-1])
Problem p03721 (python)

Fixed submission:
import sys
n,k=map(int,input().split())
A=[]
tmp=k
for i in range(n):
    a,b=map(int,input().split())
    A.append([a,b])
A.sort(key=lambda x:x[0])
for i in range(n):
    tmp-=A[i][1]
    if tmp<=0:
        print(A[i][0])
        sys.exit()

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=""
for i in range(n):
    a,b=map(int,input().split())
    A+=str(a)*b
print(A[k-1])
Problem p02730 (python)

Fixed submission:
def checkPal(s):
  if s[::-1]==s:
    return True
  return False
s = input()
n = len(s)
if checkPal(s[:(n//2)]) and checkPal(s) and checkPal(s[(n//2)+1:]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
def checkPal(s):
  w = s
  w[::-1]
  if w==s:
    return True
  return False
s = input()
if checkPal(s[:(n//2)]) and checkPal(s) and checkPal(s[(n//2)+1:]:
  print("Yes")
else:
  print("No")
Problem p04019 (python)

Fixed submission:
#                          JAI SHREE RAM

import math; from collections import *
import sys; from functools import reduce

# sys.setrecursionlimit(10**6)
def get_ints(): return map(int, input().strip().split())
def get_list(): return list(get_ints())
def get_string(): return list(input().strip().split())
def printxsp(*args): return print(*args, end="")
def printsp(*args): return print(*args, end=" ")

UGLYMOD = int(1e9)+7; SEXYMOD = 998244353; MAXN = int(1e5)

# sys.stdin=open("input.txt","r");sys.stdout=open("output.txt","w")

# for _testcases_ in range(int(input())):
st = input()
n = s = e = w = False
if 'N' in st: n = True
if 'S' in st: s = True
if 'E' in st: e = True
if 'W' in st: w = True
print("Yes" if not(n^s) and not(e^w) else "No")


'''
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
THE LOGIC AND APPROACH IS MINE @luctivud ( UDIT GUPTA )
Link may be copy-pasted here if it's taken from other source.
DO NOT PLAGIARISE.
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
'''

Buggy submission (verdict: Runtime Error):
#                          JAI SHREE RAM

import math; from collections import *
import sys; from functools import reduce

# sys.setrecursionlimit(10**6)
def get_ints(): return map(int, input().strip().split())
def get_list(): return list(get_ints())
def get_string(): return list(input().strip().split())
def printxsp(*args): return print(*args, end="")
def printsp(*args): return print(*args, end=" ")

UGLYMOD = int(1e9)+7; SEXYMOD = 998244353; MAXN = int(1e5)

# sys.stdin=open("input.txt","r");sys.stdout=open("output.txt","w")

# for _testcases_ in range(int(input())):
s = input()
n = s = e = w = False
if 'N' in s: n = True
if 'S' in s: s = True
if 'E' in s: e = True
if 'W' in s: w = True
print("Yes" if not(n^s) and not(e^w) else "No")


'''
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
THE LOGIC AND APPROACH IS MINE @luctivud ( UDIT GUPTA )
Link may be copy-pasted here if it's taken from other source.
DO NOT PLAGIARISE.
>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!
'''
Problem p02747 (python)

Fixed submission:

if __name__ == "__main__":
    S = input()
    if len(S) % 2 == 0:
        for i in range(0, len(S), 2):
            if S[i] == "h" and S[i+1] == "i":
                ret = "Yes"
            else:
                ret = "No"
                break
    else:
        ret = "No"
    print(ret)

Buggy submission (verdict: Runtime Error):

if __name__ == "__main__":
    S = input()
    for i in range(0, len(S), 2):
        if len(S) >= 2 :
            if S[i] == "h" and S[i+1] == "i":
                ret = "Yes"
            else:
                ret = "No"
                break
        else:
            ret = "No"
            break
    print(ret)

Buggy submission (verdict: Runtime Error):

if __name__ == "__main__":
    S = input()
    for i in range(0, len(S), 2):
        if len(S) >= 1 and S[i] == "h" and S[i+1] == "i":
            ret = "Yes"            
        else:
            ret = "No"
            print(ret)
            exit(0)
    print(ret)

Buggy submission (verdict: Runtime Error):

if __name__ == "__main__":
    S = input()
    for i in range(0, len(S), 2):
        if len(S) >= 1 and S[i] == "h" and S[i+1] == "i":
            ret = "Yes"            
        else:
            ret = "No"
    print(ret)

Buggy submission (verdict: Runtime Error):

if __name__ == "__main__":
    S = input()
    for i in range(0, len(S), 2):
        if S[i] == "h" and S[i+1] == "i":
            ret = "Yes"            
        else:
            ret = "No"
    print(ret)
Problem p02755 (python)

Fixed submission:
import math

if __name__ == "__main__":
    A, B = map(int, input().split())
    a = math.ceil(A / 0.08)
    b = math.ceil(B / 0.1)
    # print(a , b)
    if math.floor(a * 0.08) == A and math.floor(a * 0.1) == B:
        ret = a
    elif math.floor(b * 0.08) == A and math.floor(b * 0.1) == B:
        ret = b
    else : 
        ret = -1
    print(ret)

Buggy submission (verdict: Runtime Error):
import math

if __name__ == "__main__":
    N, A, B = map(int, input().split())
    S = "b" * A + "r" * B
    S = S * math.ceil(1000000000000000000 / len(S))
    ret = S[:N].count("b")
    print(ret)import math

if __name__ == "__main__":
    A, B = map(int, input().split())
    par = A / B
    if par < 0.8:
        print("-1")
        exit(0)
    else:
        a = math.ceil(A / 0.08)
        b = math.ceil(B / 0.1)
        # print(a , b)
        ret = a
        print(a)
Problem p02772 (python)

Fixed submission:


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    for i in A:
        if i % 2 ==0:
            if i % 3 != 0 and i % 5 != 0:
                    print("DENIED")
                    exit(0)
            else:
                pass
        else:
            pass
    print("APPROVED")

Buggy submission (verdict: Runtime Error):


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    for i in A:
        if i % 2 == 0:
            if i % 3 == 0:
                ret = "APPROVED"
            elif i % 5 == 0:
                ret = "APPROVED"
            else:
                ret  = "DENIED"
                break
        else:
            continue
    print(ret)

Buggy submission (verdict: Runtime Error):


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    for i in A:
        if i % 2 == 0:
            if i % 3 == 0 or i % 5 == 0:
                ret = "APPROVED"
            else:
                ret  = "DENIED"
                break
        else:
            continue
    print(ret)

Buggy submission (verdict: Runtime Error):


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    for i in A:
        if i % 2 == 0:
            if i % 3 == 0 or i % 5 == 0:
                ret = "APPROVED"
            else:
                ret  = "DENIED"
                print(i)
                break
        else:
            continue
    print(ret)

Buggy submission (verdict: Runtime Error):


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    even_ls = [i for i in A if i%2 == 0 ]
    for i in even_ls:
        if i % 3 == 0 or i % 5 == 0:
            ret = "APPROVED"
        else:
            ret  = "DENIED"
            break
    print(ret)

Buggy submission (verdict: Runtime Error):

if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    even_ls = [i for i in A if i%2 == 0 ]
    for i in even_ls:
        if i % 3 == 0 or i % 5 == 0:
            ret = "APPROVED"
        else:
            ret  = "DENIED"
            break
    print(ret)

Buggy submission (verdict: Runtime Error):


if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    even_ls = [i for i in A if i%2 == 0 ]
    for i in even_ls:
        if i % 3 == 0 or i % 5 == 0:
            ret = "APPROVED"
        else:
            ret  = "DENIED"
        break
    print(ret)
Problem p02801 (python)

Fixed submission:

C = input()
C_asc = ord(C)
ret = chr(C_asc + 1)
print(ret)

Buggy submission (verdict: Runtime Error):


C = input()
C_asc ord(C)
ret = chr(C_asc + 1)
print(ret)
Problem p03844 (python)

Fixed submission:
def main():
    x = input()
    print(eval(x))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    A = input()
    op = input()
    B = input()
    x = A + op + B
#    print(A + op + B)
    y = eval(x)
    print(y)

if __name__ == '__main__':
    main()
Problem p02945 (python)

Fixed submission:
import sys
import math
import bisect

def main():
    a, b = map(int, input().split())
    A = [a + b, a - b, a * b]
    print(max(A))
    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
import bisect

def main():
    a, b = map(int, input())
    A = []
    A.append(a + b)
    A.append(a - b)
    A.append(a * b)
    print(max(A))
    
if __name__ == "__main__":
    main()
Problem p03085 (python)

Fixed submission:
import sys
import math
import bisect

def main():
    s = input()
    if s == 'A':
        print('T')
    elif s == 'C':
        print('G')
    elif s == 'G':
        print('C')
    elif s == 'T':
        print('A')
    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
import bisect

def main():
    s = input()
    if s == 'A':
        print('T')
    elif s == 'C':
        print('G')
    elif s == 'G'
        print('C')
    elif s == 'T':
        print('A')
    
if __name__ == "__main__":
    main()
Problem p03316 (python)

Fixed submission:
import sys
import math
import bisect

def query(n):
    ans = 0
    for c in str(n):
        val = ord(c) - ord('0')
        ans += val
    return ans

def main():
    n = int(input())
    if n % query(n) == 0:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
import bisect

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

if __name__ == "__main__":
    main()
Problem p03473 (python)

Fixed submission:
import sys
import math
import bisect
 
def main():
    n = int(input())
    print(48 - n)
 
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
import bisect

def main():
	n = int(input())
    print(48 - n)

if __name__ == "__main__":
    main()
Problem p03693 (python)

Fixed submission:
import sys
import math
import bisect

def main():
    r, g, b = map(int, input().split())
    val = r * 100 + g * 10 + b
    if val % 4 == 0:
        print('YES')
    else:
        print('NO')

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
import bisect

def main():
    a = ''.join(input().split())
    if a % 4 == 0:
        print('YES')
    else:
        print('NO')
    
if __name__ == "__main__":
    main()
Problem p03711 (python)

Fixed submission:
import sys
import math
import bisect

def main():
    A = [1, 3, 5, 7, 8, 10, 12]
    B = [4, 6, 9, 11]
    C = [2]
    x, y = map(int, input().split())
    if x in A and y in A:
        print('Yes')
    elif x in B and y in B:
        print('Yes')
    elif x in C and y in C:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
import bisect

def main():
    A = 1, 3, 5, 7, 8, 10, 12]
    B = [4, 6, 9, 11]
    C = [2]
    x, y = map(int, input().split())
    if x in A and y in A:
        print('Yes')
    elif x in B and y in B:
        print('Yes')
    elif x in C and y in C:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()
Problem p02582 (python)

Fixed submission:
S=str(input())

ans = 0
if S == "SSS":
	ans = 0
elif S == "SSR" or S == "RSS" or S == "RSR" or S == "SRS":
	ans = 1
elif S == "SRR" or S == "RRS":
	ans = 2
elif S == "RRR":
	ans = 3
print(ans)

Buggy submission (verdict: Runtime Error):
S=str(input())

ans = 0
if S == "SSS":
	ans = 0
	break
elif S == "SSR" or S == "RSS" or S = "RSR":
	ans = 1
	break
elif S == "SRR" or S == "RRS":
	ans = 2
	break
elif S == "RRR":
	ans = 3
	break
print(ans)
Problem p02628 (python)

Fixed submission:
N,K=map(int,input().split())
p = list(map(int,input().split()))
ans = 0

p.sort()
for i in range(K):
  ans += p[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
p = list(map(int,input().split()))
ans = 0

p.sort()
for i in range(K+1):
  ans += p[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
p = list(map(int,input().split()))
ans = 0

p.sort()
for i in range(1,K+1):
  ans += p[i]
print(ans)
Problem p02657 (python)

Fixed submission:
A,B = map(int,input().split())
print(A*B)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input())
print(A*B)
Problem p02741 (python)

Fixed submission:
K = int(input())

A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(A[K-1])

Buggy submission (verdict: Runtime Error):
K = int(input())

A = list(1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)

Print(A[K-1])
Problem p03220 (python)

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

diff = []
for i in H:
	diff.append(abs(A-T+i*0.006))

diffmin = diff[0]
ans = 0
for i in range(N):
	if diffmin > diff[i]:
		diffmin = diff[i]
		ans = i
print(ans+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))

diff = []
for i in H:
	diff.append(abs(A-T+i*0.006))

diffmin = diff[0]
ans = 0
for i in range(N):
	if diffmin > diff[i]:
		diffmin = diff[i]
			ans = i
print(ans)
Problem p03280 (python)

Fixed submission:
A,B = map(int,(input().split()))
ans = (A-1)*(B-1)
print(ans)

Buggy submission (verdict: Runtime Error):
A,B = map(int(input().split()))
ans = (A-1)*(B-1)
print(ans)

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

print((A-1)*(B-1))
Problem p03308 (python)

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

Amax = max(A)
Amin = min(A)

ans = Amax - Amin
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input()split()))

Amax = max(A)
Amin = min(A)

ans = Amax - Amin
print(ans)