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

Fixed submission:
"""
int(input())
map(int,input().split())
list(map(int,input().split()))

"""

n=int(input())
a=list(map(int,input().split()))
i=1
for j in range(len(a)):
    if(a[j]==i):
        i+=1
if(1 not in a):
    print(-1)
else:
    print(n-i+1)

Buggy submission (verdict: Runtime Error):
"""
int(input())
map(int,input().split())
list(map(int,input().split()))

"""
def found(a,n):
    if(n==1 and n in a):
        return True
    elif(n==1 and n not in a):
        return False
    elif(n>len(a)):
        return False
    for i in range(len(a)-1,-1,-1):
        if(a[i]==n):
            return found(a[0:i],n-1)
    return False
            
            
            
n=int(input())
a=list(map(int,input().split()))
ans=-1
for i in range(n-1,-1,-1):
    x=a[i]
    if(found(a[0:i],x-1)):
        ans=max(ans,x)
        
if(n==1 and a==[1]):
    ans=1
if(ans!=-1):
    print(n-ans)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
"""
int(input())
map(int,input().split())
list(map(int,input().split()))

"""
def found(a,n):
    if(n==1 and n in a):
        return True
    elif(n==1 and n not in a):
        return False
    for i in range(len(a)-1,-1,-1):
        if(a[i]==n):
            return found(a[0:i],n-1)
    return False
            
            
            
n=int(input())
a=list(map(int,input().split()))
ans=-1
for i in range(n-1,-1,-1):
    x=a[i]
    if(found(a[0:i],x-1)):
        ans=max(ans,x)
        
if(n==1 and a==[1]):
    ans=1
if(ans!=-1):
    print(n-ans)
else:
    print(-1)
Problem p03045 (python)

Fixed submission:
import math
import operator as op
from functools import reduce
from fractions import Fraction as frac

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
def rd(p):
    if(p==0):
        return input()
    if(p==1):
        return int(input())
    if(p==2):
        return map(int,input().split())
    if(p==3):
        return list(map(int,input().split()))

global par
par=[-1 for i in range(100001)]
# t=rd(1)
def find(u):
    if(par[u]<0):
        return u
    else:
        return find(par[u])
def uni(x,y):
    u=find(x)
    v=find(y)
    if u==v:
        return
    if(par[u]<par[v]):
        par[u]+=par[v]
        par[v]=u
    else:    
        par[v]+=par[u]
        par[u]=v
t=1
for term in range(1,t+1):
    n,m=rd(2)
    for i in range(m):
        x,y,z=rd(2)
        uni(x,y)
        # print(par[1:n+1])
    ans=0
    for i in range(1,n+1):
        if(par[i]<0):
            ans+=1
    
    print(ans)

Buggy submission (verdict: Runtime Error):
import math
import operator as op
from functools import reduce
from fractions import Fraction as frac

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
def rd(p):
    if(p==0):
        return input()
    if(p==1):
        return int(input())
    if(p==2):
        return map(int,input().split())
    if(p==3):
        return list(map(int,input().split()))
        

# t=rd(1)
def find(u,par):
    if(par[u]<0):
        return u
    else:
        return find(par[u],par)
def uni(x,y,par):
    u=find(x,par)
    v=find(y,par)
    if(par[u]<par[v]):
        par[u]+=par[v]
        par[v]=u
        
    else:
        par[v]+=par[u]
        par[u]=v
t=1
for term in range(1,t+1):
    n,m=rd(2)
    par=[-1 for i in range(n+1)]
    
    
    for i in range(m):
        x,y,z=rd(2)
        uni(x,y,par)
    ans=0
    for i in range(1,n+1):
        if(par[i]<0):
            ans+=1
    print(ans)

Buggy submission (verdict: Runtime Error):
import math
import operator as op
from functools import reduce
from fractions import Fraction as frac

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
def rd(p):
    if(p==0):
        return input()
    if(p==1):
        return int(input())
    if(p==2):
        return map(int,input().split())
    if(p==3):
        return list(map(int,input().split()))
        

# t=rd(1)
def find(u,par):
    if(par[u]<0):
        return u
    else:
        return find(par[u],par)
def uni(x,y,par):
    u=find(x,par)
    v=find(y,par)
    if(par[u]<par[v]):
        par[u]+=par[v]
        par[y]=u
        
    else:
        par[v]+=par[u]
        par[x]=v
