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

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def is_kaibun(_S):
    if len(_S)==1 or _S[:int((len(_S))/2)]==_S[int((len(_S)+1)/2):][::-1]:
        return True
    else:
        return False

def main():
    _S = S()
    is_tsuyoi1 = is_kaibun(_S)
    is_tsuyoi2 = is_kaibun(_S[:int((len(_S)-1)/2)])
    is_tsuyoi3 = is_kaibun(_S[int((len(_S)+1)/2):])
    print("Yes" if is_tsuyoi1 and is_tsuyoi2 and is_tsuyoi3 else "No")


main()

Buggy submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def is_kaibun(_S):
    if _S[:int((len(_S)-1)/2)]==_S[int((len(_S)+1)/2):][::-1]:
        return True
    else:
        return False

def main():
    _S = S()
    is_tsuyoi1 = is_kaibun(_S)
    is_tsuyoi2 = is_kaibun(_S[:int((len(_S)-1)/2)])
    is_tsuyoi3 = is_kaibun(_S[int((len(_S)+3)/2)])
    print("Yes" if is_tsuyoi1 and is_tsuyoi2 and is_tsuyoi3 else "No")


main()
Problem p02732 (python)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def comb(n):
    return int(n*(n-1)/2)

def main():
    N = I()
    A_list = LI()
    A_ctr = collections.Counter(A_list)
    base = 0
    for i in range(1,N+1):
        base += comb(A_ctr[i])
    for i in range(1,N+1):
        i_val = A_ctr[A_list[i-1]]
        before = comb(i_val)
        after = comb(i_val-1)
        print(int(base - before + after))
main()

Buggy submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def comb(n):
    return int(n*(n-1)/2)

def main():
    N = I()
    A_list = LI()
    A_ctr = collections.Counter(A_list)
    for i in range(1,N+1):
        tmp_A_ctr = A_ctr.copy()
        tmp_A_ctr[A_list[i-1]] -= 1
        ans = 0
        for v in tmp_A_ctr.values():
            ans += comb(v)
        else:
            print(ans)

main()
Problem p02756 (python)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    S = _S()
    Q = I()
    Querys = [LS() for _ in range(Q)]
    rev_flg = -1
    dq = collections.deque(S)
    for q in Querys:
        if q[0]=='1':
            rev_flg *= -1
        else:
            ti,fi,ci = q
            if int(fi)*rev_flg in (1,-2):
                dq.append(ci)
            else:
                dq.appendleft(ci)

    print("".join(dq)[::-1] if rev_flg==1 else "".join(dq))

main()

Buggy submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def reverse(S):
    return S[::-1]

def main():
    S = _S()
    Q = I()
    Querys = [LS() for _ in range(Q)]
    s = S
    for q in Querys:
        # print(q)
        if q[0]=='1':
            s = reverse(s)
        elif q[0]=='2':
            ti,fi,ci = q
            # print(ti,fi,ci)
            if fi=='1':
                s = ci + s
            elif fi=='2':
                s = s + ci
            else:
                pass
        else:
            pass
    print(s)

main()
Problem p02761 (python)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    N,M = LI()
    SC = [LI() for _ in range(M)]
    a = [0 for _ in range(N)]
    pre = [None for _ in range(N)]
    # for s,c in SC:
    #     s = s-1
    #     if (a[s]==c) or (pre[s] is None):
    #         pre[s] = a[s]
    #         a[s] = c
    #     else:
    #         print(-1)
    #         exit(0)
    # ans = int("".join(map(str,a)))
    # if len(str(ans))==N:
    #     print("{}".format(int(ans)))
    # else:
    #     print(-1)

    for i in range(1000):
        i = str(i)
        if len(i)==N:
            for s,c in SC:
                if i[s-1] == str(c):
                    # print(i[s-1], c)
                    continue
                else:
                    break
            else:
                print(i)
                exit(0)
        else:
            continue
    else:
        print(-1)

main()

Buggy submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    N,M = LI()
    SC = [LI() for _ in range(M)]
    a = [0 for _ in range(N)]
    pre = [None for _ in range(N)]
    for s,c in SC:
        s = s-1
        if (a[s]==c) or (pre[s] is None):
            pre[s] = a[s]
            a[s] = c
        else:
            print(-1)
            exit(0)
    ans = int("".join(map(str,a)))
    if len(str(ans))==N:
        for i in range(N,3):
            if pre[i] is not None:
                print(-1)
                exit(0)
            else:
                pass
        print("{}".format(int(ans)))
    else:
        print(-1)
