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

Fixed submission:
X = int(input())
s = 100
c = 0
while s < X:
  s = s + s  // 100
  c = c + 1
print(c)

Buggy submission (verdict: Runtime Error):
X = int(input())
s = 100
c = 0
while s < X:
	s = s + s  // 100
    c = c + 1
print(c)
Problem p02730 (python)

Fixed submission:
import sys
X=input()
n=len(X)
if n%2==0:
    print("No")
    sys.exit()
ans="No"
def check(s): 
    return s == s[::-1] 
ans="No"
if check(X):
    if check(X[0:int((n-1)/2)]):
        if check(X[int(((n+3)/2)-1):]):
            ans="Yes"
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l=[]
for i in range(n): 
    if ((i%3)!=0)  and ((i%5)!=0):
        l.append(i)
print(sum(l))

Buggy submission (verdict: Runtime Error):
inp=input()
if inp[2]==inp[3] and inp[4]==inp[5]:
  print("Yes")
else:
  print("No")
Problem p02801 (python)

Fixed submission:
alpha="abcdefghijklmnopqrstuvwxyz"
inp=input()
def split(w):
    return [all for all in w]
alpha=split(alpha)
x=alpha.index(inp)
try:
    print(alpha[x+1])
except:
    print("a")

Buggy submission (verdict: Runtime Error):
alpha="abcdefghijklmnomqrstuvwxyz"
inp=input()
def split(w):
    return [all for all in w]
alpha=split(alpha)
x=alpha.index(inp)
try:
    print(alpha[x+1])
except:
    print("a")

Buggy submission (verdict: Runtime Error):
alpha="abcdefghijklmnomqrstuvwxyz"
inp=input()
def split(w):
    return [all for all in w]
alpha=split(alpha)
x=alpha.index(inp)
print(alpha[x+1])
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
list=list(map(int,input().split()))
print(min(list[1]*N, list[2]*N))
Problem p02993 (python)

Fixed submission:
def split(word): 
    return [char for char in word]  
inp=input()
list=split(inp)
count=0
x=1
str="Good"
for i in range(3):
    if list[count]==list[count+1]:
        str="Bad"
    count=count+1
print(str)

Buggy submission (verdict: Runtime Error):
def split(word): 
    return [char for char in word]  