t=1
for term in range(1,t+1):
    n,m=rd(2)
    par=[-1 for i in range(n+1)]
    
    
    for i in range(m):
        x,y,z=rd(2)
        uni(x,y,par)
    ans=0
    for i in range(1,n+1):
        if(par[i]<0):
            ans+=1
    print(ans)
Problem p03745 (python)

Fixed submission:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
# import math
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
#sys.stdin = open("input.txt", "r")
#sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)

# def seive():
#     prime=[1 for i in range(10**6+1)]
#     prime[0]=0
#     prime[1]=0
#     for i in range(10**6+1):
#         if(prime[i]):
#             for j in range(2*i,10**6+1,i):
#                 prime[j]=0


n=int(input())
a=list(map(int,input().split()))
ans=1
temp=0
for i in range(1,n):
  if a[i-1]<a[i] and temp==0:
    temp=1
  elif a[i-1]>a[i] and temp==0:
    temp=2
  elif a[i-1]>a[i] and temp==1:
    temp=0
    ans=ans+1
  elif a[i-1]<a[i] and temp==2:
    temp=0
    ans=ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
# import math
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
sys.stdin = open("input.txt", "r")
sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)

# def seive():
#     prime=[1 for i in range(10**6+1)]
#     prime[0]=0
#     prime[1]=0
#     for i in range(10**6+1):
#         if(prime[i]):
#             for j in range(2*i,10**6+1,i):
#                 prime[j]=0


n=int(input())
a=list(map(int,input().split()))
ans=1
temp=0
for i in range(1,n):
  if a[i-1]<a[i] and temp==0:
    temp=1
  elif a[i-1]>a[i] and temp==0:
    temp=2
  elif a[i-1]>a[i] and temp==1:
    temp=0
    ans=ans+1
  elif a[i-1]<a[i] and temp==2:
    temp=0
    ans=ans+1
print(ans)
Problem p02729 (python)

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, M: int):
    t = N + M
    return t * (t - 1) // 2 - N * M


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    print(solve(N, M))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(N: int, M: int):
    t = N + M
    return t * (t - 1) // 2 - N * M


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    print(solve(N, M))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
Problem p02766 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
from itertools import takewhile, count


def solve(N: int, K: int):
    return max(takewhile(lambda i: N >= (K ** i), count(0))) + 1

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(solve(N, K))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
from itertools import takewhile, count


def solve(N: int, K: int):
    return max(takewhile(lambda i: N >= (K ** i), count(1))) + 1

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(solve(N, K))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
from itertools import takewhile, count


def solve(N: int, K: int):
    return max(takewhile(lambda i: N > (K ** i), count(1))) + 1

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(solve(N, K))

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

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, K: int, H: "List[int]"):
    if K >= N:
        return 0
    return sum(sorted(H, reverse=True)[K:])


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    H = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, K, H))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(N: int, K: int, H: "List[int]"):
    if K >= N:
        return 0
    return sum(sorted(H, reverse=True)[K:])


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    H = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, K, H))

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

Fixed submission:
A, B = list(map(int, input().split()))
print(A * B if (A < 10 and B < 10) else -1)

Buggy submission (verdict: Runtime Error):
A, B = list(map(int, input().split()))
print(A * B if (A < 10 && B < 10) else -1)
Problem p02954 (python)

Fixed submission:
import numpy as np
from scipy.sparse import csr_matrix

S = input()
N = len(S)
row = tuple(range(N))
col = [n + (1 if s == 'R' else -1) for n, s in enumerate(S)]
data = [1] * N
mat = csr_matrix((data, (row, col)), shape=(N, N))
print(*np.ones(N, dtype=np.int) * (mat ** 10 ** 100))

Buggy submission (verdict: Runtime Error):
import numpy as np

S = input()
N = len(S)
arr = np.zeros((N, N), dtype=np.int)
#for n, s in enumerate(S):
#    i = n
#    j = n + (1 if s == 'R' else -1)
#    arr[i, j] += 1
#mat = np.matrix(arr)
#print(*(np.ones(N, dtype=np.int) * (mat ** 10 ** 100)).tolist()[0])
print()

Buggy submission (verdict: Runtime Error):
import numpy as np