main()
Problem p03719 (python)

Fixed submission:
a,b,c=map(int,input().split());print("Yes" if a<=c<=b else "No")

Buggy submission (verdict: Runtime Error):
# a,b,c=map(int,input().split());print("Yes" if a<=c<=b else "No")

# a,b,c=map(int,input().split());print('NYoe s'[a<=c<=b::2])
# a,b,c=map(int,input().split())
# print(a,b,c)
# import numpy as np
# arr = np.fromstring(input(), sep=" ")
# print(arr)


*s,c=input().split();print(["No","Yes"][int(s[0])<=c<=s[1]])
# print(*s[2::]<=c)
# print(exec("$0=substr(\"YesNo\",$3<$1||$3>$2?4:1,3))")
Problem p02576 (python)

Fixed submission:
a = input().split(" ")
g = int(a[0])
c = int(a[1])
b = int(a[2])
l = c
m = b
while c < g :
    c = c + l
    b = b + m
print(b)

Buggy submission (verdict: Runtime Error):
a = input()
s = 0
for i in a:
    s += int(i)
if s % 9 == 0 :
    print("Yes")
else:
    print("No")
Problem p02639 (python)

Fixed submission:
a = input().split(" ")
m = len(a)
b = 0
while b < m :
    if a[b] == "0":
        print(b + 1)
    b = b + 1

Buggy submission (verdict: Runtime Error):
a = input().split(" ")
m = len(a)
b = 0
while b < m :
    if a[b]=="0"
    print(b)
    b = b + 1
Problem p02657 (python)

Fixed submission:
a = input().split(" ")
print(int(a[0])*int(a[1]))

Buggy submission (verdict: Runtime Error):
a = input().split(" ")
print(a[0]*a[1])
Problem p02658 (python)

Fixed submission:
a = int(input())
b = input().split(" ")
i = 0
s = 1
f = 0
while i < a :
    if b[i] == "0" :
        print(0)
        f = f + 1
    i = i + 1
i = 0
while (i < a) and f == 0 :
    s = s * int(b[i])
    i = i + 1
    if s > (10 ** 18):
        print("-1")
        break
    if (s <= 10 ** 18) and (i == a):
        print(s)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = input().split(" ")
i = 0
s = 1
while i < a :
    s = s * int(b[i])
    i = i + 1
if s > (10 ** 18) :
    print("-1")
else:
    print(s)
Problem p02606 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import math

#L, R, d = map(int, input().parse())
L, R, d = map(int, input().split())
start_d = int(math.ceil(L / d))
end_d = int(math.floor(R / d))
print(end_d - start_d +1)

Buggy submission (verdict: Runtime Error):
import math

L, R, d = map(int, input().parse())

num = 0
start_d = int(math.ceil(L / d))
end_d = int(math.floor(R / d))

print(end_d - start_d +1)

Buggy submission (verdict: Runtime Error):
import math

L, R, d = map(int, input().parse())

num = 0
start_d = int(math.ceil(L / d))
end_d = int(math.floor(R / d))

return end_d - start_d +1
Problem p02607 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import math

N = int(input())
# print(N)
ai = input().split(' ')
# print(ai)
num = 0
for i in range(N):
    if i % 2 == 0:
        if int(ai[i]) % 2 == 1:
            # print('asd' + str(i))
            # print('hoge' + str(ai[i*2]))
            num += 1