inp=input()
list=split(inp)
count=0
x=1
str="Good"
for i in range(len(3):
    if list[count]==list[count+1]:
        str="Bad"
    count=count+1
print(str)
Problem p03160 (python)

Fixed submission:
import math
def better(l, ans):
    for i in range(2, n):
        ans[i] = min(ans[i - 1] + abs(l[i]-l[i - 1]), ans[i - 2] + abs(l[i]-l[i - 2]))
    return ans
n = int(input())
l = list(map(int, input().split()))
ans = [0] * n
ans[1] = abs(l[1]-l[0])
print(better(l, ans)[len(ans)-1])

Buggy submission (verdict: Runtime Error):
def better(l, i, ready, ans):
    #print(l, i, ready, ans)
    if i==0:
        ready[0]=True
        ans[0]=0
        return l[0], 0
    if i==1:
        ready[1]=True
        ans[1]=abs(l[0]-l[1])
        return l[1], abs(l[0]-l[1])
    else:
        if ready[i]:
            return l[i], ans[i]
        else:
            last, val = better(l, i-1, ready, ans)
            last1, val1 = better(l, i-2, ready, ans)
            #print(last, val, last1, val1)
            xx = min([(abs(last-l[i])+val), (abs(last1-l[i])+val1)])
            ready[i]=True
            ans[i]=xx
            return l[i], xx
n = int(input())
l = list(map(int, input().split()))
if n==0:
    print(0)
    import sys
    sys.exit()
print(better(l, n-1, [False]*n, [0]*n)[1])

Buggy submission (verdict: Runtime Error):
def better(l, i, ready, ans):
    #print(l, i, ready, ans)
    if i==0:
        ready[0]=True
        ans[0]=0
        return l[0], 0
    if i==1:
        ready[1]=True
        ans[1]=abs(l[0]-l[1])
        return l[1], abs(l[0]-l[1])
    else:
        if ready[i]:
            return l[i], ans[i]
        else:
            last, val = better(l, i-1, ready, ans)
            last1, val1 = better(l, i-2, ready, ans)
            #print(last, val, last1, val1)
            xx = min([(abs(last-l[i])+val), (abs(last1-l[i])+val1)])
            ready[i]=True
            ans[i]=xx
            return l[i], xx
n = int(input())
l = list(map(int, input().split()))
print(better(l, n-1, [False]*n, [0]*n)[1])

Buggy submission (verdict: Runtime Error):
inp = int(input())
if inp>=400 and inp<=599:
  ans = 8
elif inp>=600 and inp<=799:
  ans = 7
elif inp>=800 and inp<=999:
  ans = 6
elif inp>=1000 and inp<=1199:
  ans = 5
elif inp>=1200 and inp<=1399:
  ans = 4
elif inp>=1400 and inp<=1599:
  ans = 3
elif inp>=1600 and inp<=1799:
  ans = 2
elif inp>=1800 and inp<=1999:
  ans = 1
print(ans)
Problem p03296 (python)

Fixed submission:
from random import randint
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range (len(l)-1) :
  try:
    if l[i] == l[i + 1]:
        ans += 1
        l[i + 1] = randint(0, 10000)
  except:
    continue
print(ans)

Buggy submission (verdict: Runtime Error):
from numpy.random import randint
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range (len(a)-1) :
  try:
    if l[i] == l[i + 1]:
        ans += 1
        l[i + 1] = randint(0, 10000)
  except:
    continue
print(ans)

Buggy submission (verdict: Runtime Error):
from random import randint
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range (len(a)-1) :
  try:
    if l[i] == l[i + 1]:
        ans += 1
        l[i + 1] = randint(0, 10000)
  except:
    continue
print(ans)

Buggy submission (verdict: Runtime Error):
from random import randint
l = list(map(int, input().split()))
ans = 0
for i in range (len(a) - 1) :
  if l[i] == l[i + 1]:
    ans += 1
    l[i + 1] = randint(0, 10000)
print(ans)
Problem p03427 (python)

Fixed submission:
n = list(map(int, input()))
l = [sum(n)]
for i in range(1, len(n)):
    n[-i] = 9
    n[-i-1] -= 1
    l.append(sum(n)) 
print(max(l))

Buggy submission (verdict: Runtime Error):
import sys
n = input()
intn = int(n)
s = int("1"*len(n))*9
if s==intn:
  print(len(n)*9)
  sys.exit()
ans=int("1"*(len(n)-1))*9
xx = int(n[0])-1
def split(aa):
  return [c for c in aa]
ans=split(str(ans))
c = 0
for i in range(len(ans)):
    ans[c] = int(ans[c])
    c+=1
print(sum(ans)+xx)

Buggy submission (verdict: Runtime Error):
n = input()
intn = int(n)
s = int("1"*len(n))*9
if s==intn:
  print(len(n)*9)
  quit()
ans=int("1"*(len(n)-1))*9
xx = int(n[0])-1
def split(aa):
  return [c for c in aa]
ans=split(str(ans))
c = 0
for i in range(len(ans)):
    ans[c] = int(ans[c])
    c+=1
print(sum(ans)+xx)
Problem p03651 (python)

Fixed submission:
import math
from functools import reduce
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
def hcf(l):
    return reduce(math.gcd, l)
gcd = hcf(A)
m = max(A)
if k%gcd == 0 and k<=m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
l = list(map(float, input().split()))
m = max(l)
def hcf(x, y): 
    while(y): 
        x, y = y, x % y 
    return x 
num1=l[0] 
num2=l[1] 
gcd=hcf(num1,num2) 
for i in range(2,len(l)): 
    gcd=hcf(gcd,l[i])
if k%gcd == 0 and k<=m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
l = list(map(int, input().split()))
m = max(l)
def hcf(x, y): 
    while(y): 
        x, y = y, x % y 
    return x 
num1=l[0] 
num2=l[1] 
gcd=hcf(num1,num2) 
for i in range(2,len(l)): 
    gcd=hcf(gcd,l[i])
if k%gcd == 0 and k<=m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
l = list(map(int, input().split()))
m = max(a)
def hcf(x, y): 
    while(y): 
        x, y = y, x % y 
    return x 
num1=l[0] 
num2=l[1] 
gcd=hcf(num1,num2) 
for i in range(2,len(l)): 
    gcd=hcf(gcd,l[i])
if k%gcd == 0 and k<=m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Problem p02641 (python)

Fixed submission:
x,N = list(map(int,input().split(" ")))
if N != 0:
  p = list(map(int,input().split(" ")))
  sa = 0
  ans = -100
else:
  ans = x

while True:
  if ans != -100:
    break
  for i in range(N):
    if x-sa == p[i]:
      break
    if i == N-1:
      if x-sa != p[i]:
        ans = x-sa
  if ans != -100:
    break
  for i in range(N):
    if x+sa == p[i]:
      break
    if i == N-1:
      if x+sa != p[i]:
        ans = x+sa
  if ans != -100:
    break
  sa += 1
print(ans)

Buggy submission (verdict: Runtime Error):
x,N = list(map(int,input().split(" ")))
try:
  p = list(map(int,input().split(" ")))
  sa = 1
  ans = -100
except EOFError:
  ans = x
    
while True:
  if ans != -100:
    break
  for i in range(N):
    if x-sa == p[i]:
      break
    if i == N-1:
      if x-sa != p[i]:
        ans = x-sa
  if ans != -100:
    break
  for i in range(N):
    if x+sa == p[i]:
      break
    if i == N-1:
      if x+sa != p[i]:
        ans = x+sa
  if ans != -100:
    break
  sa += 1
print(ans)
Problem p02811 (python)

Fixed submission:
N = list(map(int,input().split(" ")))
 
if N[0]*500 >= N[1]:
  print("Yes")
else:
  print("No")

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

if N[0]*500 >= N[1]:
  print("Yes")
elif:
  print("No")
Problem p02818 (python)

Fixed submission:
A,B,K = list(map(int,input().split(" ")))

if A >= K:
  print(A-K, B)
elif A + B >= K:
  print(0, A+B-K)
else:
  print("0 0")

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

takahashi = A
aoki = B

if A >= K:
  print(A-k, B)
elif A + B >= K:
  print(0, A+B-K)
else:
  print("0 0")

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

if A >= K:
  print(A-k, B)
elif A + B >= K:
  print(0, A+B-K)
else:
  print("0 0")
Problem p02767 (python)

Fixed submission:
import numpy as np
n = int(input())
x = [int(i) for i in input().split()]

_list = [-1 for i in range(100)]
if min(x)==max(x):
    print(0)
else:
    for i in range(min(x), max(x), 1):
        a = 0
        for j in range(n):
            a += (x[j]-i)**2
        _list[i] = a
    _list = np.array(_list)
    print(min(_list[_list>=0]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
x = [int(i) for i in input().split()]

_list = [-1 for i in range(100)]
if n==1:
    print(0)
else:
    for i in range(min(x), max(x), 1):
        a = 0
        for j in range(n):
            a += (x[j]-i)**2
        _list[i] = a
    _list = np.array(_list)
    print(min(_list[_list>=0]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
x = [int(i) for i in input().split()]

_list = [-1 for i in range(100)]
for i in range(min(x), max(x), 1):
    a = 0
    for j in range(n):
        a += (x[j]-i)**2
    _list[i] = a
_list = np.array(_list)
print(min(_list[_list>=0]))
Problem p02917 (python)

Fixed submission:
n = int(input())
b = [int(i) for i in input().split()]
a = [b[0]]
for i in range(n-2):
    c = min(b[i], b[i+1])
    a.append(c)
    
try:
    if b[-2]<=b[-1]:
        a.append(max(b[-2],b[-1]))
    else:
        a.append(min(b[-2],b[-1]))
except:
    a.append(b[0])
print(sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
b = [int(i) for i in input().split()]
a = [b[0]]
for i in range(n-2):
    c = min(b[i], b[i+1])
    a.append(c)
    
a.append(max(b[-2],b[-1]))
print(sum(a))
Problem p02923 (python)

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = [0]
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    a =1
print(max(max(c_list), count))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = []
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    a =1
print(max(max(c_list), count))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = []
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    break
print(max(max(c_list), count))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = []
for i in range(n-1):
    if h[i]>=h[i+1]:
        count +=1
    else:
        c_list.append(count)
        count= 0
print(max(max(c_list), count))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = []
for i in range(n-1):
    if h[i]>=h[i+1]:
        count +=1
    else:
        c_list.append(count)
        count= 0
print(max(max(c_list), count))
Problem p02939 (python)

Fixed submission:
s = [i for i in input()]
count = 1
s0 = s[0]
flag = 0
for i in range(1, len(s)):
    try:
        if flag==1:
            flag = 0
            continue
        if s0==s[i]:
            s0 = s[i] + s[i+1]
            flag = 1
        else:
            s0 = s[i]
        count += 1
    except:
        continue
print(count)

Buggy submission (verdict: Runtime Error):
s = [i for i in input()]
count = 1
s0 = s[0]
flag = 0
for i in range(1, len(s)):
    if flag==1:
        flag = 0
        continue
    if s0==s[i]:
        s0 = s[i] + s[i+1]
        flag = 1
    else:
        s0 = s[i]
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
s = [i for i in input()]
count = 1
s0 = s[0]
flag = 0
for i in range(1, len(s)):
    if flag==1:
        flag = 0
        continue
    if s0==s[i]:
        s0 = s[i] + s[i+1]
        flag = 1
    else:
        s0 = s[i]
    count += 1
    print(s0)
print(count)
Problem p03000 (python)

Fixed submission:
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
count = 0
try:
    for i, c in enumerate(l):
        count += c
        if count>x:
            p = i+1
            break
    print(p)
except:
    print(n+1)

Buggy submission (verdict: Runtime Error):
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
count = 0
for i, c in enumerate(l):
    count += c
    if count>x:
        p = i+1
        break
print(p)
Problem p02658 (python)

Fixed submission:
import sys
N=int(sys.stdin.readline())
values = []
res = 1
values=sys.stdin.readline().split()
for v in values:
    if int(v) == 0:
        print(0)
        exit(0)

for v in values:
    res *= int(v)
    if res > 1000000000000000000:
        print(-1)
        exit(0)
print(res)

Buggy submission (verdict: Runtime Error):
import sys
N=int(sys.stdin.readline()) 
values = []
res = 1
while N :
	values=(sys.stdin.readline().split())
	for v in values:
      res *= v
    if res > 10e18:
      print(-1)
    else
      print(res)
Problem p02705 (python)

Fixed submission:
R = int(input())

import math

print(2*R*math.pi)

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

import math

print(2*R*math.py)
Problem p02708 (python)

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

a = 0

for i in range(K,N+2):
  a += i*(2*N-i+1)//2 - i*(i-1)//2 + 1
  
a = a % (10**9+7)
print(int(a))

Buggy submission (verdict: Runtime Error):
S = input()
l = len(S)

a = 0
count = 0

for i in range(l):
    a = int(S[l-i-1])
    for j in range(i+1,l):
        if int(S[l-j-1]) != 0:
            a += int(S[l-j-1])*10**(j-i)
            if j-i > 2:
                if a % 2019 == 0:
                    count += 1
            
print(count)
Problem p02713 (python)

Fixed submission:
K = int(input())
 
import math

ans = 0
a = 0

for i in range(1,K+1):
  for j in range(1,K+1):
    a = math.gcd(i,j)
    for k in range(1,K+1):
      ans += math.gcd(a,k)
      
print(ans)

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

if K == 1:
  print(1)
  
def f(K):
  s =  0
  count = 0
  for i in range(2,K+1):
    if K % i != 1:
      s += i
      count += 1
  return 3*K + s - count  
  
else:
  ans = 0
  for i in range(2,K+1):
    ans += f(K)
  print(ans)
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
    s[i], c[i] = map(int, input().split())
    
A = []
x = 0

for i in range(M):
  if s[i] == 1 and c[i] == 0:
    x = 1
  for j in range(i+1,M):
    if s[i] == s[j] and c[i] != c[j]:
      x = 2
      
import numpy as np
import math
from functools import reduce
B = np.zeros(N)
B[0] = 1

if M == 0:
  if N == 1:
    print(0)
  else:
    ans = reduce( lambda a,b:10*a+b, B)
    print(math.floor(ans))

elif N == 1 and max(s) == 1 and max(c) == 0:
  print(0)

elif x == 1 or x == 2:
  print("-1")
  
else:
  for i in range(M):
    B[s[i]-1] = c[i]
  ans = reduce( lambda a,b:10*a+b, B)
  print(math.floor(ans))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
    s[i], c[i] = map(int, input().split())
    
A = []
x = 0

for i in range(M):
  if s[i] == 1 and c[i] == 0:
    x = 1
  for j in range(i+1,M):
    if s[i] == s[j] and c[i] != c[j]:
      x = 2
      
import numpy as np
import math
from functools import reduce
B = np.zeros(N)
B[0] = 1

if max(s) == 1 and max(c) == 0:
  print(0)

elif x == 1 or x == 2:
  print("-1")
  
else:
  for i in range(M):
    B[s[i]-1] = c[i]
  ans = reduce( lambda a,b:10*a+b, B)
  print(math.floor(ans))
Problem p02911 (python)

Fixed submission:
N, K, Q = (int(i) for i in input().split())
A = [int(input()) for i in range(Q)]

import numpy as np
S = np.ones(N)*(K - Q)

for i in range(Q):
  x = A[i]
  S[x-1] += 1

for i in range(N):
  if S[i] <= 0:
    print('No')
  else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N, K, Q = (int(i) for i in input().split())
A = [int(input()) for i in range(Q)]

import numpy as np
T = K - Q
S = np.ones(N)*T

for i in range(Q):
  S[A[i]] += 1

for i in range(N):
  if S[i] <= 0:
    print('No')
  else:
    print('Yes')
Problem p02621 (python)

Fixed submission:
a = int(input())
ans = a + a**2 + a**3
print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
ans = a + a**2 + a***3
print(ans)
Problem p02628 (python)

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

N = a[0]
K = a[1]

p.sort()

g = 0
for k in range(K):
	g = g + p[k]
print(g)

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

N = a[0]
K = a[1]

p.sort()

g = 0
for k in range(K)
	g = g+p[k]
print(g)

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

N = a[0]
K = a[1]

p = p.sort

g = sum(p[0:K-1])
print(g)

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

N = a[0]
K = a[1]

p = p.sort

g = 0
for i in range(K):
    g = K+p(i)

print(g)
Problem p02640 (python)

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

X = a[0]
Y = a[1]
 
if (Y-2*X) % 2 == 0 and (Y-2*X) >= 0 and (4*X-Y) % 2 == 0 and (4*X-Y) >= 0:
	print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
X = a[1]
Y = a[2]

if (Y-2*X) % 2 == 0 and (Y-2*X) >= 0:
	print('Yes')
else:
    print('No')
Problem p02642 (python)

Fixed submission:
n = int(input())
*A, = map(int, input().split())
maxA = max(A)
# C[a] = A内のaの個数
C = {a: 0 for a in A}
for a in A:
    C[a] += 1
# D[a]=1: Aにaより小さいaの約数が存在する
D = {a: 0 for a in A}
for a in A:
    if C[a] > 0:
        t = 2
        while a * t <= maxA:
            D[a * t] = 1
            t += 1
ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1
print(ans)

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

C = {a:0 for a in A}

for a in A:
    C[a] = C[a]+1

maxA = max(A)

D = {a:0 for a in A}

for a in A:
    t = 2
    while a*t <= maxA:
        D[a*t] += 1
        t = t+1

counter = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        counter = counter+1
        
print(counter)

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

C = {a:0 for a in A}

for a in A:
    C[a] = C[a]+1

maxA = max(A)

D = {a:0 for a in A}

for a in A:
    t = 2
    while a*t <= maxA:
        D[a*t] = D[a*t]+1
        t = t+1

counter = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        counter = counter+1
        
print(counter)

Buggy submission (verdict: Runtime Error):
n = int(input())
*A, = map(int, input().split())
# n = 10
# A = [33, 18, 33, 28, 8, 19, 89, 86, 2, 4]

C = {a:0 for a in A}

for a in A:
    C[a] = C[a]+1

maxA = max(A)

D = {a:0 for a in A}

for a in A:
    t = 2
    while a*t <= maxA:
        D[a*t] += D[a*t]+1
        t = t+1

counter = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        counter = counter+1
        
print(counter)
Problem p02683 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 06:00:56 2020

@author: Aruto Hosaka
"""


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

# C =[[100, 3, 7, 5, 3, 1], [164, 4, 5, 2, 7, 8], [334, 7, 2, 7, 2, 9], [234, 4, 7, 2, 8, 2], [541, 5, 4, 3, 3, 6], [235, 4, 8, 6, 9, 7], [394, 3, 6, 1, 6, 2], [872, 8, 4, 3, 7, 2]]
# N = 8
# M = 5
# X = 10


P = [row[0] for row in C]
A = [row[1:M+1] for row in C]

K = [0 for i in range(2**N)]
G = [[0 for k in range(M)] for i in range(2**N)]
for i in range(2**N):
    i2 = format(i, '012b')
    s = 0
    for k in range(N):
        K[i] += int(i2[11-k])*P[k]
        for j in range(M):
            G[i][j] += int(i2[11-k])*A[k][j]

J = [[K[i],G[i]] for i in range(2**N)]
J = sorted(J)

t = 0
for i in range(2**N):
    for j in range(M):
        if (J[i][1])[j] < X:
            break
        if j == M-1:
            t = 1
            print(J[i][0])
    if t== 1:
        break

if t==0:
    print(-1)

Buggy submission (verdict: Runtime Error):
N,M,X = map(int, input().split())
C = [list(map(int, input().split())) for i in range(N)]

# C = [[60, 2, 2, 4], [70, 8, 7, 9], [50, 2, 3, 9]]

P = [row[0] for row in C]
A = [row[1:M+1] for row in C]

K = [0 for i in range(2**N)]
G = [[0,0,0] for i in range(2**N)]
for i in range(2**N):
    i2 = format(i, '012b')
    s = 0
    for k in range(N):
        K[i] += int(i2[11-k])*P[k]
        for j in range(M):
            G[i][j] += int(i2[11-k])*A[k][j]

J = [[K[i],G[i]] for i in range(2**N)]

t = 0
for i in range(2**N):
    for j in range(M):
        if (J[i][1])[j] < X:
            break
        if j == M-1:
            t = 1
            print(J[i][0])
    if t== 1:
        break

if t==0:
    print(-1)
Problem p02694 (python)

Fixed submission:
X = int(input())
M = 100
y = 0
while X > M:
  M += M//100
  y += 1
print(y)

Buggy submission (verdict: Runtime Error):
X = int(input())
M = 100
y = 0
while X > M:
  M = int(M*1.01)
  y += 1X = int(input())
M = 100
y = 0
while X > M:
  M = int(M*1.01)
  y += 1
print(y)
Problem p02706 (python)

Fixed submission:
N,M = map(int,input().split())
A = list(map(int,input().split()))
sumA = sum(A)
if N-sumA < 0:
  print(-1)
else:
  print(N-sumA)

Buggy submission (verdict: Runtime Error):
N,M = map(int(input().split()))
A = list(map(int(input().split())))
sumA = sum(A)
if N-sumA < 0:
  print(-1)
else:
  print(N-sumA)
Problem p02730 (python)

Fixed submission:
letter = str(input())
N = len(letter)

l_1 = letter[:int((N-1)/2)]
l_2 = letter[int((N+3)/2-1):]

if(letter == letter[::-1] and l_1 == l_1[::-1] and l_2 == l_2[::-1]):
    ans = "Yes"
else:
    ans = "No"
# print(l_1)
# print(l_2)

print(ans)

Buggy submission (verdict: Runtime Error):
letter = str(input())
N = len(letter)

l_1 = letter[:int((N-1)/2)]
l_2 = letter[int((N+3)/2-1):]

if(l == l[::-1] and l_1 == l_1[::-1] and l_2 == l_2[::-1]):
    ans = "Yes"
else:
    ans = "No"
# print(l_1)
# print(l_2)

print(ans)
Problem p02765 (python)

Fixed submission:
N, R = map(int, input().split()) 
ans = 0
if(N >= 10):
  ans = R
else:
  ans = 100*(10-N) + R
print(ans)

Buggy submission (verdict: Runtime Error):
N, R = map(int, input().split()) 
if(N >= 10):
  return R
else:
  return 100*(10-N) + R