S = input()
N = len(S)
arr = np.zeros((N, N), dtype=np.int)
for n, s in enumerate(S):
    i = n
    j = n + (1 if s == 'R' else -1)
    arr[i, j] += 1
#mat = np.matrix(arr)
#print(*(np.ones(N, dtype=np.int) * (mat ** 10 ** 100)).tolist()[0])
print()

Buggy submission (verdict: Runtime Error):
import numpy as np

S = input()
N = len(S)
arr = np.zeros((N, N), dtype=np.int)
for n, s in enumerate(S):
    i = n
    j = n + (1 if s == 'R' else -1)
    arr[i, j] += 1
mat = np.matrix(arr)
#print(*(np.ones(N, dtype=np.int) * (mat ** 10 ** 100)).tolist()[0])
print(0)

Buggy submission (verdict: Runtime Error):
import numpy as np

S = input()
N = len(S)
arr = np.zeros((N, N), dtype=np.int)
for n, s in enumerate(S):
    i = n
    j = n + (1 if s == 'R' else -1)
    arr[i, j] += 1
mat = np.matrix(arr)
print(*(np.ones(N, dtype=np.int) * (mat ** 10 ** 100)).tolist()[0])

Buggy submission (verdict: Runtime Error):
import numpy as np

S = input()
N = len(S)
arr = np.zeros((N, N), dtype=np.int)
for n, s in enumerate(S):
    i = n
    j = n + (1 if s == 'R' else -1)
    arr[i, j] += 1
mat = np.matrix(arr)
print(*(np.ones(N, dtype=np.int) * mat ** 10 ** 100).tolist()[0])

Buggy submission (verdict: Runtime Error):
import numpy as np

S = input()
N = len(S)
arr = np.zeros((N, N), dtype=np.int)
for n, s in enumerate(S):
    i = n
    j = n + (1 if s == 'R' else -1)
    arr[i, j] += 1
mat = np.matrix(arr)
print(*(np.ones(N, dtype=np.int) * mat ** (10 ** 100)).tolist()[0])
Problem p03042 (python)

Fixed submission:
def f(y, m):
	if y in range(1, 13) and m in range(1, 13):
		return "AMBIGUOUS"
	if m in range(1, 13):
		return "YYMM"
	if y in range(1, 13):
		return "MMYY"
	return "NA"
  
S = input()
y, m = int(S[:2]), int(S[2:])
print(f(y, m))

Buggy submission (verdict: Runtime Error):
def f(y, m):
	if y in range(1, 13) and m in range(1, 13):
      return "AMBIGUOUS"
    if m in range(1, 13):
      return "YYMM"
    if y in range(1, 13):
      return "MMYY"
    return "NA"
  
S = input()
y, m = int(S[:2]), int(S[2:])
print(f(y, m))
Problem p03075 (python)

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(a: int, b: int, c: int, d: int, e: int, k: int):
    X = (a, b, c, d, e)
    for i, x in enumerate(X):
        for xx in X[i+1:]:
            if abs(x - xx) > k:
                return ':('
    return 'Yay!'

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    d = int(next(tokens))  # type: int
    e = int(next(tokens))  # type: int
    k = int(next(tokens))  # type: int
    print(solve(a, b, c, d, e, k))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
a = [int(input()) for _ in range(6)]
print('Yay!' if a[-2]-a[0]=<a[-1] else ':(')
Problem p03634 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(200000)

def solve(N: int, a: "List[int]", b: "List[int]", c: "List[int]", Q: int, K: int, x: "List[int]", y: "List[int]"):
    edges = [[] for _ in range(N+1)]
    for aa, bb, cc in zip(a, b, c):
        edges[aa].append((bb, cc))
        edges[bb].append((aa, cc))
    costs = [None] * (N + 1)
    def dfs(n, cost):
        if costs[n] is not None:
            return
        costs[n] = cost
        for nn, cc in edges[n]:
            dfs(nn, cost+cc)
    dfs(K, 0)
    for xx, yy in zip(x, y):
        print(costs[xx]+costs[yy])
    return

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    c = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    Q = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [int()] * (Q)  # type: "List[int]"
    y = [int()] * (Q)  # type: "List[int]"
    for i in range(Q):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, a, b, c, Q, K, x, y)

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]", b: "List[int]", c: "List[int]", Q: int, K: int, x: "List[int]", y: "List[int]"):
    edges = [[] for _ in range(N+1)]
    for aa, bb, cc in zip(a, b, c):
        edges[aa].append((bb, cc))
        edges[bb].append((aa, cc))
    costs = [None] * (N + 1)
    def dfs(n, c):
        if costs[n] is not None:
            return
        costs[n] = c
        for nn, cc in edges[n]:
            dfs(nn, c+cc)
    dfs(K, 0)
    for xx, yy in zip(x, y):
        print(costs[xx]+costs[yy])
    return

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    c = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    Q = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [int()] * (Q)  # type: "List[int]"
    y = [int()] * (Q)  # type: "List[int]"
    for i in range(Q):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, a, b, c, Q, K, x, y)

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
Problem p02633 (python)