print(num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

N = int(input())
# print(N)
ai = input().split(' ')
# print(ai)
num = 0
for i in range(N):
    if i % 2 == 0:
        if int(ai[i*2]) % 2 == 1:
            # print('asd' + str(i))
            # print('hoge' + str(ai[i*2]))
            num += 1

print(num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

N = int(input())
# print(N)
ai = input().split(' ')
# print(ai)
num = 0
for i in range(math.floor(N/2) + 1):
    if int(ai[i*2]) % 2 == 1:
        # print('asd' + str(i))
        # print('hoge' + str(ai[i*2]))
        num += 1

print(num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

N = input()
# print(N)
ai = input().split()
# print(ai)
num = 0
for i in range(N/2):
    if ai[i + 1] % 2 == 1:
        num += 1

print(num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

N = input()
# print(N)
ai = input().split()
# print(ai)
num = 0
for i in range(N/2):
    if ai[i + 1] % 2 == 1:
        num += 1

print(num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

N = map(int, input().split())
ai = input().split()

num = 0
for i in range(N/2):
    if ai[i + 1] % 2 == 1:
        num += 1

print(num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

N = map(int, input().split())
ai = input().split()

num = 0
for i in range(N):
    if ai[i] % 2 == 1:
        num += 1
    i += 1

print(i)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

N = map(int, input().split())
ai = input().split()

num = 0
for i in range(N):
    if ai[i] % 2 = 1:
        num += 1
    i += 1

print(i)
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())

for i in range(x+1):
    foot = 2*i + 4* (x-i)
    if foot == y:
        print('Yes')
        exit()
print('No')

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())

c = [4,2]
count = []

for i in range(x-1):
    for j in range(x-1):
        for k in range(x-1):
            sum = c[i]+c[j]+c[k]
            count.append(sum)

if count.count(y) or (x == 1 and y == 2) or (x == 1 and y == 4):
    print('Yes')
else:
    print('No')
Problem p02658 (python)

Fixed submission:
n = int(input())
nums = list(map(int, input().split()))
ans = 1

if nums.count(0) > 0:
  ans = 0
else:
  for i in range(n):
    ans *= nums[i]
    if ans > 10**18:
      ans = -1
      break

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int, input().split()))
ans = 1

if nums.count(0) > 0:
  ans = 0
else:
  for i in range(n):
    ans *= nums[i]
    if ans >= 10**18:
      ans = -1
      break
  else:
    break
 
print(ans)
Problem p02772 (python)

Fixed submission:
x = input()
y = input()
list = y.split()
even_list = []
result = ''

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
  else:
    result = "APPROVED"
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APPROVED"
  else:
    result = "DENIED"
    break
    
print(result)

Buggy submission (verdict: Runtime Error):
x = input()
y = input()
list = y.split()
even_list = []

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APROVED"
  else:
    result = "DENIED"
    break
    
print(result)
Problem p02909 (python)

Fixed submission:
x = input()
list = ['Sunny', 'Cloudy', 'Rainy', 'Sunny']
 
for i in range(len(list) - 1):
    theday = list[i]
    if x == theday:
        answer = list[i + 1]
print(answer)

Buggy submission (verdict: Runtime Error):
x = input()
list = ['Sunny', 'Cloudy', 'Rainy', 'Sunny']

for i in range(len(list)):
    theday = list[i]
    if x == theday:
        answer = list[i + 1]
print(answer)
Problem p02922 (python)

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

for i in range(20):
  c = (a * i) - (i - 1)
  if c >= b:
    ans = i
    break
  
print(ans)

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

for i in range(10):
  c = (a * i) - (i - 1)
  if c >= b:
    ans = i
    break
  
print(ans)
Problem p02719 (python)

Fixed submission:
line = input()
n, k = line.split(" ")
n = int(n)
k = int(k)

temp = n % k
if temp == 0:
    print(0)
elif abs(temp - k) < temp:
    print(abs(temp - k))
elif abs(temp -k) > temp:
    print(temp)

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

if 1 <= k and k <= 12:
    print(k)
elif 13 <= k and k <= 35:
    temp = k-9
    q = temp // 3
    p = temp % 3
    
    s = ""
    s = s + str(q)
    if p == 0:
        s = s + str(q+1)
    elif p == 1:
        s = s + str(q)
    elif p == 2:
        s = s + str(q-1)
print(s)
Problem p02765 (python)

Fixed submission:
line = input()
n, r = line.split(" ")

if int(n) < 10:
    rate = int(r) + (100*(10-int(n)))
    print(rate)
else:
    print(int(r))

Buggy submission (verdict: Runtime Error):
import statistics

def cal_hp(p, num_list):
    total = 0
    for num in num_list:
        temp = (num - p) ** 2
        total = total + temp
    return total

line1 = input()
line2 = input()

num_list = line2.split(" ")
num_list = [int(n) for n in num_list]
ans_list = []

for i in range(0, max(num_list)+1):
    ans_list.append(cal_hp(i, num_list))
print(min(ans_list))
Problem p02786 (python)

Fixed submission:
def f(x):
    if x == 1:
        return 1
    else:
        return 2*f(int(x/2))+1

h = input()
h = int(h)
print(f(h))

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

def func_dame(h):
    if h == 1:
        return 1
    else:
        return 2 * func_dame(h/2) + 1
atack_num = 2 * func_dame(h / 2) + 1
print(atack_num)
Problem p02658 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
res=1
if 0 in a:
  print("0")
else:
  for x in a:
    res=res*x
    if(res>1000000000000000000):
      res=-1
      break
  print(res)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=1000000000000000000
res=1
for i in range(n):
  x=int(input())
  res=res*x
if(res>x):
  print("-1")
else:
  print(res)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=1000000000000000000
res=1
for i in range(n):
	res=res*int(input())
if(res>x):
	print("-1")
else:
	print(res)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=1000000000000000000
res=1
for i in range(n):
  res=res*int(input())
if(res>x):
  print("-1")
else:
  print(res)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
 
if(S==T[:len(S)]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = ipnut()
T = input()
 
if(S==T[:len(S)-1]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = ipnut()
T = input()
 
if(S==T[:len(S)]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = ipnut()
T = input()

if(S==T[:-1]):
  print("Yes")
else:
  print("No")
Problem p02844 (python)

Fixed submission:
# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    if (now == 3):
                        # print(v)
                        break
                    temp = v[now]
            if (now == 3):
                ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    temp=v[now]
                    if (now == 3):
                        # print(v)
                        break
            if (now == 3):
                ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

#入力
N=int(input())
A = [int(x) for x in list(input())]
ans = 0
num=[[0]*10 for _ range(10)]

for i,j,k in itertools.combinations(A, 3):
    if(num[i][j][k] == 0):
        num[i][j][k] =1
        ans += 1
        
print(ans)
Problem p02866 (python)

Fixed submission:
n=int(input())
d=[int(x) for x in input().split()]
ans=True
if(d[0]!=0):
    ans=False
d.sort()
dd=[0]*10**5
max=0
for i in d:
    dd[i]+=1
    if(max<i):
        max=i

now=1
before=0
if(dd[0]!=1):
    ans=False
else:
    before=1

for i in range(1,max+1):
    if(dd[i]==0):
        ans=False
    now=now*(before**dd[i]) % 998244353
    before=dd[i]
    #print(dd[i],now)

if(ans):
    print(now)
else:
    print("0")

Buggy submission (verdict: Runtime Error):
n=int(input())
d=[int(x) for x in input().split()]

d.sort()
dd=[0]*10**5
for i in d:
    d[i]+=1

ans=True
now=1
if(dd[0]!=1):
    ans=False
else:
    before=1

for i in dd[1:]:
    if(i==0):
        ans=False
    now=now*(before**i) % 998244353

if(ans):
    print(now)
else:
    print("0")
Problem p02888 (python)

Fixed submission:
import bisect

N=int(input())
D=[int(x) for x in input().split()]

D.sort()
total=0

for i in range(N-2):
    for j in range(i+1,N-1):
        total+=bisect.bisect_left(D,D[i]+D[j])-j-1

print(total)

Buggy submission (verdict: Runtime Error):
import bisect

N=[int(x)for x in input().split()]
D=[int(x) for x in input().split()]

D.sort()
total=0

for i in range(N-2):
    for j in range(i+1,N-1):
        total+= bisect.bisect_left(D[j+1:],D[i]+D[j])

print(total)
Problem p03067 (python)

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

if(a<c and b>c or c<a and b<c):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=input()
s=input()

N=int(N)
wn=[]
bn=[]
a=0
b=0

#各行間よりも前と後ろに何個白（黒）があるかをカウント
for i in range(N):
    j=N-(i+1)
    if(s[j]=="."):
        a+=1
    if(s[i]=="#"):
        b+=1
    bn.insert(0,a)
    wn.append(b)
bn.append(0)
wn.insert(0,0)
#print(bn)
#print(wn)

#各行間のscore算出
min=1000000
for i in range(N+1):
    score=bn[i]+wn[i]
    if(score<min):
        min=score

print(min)
Problem p03076 (python)

Fixed submission:
import numpy as np

num = [] #５個の料理の必要時間
total = 0
mini = 10
b = 1
for i in range(5): #入力
    a = input()
    a = int(a)
    b = a % 10 #bにはaの１の桁が０になったものが入る
    total += a - b
    if b != 0:
        total+=10
        if b < mini:
            mini=b


if mini== 10:
    print(total)
else:
    print(total -(10-mini))

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

num = [] #５個の料理の必要時間
total = 0
mini = 10
for i in range(5): #入力
    a = input()
    a = int(a)
    b = a % 10 #bにはaの１の桁が０になったものが入る
    total += a - b + 10
    if b == 0:
        total -=10
    else:
        if b < mini:
            mini=b

total -=10
if mini= 10:
    print(total)
else:
    print(total + mini)
Problem p03302 (python)

Fixed submission:
a,b=[int(x) for x in input().split()]
  
if(a*b==15):
  print("*")
elif(a+b==15):
  print("+")
else:
  print("x")

Buggy submission (verdict: Runtime Error):
 a,b=[int(x) for x in input().split()]
  
  if(a*b==15):
    print("*")
  elif(a+b==15):
    print("+")
  else:
    print("x")
Problem p03303 (python)

Fixed submission:
s = input()
w = int(input())
ans = ""
for i in range(-(-len(s) // w)):
    ans = ans + s[i * w]

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
w = int(input())
ans=""
for i in range(w):
  ans = ans + s[i*w]

print(ans)
Problem p03417 (python)

Fixed submission:
im = []
im = input().split(' ')
N = int(im[0])
M = int(im[1])
if (N == 1 and M == 1) or (N != 1 and M != 1):
    print((N - 2) * (M - 2))
else:
    print(N * M - 2)

Buggy submission (verdict: Runtime Error):
IN=input().split(' ')
N=IN[0]
M=IN[1]
if (N==1 and M==1)or (N!=1 and M!=1):
    print((N-2)*(M-2))
else:
    print(N*M-2)
Problem p03644 (python)

Fixed submission:
import logging
logging.basicConfig(level=logging.CRITICAL,format=' %(asctime)s - %(levelname)s - %(message)s')

def power(n):
    i = 1
    logging.info('func start')
    while n > 0:
        i *= 2
        n -= 1
        logging.debug('i = {}, n = {}'.format(i,n))
    logging.info('func end')
    return i

i = 0
n = int(input())
logging.info('in loop')
while not (power(i + 1) > n):
    i = i + 1
    logging.debug('i = {}, pow(i) = {}'.format(i,power(i)))

logging.info('out loop')
print(power(i ))

Buggy submission (verdict: Runtime Error):
import logging
logging.basicConfig(level=logging.CRITICAL,format=' %(asctime)s - %(levelname)s - %(message)s')
 
def power(n):
    i = 1
    logging.info('func start')
    while n > 0:
        i *= 2
        n -= 1
        logging.debug('i = {}, n = {}'.format(i,n))
    logging.info('func end')
    return i
 
i = 0
n = int(input())
logging.info('in loop')
while power(i+1) < n:
    i = i + 1
    logging.debug('i = {}, pow(i) = {}'.format(i,power(i)))
 
logging.info('out loop')
print(power(i ))

Buggy submission (verdict: Runtime Error):


def power2(n):
    i=1
    while n>0:
        i*=2
        n-=1
    return i

i=0
n=input()
while power2(i)<=n:
    i=i+1
    
print(power2(i-1))
Problem p02981 (python)

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

N *= A

if (N) < B:
    print(N)
else:
    print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

N *= A

if (N) < B:
    print(N)
else:
    print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

if (N*A) < B:
    print(N*A)
else:
    print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

if N*A < B:
    print(N*A)
else:
    print(B)
Problem p03433 (python)

Fixed submission:
#N,A =  map(int,input().split())
N = int(input())
A = int(input())
if A >= N % 500:
    print('Yes') 
else:
    print('No')

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

if A >= N % 500:
    print('Yes') 
else:
    print('No')
Problem p03473 (python)

Fixed submission:
M = int(input())
X = 24 + (24-M)
print(X)

Buggy submission (verdict: Runtime Error):
M = map(int, input().split())
X = 24 + (24-M)
print(X)
Problem p02811 (python)

Fixed submission:
K, X = [int(i) for i in input().split()]
print("Yes" if 500*K>=X else "No")

Buggy submission (verdict: Runtime Error):
K, X = [int(i) for i in input().split()]
print("Yes" if 500*K>=X else "No"