Fixed submission:
def main():
    x = int(input())
    if False:
        print((360 // x) if 360%x == 0 else (360 // x)+1)
    else:
        k = 1
        temp = x
        while temp % 360 != 0:
            k += 1
            temp += x
        print(k)


    temp = 360 // x

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import turtle


def main():
    x = int(input())
    if False:
        print((360 // x) if 360%x == 0 else (360 // x)+1)
    else:
        k = 1
        temp = x
        while temp % 360 != 0:
            k += 1
            temp += x
        print(k)


    temp = 360 // x

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

Fixed submission:
from itertools import combinations_with_replacement


def main():
    n,m,q = map(int,input().split())
    num_lst = []
    for i in range(q):
        num_lst.append(list(map(int,input().split())))
    l = list(range(1,m+1))
    A = list(combinations_with_replacement(l,n))

    mx = 0
    for now_A in A:
        score = 0
        for nums in num_lst:
            a,b,c,d = nums
            if now_A[b-1] - now_A[a-1] == c:
                score += d
        mx = max(mx,score)
    print(mx)



if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

n,m,q = map(int,input().split())
num_lst = []
for i in range(q):
    num_lst.append(list(map(int,input().split())))
l = list(range(1,m+1))
A = list(combinations_with_replacement(l,n))

mx = 0
for now_A in A:
    score = 0
    for nums in num_lst:
        a,b,c,d = nums
        if now_A[b-1] - now_A[a-1] == c:
            score += d
    mx = max(mx,score)
print(mx)
Problem p02754 (python)

Fixed submission:

def main():
    n,blue,red = map(int,input().split())
    total = blue+red
    answer = 0
    answer += (n // total) * blue
    amari = min(blue,(n % total))
    answer += amari
    print(answer)




if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    s = input()
    q = int(input())
    hanten = False
    for i in range(q):
        query = input().split()
        if query[0] == "1":
            hanten = not hanten
        else:
            if query[1] == "1":
                if hanten:
                    s = s + query[2]
                else:
                    s = query[2] + s
            if query[1] == "2":
                if hanten:
                    s = query[2] + s
                else:
                    s = s + query[2]
    print(s if not hanten else s[::-1])



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

Fixed submission:
n = int(input())
s = input()
half = n//2

if half == 0:
  				print("No")

elif s == (s[0:half] + s[0:half]):
                 print("Yes")
else:
                 print("No")

Buggy submission (verdict: Runtime Error):
    n = int(input())
    s = input()
    half = n//2
     
    if s == (s[0:half] + s[0:half]):
             print("Yes")
    else:
             print("No")

Buggy submission (verdict: Runtime Error):
n = int(inpur())
s = input()
half = n//2

if s == (s[0:half] + s[0:half]:
         print("Yes")
else:
         print("No")
Problem p02879 (python)

Fixed submission:
a,b = map(int,input().split())
     
def solve(a,b):
  if a<=9 and b<=9:
    return a * b
  else:
    return -1
  
print(solve(a,b))

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

def solve(a,b):
  if a<=9 and b<=9:
    return a * b
  else:
    return -1
  
print(solve(a,b))

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

def solve(a,b)
	if a <= 9 and b <= 9:
  	  return a * b
  	else:
      return pr
    
print(solve(a,b))
Problem p02897 (python)

Fixed submission:
n=int(input())
odd=(n+1)//2
print(odd/n)

Buggy submission (verdict: Runtime Error):
 n=int(input())
 odd=(n+1)//2
 print(odd/n)