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

Fixed submission:
INF = 10000000000
a=[0 for i in range(int(1e5))]
b=[0 for i in range(int(1e5))]
ans = [INF for i in range(int(1e5))]

def main():
    h,n = map(int,input().split())
    for i in range(n):
        tmp = list(map(int,input().split()))
        a[i] = tmp[0]
        b[i] = tmp[1]
        index = min(h,a[i])
        if b[i] < ans[index]:
            ans[index] = b[i]
    
    
    for i in range(h):
        if ans[i]!=INF:
            for j in range(n):
                index = min(h,a[j]+i)
                if ans[i]+b[j] < ans[index]:
                    ans[index] = ans[i]+b[j]
    print(ans[h])
if __name__=="__main__":
    main()

Buggy submission (verdict: Runtime Error):
inf = 10000000000

def main():
    h,n = map(int,input().split())
    a=[0 for i in range(n)]
    b=[0 for i in range(n)]
    ans = [inf for i in range(h+1)]
    for i in range(n):
        tmp = list(map(int,input().split()))
        a[i] = tmp[0]
        b[i] = tmp[1]
        ans[a[i]] = b[i]
    
    
    for i in range(len(ans)):
        if ans[i]!=inf:
            for j in range(len(a)):
                index = min(h,a[j]+i)
                if ans[i]+b[j] < ans[index]:
                    ans[index] = ans[i]+b[j]
    print(ans[h])
if __name__=="__main__":
    main()

Buggy submission (verdict: Runtime Error):
inf = 10000000000

def main():
    h,n = map(int,input().split())
    a=[0 for i in range(n)]
    b=[0 for i in range(n)]
    ans = [inf for i in range(h+1)]
    for i in range(n):
        tmp = list(map(int,input().split()))
        a[i] = tmp[0]
        b[i] = tmp[1]
        ans[a[i]] = b[i]
    
    
    for i in range(len(ans)):
        if ans[i]!=inf:
            for j in range(len(a)):
                if ans[i]+b[j] < ans[min(h,a[j]+i)]:
                    ans[min(h,a[j]+i)] = ans[i]+b[j]
    print(ans[h])
if __name__=="__main__":
    main()
Problem p02802 (python)

Fixed submission:
def main():
    n,m = map(int,input().split())
    flag = [False for i in range(n+5)]
    AC = 0
    WA = [0 for i in range(n+5)]
    _WA = 0
    for i in range(m):
        input_line = input().split()
        p,s = int(input_line[0]), input_line[1]
        if flag[p] == False:
            if s == "AC":
                AC += 1
                _WA += WA[p]
                flag[p] = True
            else:
                WA[p] += 1
    print(AC,_WA)
    return


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n,m = map(int,input().split())
    flag = [False for i in range(n+1)]
    AC = 0
    WA = 0
    for i in range(m):
        input_line = input().split()
        p,s = int(input_line[0]), input_line[1]
        if flag[p] == False:
            if s == "AC":
                AC += 1
                flag[p] = def main():
    n,m = map(int,input().split())
    flag = [False for i in range(n+5)]
    AC = 0
    WA = [0 for i in range(n+5)]
    _WA = 0
    for i in range(m):
        input_line = input().split()
        p,s = int(input_line[0]), input_line[1]
        if flag[p] == False:
            if s == "AC":
                AC += 1
                _WA += WA[p]
                flag[p] = True
            else:
                WA[p] += 1
    print(AC,_WA)
    return


if __name__ == "__main__":
    main()
            else:
                WA += 1
    print(AC,WA)
    return 0


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

Fixed submission:
import itertools

def main():
    input_line = map(int,input().split(' '))
    n,m = input_line
    a = list(map(lambda x:int(x)//2,input().split(' ')))

    pre_j = 0
    for i in range(len(a)):
        j=0
        while(a[i]%(2**j)==0):
            j+=1
        if i==0:
            pre_j=j
        if pre_j != j:
            print(0)
            return 0

    glc = 1
    for i in range(len(a)):
        glc = a[i]*glc//GCD(a[i],glc)
    print(((m//glc)+1)//2)
    return 


def GCD(a,b):
    if a < b:
        a,b = b,a
        
    while a % b !=0 :
        n = a % b
        a = b
        b = n
    return b

if __name__ == "__main__":
    main()

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

def main():
    input_line = map(int,input().split(' '))
    n,m = input_line
    a = list(map(lambda x:int(x)//2,input().split(' ')))
    print(a)
    glc = 1
    for i in range(len(a)):
        glc = a[i]*glc//math.gcd(a[i],glc)
    print(glc)
    print(((m//glc)+1)//2)
    return 


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

Fixed submission:
import math
X, K, D = map(int,input().split())
X = math.fabs(X)
ans = 0
E = X//D
if E > K:
    ans = X - K * D
elif K%2 == E%2:
    ans = X-E*D
else:
    ans = -X+(E+1)*D
print(int(ans))

Buggy submission (verdict: Runtime Error):
X, K, D = map(int,input().split())
import math
f = math.fabs 
def solve(x,k,d):
    if k%2 ==0:
        if k == 0:
            return int(f(x))
        elif f(x-2*d) > f(x) and f(x+2*d) > f(x):
            return int(f(x))
        elif k%4 == 0:
            return int(min(solve(x-k//2*d,k//2,d),solve(x+k//2*d,k//2,d)))
        elif k%4 != 0:
            return int(min(solve(x-(k+2)//2*d,(k-2)//2,d),solve(x+(k+2)//2*d,(k-2)//2,d)))
    elif k%2 != 0:
        if k == 1:
            return int(min(f(x-d),f(x+d)))
        else:
            return int(min(solve(x-(k+1)//2*d,(k-1)//2,d),solve((x+(k+1)//2*d,(k-1)//2,d))))
print(solve(X,K,D))

Buggy submission (verdict: Runtime Error):
X, K, D = map(int,input().split())
import math
f = math.fabs 
def solve(x,k,d):
    if k%2 ==0:
        if k == 0:
            return f(x)
        elif f(x-2*d) > f(x) and f(x+2*d) > f(x):
            return f(x)
        elif k%4 == 0:
            return min(solve(x-k//2*d,k//2,d),solve(x+k//2*d,k//2,d))
        elif k%4 != 0:
            return min(solve(x-(k+2)//2*d,(k-2)//2,d),solve(x+(k+2)//2*d,(k-2)//2,d))
    elif k%2 != 0:
        if k == 1:
            return min(f(x-d),f(x+d))
        else:
            return min(solve(x-(k+1)//2*d,(k-1)//2,d),solve((x+(k+1)//2*d,(k-1)//2,d)))
print(solve(X,K,D))
Problem p02612 (python)

Fixed submission:
N = int(input())
if N%1000 == 0:
    print(0)
else:
    print(1000-N%1000)

Buggy submission (verdict: Runtime Error):
N = int(input())
print((10000-n)%1000)
Problem p02621 (python)

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

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

Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
cnt = [0]*100005
s = sum(A)
for i in A:
    cnt[i] += 1
for i in range(Q):
    B, C = map(int,input().split())
    s += (C-B)*cnt[B]
    print(s)
    cnt[C] += cnt[B]
    cnt[B] = 0

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline()
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
B = [0]*Q
C = [0]*Q
num = [0]*100000
s = sum(A)
for i in range(Q):
    B[i], C[i] = map(int,input().split())
for i in range(100000):
    num[i] = A.count(i+1)
for i in range(Q):
    s += (C[i]-B[i])*num[B[i]-1]
    print(s)
    num[C[i]-1] += num[B[i]-1]
    num[B[i]-1] = 0
Problem p02658 (python)

Fixed submission:
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
ans = 1 
if 0 in a:
    print(0)
    sys.exit(0)
for i in a:
    ans *= i
    if ans > 10**18:
        print(-1)
        sys.exit(0)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline()
n = int(input())
a = list(map(int, input().split()))
ans = 1 
if 0 in a:
    print(0)
    sys.exit()
for i in a:
    ans *= i
    if ans > 10**18:
        ans = -1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1 
if 0 in a:
    print(0)
    return 0
for i in a:
    ans *= i
    if ans > 10**18:
        ans = -1
print(ans)
Problem p02811 (python)

Fixed submission:
k, x = map(int,input().split())
if 500*k >= x:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
k, x = int(input().split())
if 500*k >= x:
    print('Yes')
else:
    print('No')
Problem p02885 (python)

Fixed submission:
A, B = map(int,input().split())
if A <= B*2:
    print(0)
else:
    print(A-2*B)

Buggy submission (verdict: Runtime Error):
A. B = map(int,input().split())
if A <= B*2:
    print(0)
else:
    print(A-2*B)
Problem p03469 (python)

Fixed submission:
s = input()
print('2018' + s[4:])

Buggy submission (verdict: Runtime Error):
s = input()
print(s.replace(7,8))
Problem p03578 (python)

Fixed submission:
from collections import Counter
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
sd = set(D)
st = set(T)
cntd = Counter(D)
cntt = Counter(T)
ok = True
for t in T:
    if t not in sd:
        ok = False
    elif cntt[t] > cntd[t]:
        ok = False
if ok:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
    print('NO')
    exit()
numd = [0]*(10**9+5)
numt = [0]*(10**9+5)
for d in D:
    numd[d] += 1
for t in T:
    numt[t] += 1
for t in T:
    if numt[t] > numd[t]:
        print('NO')
        exit()
print('YES')

Buggy submission (verdict: Runtime Error):
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
    print('NO')
    exit()
numd = [0]*(10**9+5)
numt = [0]*(10**9+5)
for d in D:
    numd[d] += 1
for t in T:
    numt[t] += 1
for t in T:
    if numt[t] > numd[t]:
        print('NO')
        exit()
print('YES')

Buggy submission (verdict: Runtime Error):
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
    print('NO')
    exit()
numd = [0]*200005
numt = [0]*200005
for d in D:
    numd[d] += 1
for t in T:
    numt[t] += 1
for t in T:
    if numt[t] > numd[t]:
        print('NO')
        exit()
print('YES')

Buggy submission (verdict: Runtime Error):
= list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
if m > n:
    print('NO')
    exit()
numd = [0]*200005
numt = [0]*200005
for d in D:
    numd[d] += 1
for t in T:
    numt[t] += 1
for t in T:
    if numt[t] > numd[t]:
        print('NO')
        exit()
print('YES')
Problem p02705 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
print(2*a*pi)
Problem p02621 (python)

Fixed submission:

a = int(input())

print(a+pow(a,2)+pow(a,3))

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

print(a+pow(a,2)+pow(a,3))
Problem p02576 (python)

Fixed submission:
N,X,T=map(int,input().split())
if N%X==0:
  print((N//X)*T)
else:
  print((N//X+1)*T)

Buggy submission (verdict: Runtime Error):
N,X,T=map(int,input().split())
if N%X=0:
  print((N/X)*T)
else:
  print((N//X+1)*T)
Problem p02582 (python)

Fixed submission:
ss=str(input())
a=int(ss.count("R"))

if ss=="RSR":
  a=1

print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
 
l.sort()
ans = 0
 
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if l[i] != l[j] != l[k]:
                if l[i] + l[j] > l[k] :
                    ans += 1
 
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i]!=l[j]!=l[k]:
        if l[j]+l[i]>l[k]:
         ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i]!=l[j]!=l[k]:
        if l[j]+l[i]>l[k]:
        ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i]!=l[j]!=l[k]:
        if l[j]+l[i]>l[k]:
        ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(k+1,n):
      if l[i]!=l[j]!=l[k]:
        if l[i]+l[j]>l[k]:
        ans+=1

print(ans)
Problem p02583 (python)

Fixed submission:
n=int(input())
L=list(map(int,input().split()))
L.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if L[i]!=L[j]!=L[k]:
        if L[j]+L[i]>L[k]:
         ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(k+1,n):
      if l[i]!=l[j]!=l[k]:
        if l[i]+l[j]>l[k];
        ans+=1

print(ans)
Problem p02657 (python)

Fixed submission:
a,b=map(int,input().split())
print(a*b)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
 
# Aに0が含まれていたら、積も0とする
# Aに0が含まれていなければ、順に積を取り、10^18を超えたら終了する
ans = 0
if 0 not in A:
  ans = 1
  for a in A:
    ans *= a
    if ans > 10**18:
      ans = '-1'
      break
 
print(ans)

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

ans=0
if 0 not in A:
  ans=1
  for a in A:
    ans*=a
    if ans>10**18:
      ans='-1'
      break

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
    exit(0)
    
ans = 1 
for i in A:
    ans *= i
    if ans > 10**18:
        print(-1)
        exit(0)
        
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split())
if 0 in A:
  print(0)
  exit(0)

ans=1
for i in A:
  ans*=i
  if ans>10**18:
    print(-1)
    exit(0)

print(ans)
Problem p02658 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
x=1
A.sort()
if 0 in A:
  print(0)
  exit()

for i in range(n):
  x*=A[n-i-1]
  if x>10**18:
    print(-1)
    exit()
  else:
    continue

print(x)

Buggy submission (verdict: Runtime Error):
=int(input())
A=list(map(int,input().split()))
x=1
flag=0
A.sort()
if 0 in A:
  print(0)
  exit()

for i in range(n):
  x*=A[n-i-1]
  if x>10**18:
    print(-1)
    flag=1
    exit()
  else:
    continue

if flag==0:
  print(x)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split())
ans=1
for i in A:
  ans*=i
  if ans>10**18:
   print(-1)
   exit()

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split())
ans=1
for i in A:
  ans*=i
  if ans>10**18:
  print(-1)
  exit()

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split())
a=1
for i in range(n):
  a*=A[i]
  if a>10**18
  print(-1)
  exit()

print(a)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=1
for i in range(n):
  x=int(input())
  ans*=x

if ans<=10**18:
  print(ans)
else:
  print(-1)
Problem p02687 (python)

Fixed submission:
S=input()
if S=="ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
num = []

for i in range(k):
  d = int(input())
  num += list(map(int, input().split()))

Q = list(set(num))
print(n-len(Q))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
num=[]

for i in range(k):
  d=int(input())
  num+=list(map(int,input().split()))

Q=list( set (num))
print(n-len(Q))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
num=[]

for i in range(k):
  d=int(input())
  num+=list(map(int,input().split()))

Q=list(set(num))
print(n-len(Q))
Problem p02765 (python)

Fixed submission:
n,r=map(int,input().split())
if n>=10:
  print(r)
else:
  print(r+100*(10-n))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=0
while n>k:
  n//=k
  ans+=1

print(ans+1)
Problem p02817 (python)

Fixed submission:
s,t=map(str,input().split())
a=t+s
print(a)

Buggy submission (verdict: Runtime Error):
s,t=str(input())
a=t+s
print(a)
Problem p02848 (python)

Fixed submission:
A=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
n=int(input())
s=str(input())
t=""
for i in range(len(s)):
  for j in range(26):
    if s[i]==A[j]:
      if j+n<=25:
        t+=A[j+n]
        break
      else:
        t+=A[j+n-26]
        break

print(t)

Buggy submission (verdict: Runtime Error):
A=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
n=int(input())
s=str(input())
x=n%26
for i in range(len(A)):
  for j in range(25):
    if s[i]==A[j]:
      if j+x<=25:
        s[i]=A[j+x]
        break
      else:
        s[i]=A[j+x-26]
        break

print(s)
Problem p02899 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  x=a[i]
  b[x-1]=i+1

print(*b)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  x=a[i]
  b[x-1]=i+1
c=" ".join(b)
print(c)
Problem p02994 (python)

Fixed submission:
n,l=map(int,input().split())
c=0
m=100000
for i in range(1,n+1):
  c+=l+i-1
  m=min(m,abs(l+i-1))
if l<0 and l-n<=0:
  print(c+m)
else:
  print(c-m)

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
c=0
m=100000
for i in range(1,n+1):
  c+=l+i-1
  m=min(m,abs(l+i-1))
if l<0 and a-n<=0:
  print(c+d)
else:
  print(c-d)
Problem p03106 (python)

Fixed submission:
a,b,k=map(int,input().split())
p=[]
for i in range(1,a+1):
  if a%i==0 and b%i==0:
    p.append(i)

n=len(p)
print(p[n-k])

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
p=[]
for i in range(a):
  if a%i==0 and b%i==0:
    p.append(i)

n=len(p)
print(p[n-k])
Problem p03109 (python)

Fixed submission:
s=input()
if s<="2019/04/30":
  print("Heisei")
else:
  print("TBD")

Buggy submission (verdict: Runtime Error):
n=int(input())
sum=0
for j in range(n):
  i,c=input().split()
  if c=="BTC":
    sum+=float(i)*380000
  else:
    sum+=int(i)
print(sum)
Problem p03110 (python)

Fixed submission:
n=int(input())
sum=0
for j in range(n):
  i,c=input().split()
  if c=="BTC":
    sum+=float(i)*380000
  else:
    sum+=int(i)
print(sum)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=0
for i in range(n):
  x,u=map(str,input().split())
  x=int(x)
  if u=="BTC":
    x*=380000
  ans+=x
print(ans)
Problem p03126 (python)

Fixed submission:
N,M = map(int,input().split())
foods = [0]*M
 
for i in range(N):
  KA = list(map(int,input().split()))
  
  for a in KA[1:]:
    foods[a-1] += 1
  
cnt = 0
for j in foods:
  if j == N:
    cnt += 1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
foods=[0]*M

for i in range(N):
  KA=list(map(int,input().split())
  for a in KA[1: ]:
    foods[a-1]+=1

cnt=0
for j in foods:
  if j==N:
    cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
foods=[0]*M

for i in range(N):
  KA=list(map(int,input().split())
  for a in KA[1:]:
    foods[a-1]+=1

cnt=0
for j in foods:
  if j==N:
    cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
foods=[0]*M

for i in range(N):
  KA=list(map(int,input().split())


  for a in KA[1:]:
    foods[a-1]+=1

cnt=0
for j in foods:
  if j==N:
    cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
foods=[0]*M

for i in range(N):
  KA=list(map(int,input().split())


for a in KA[1:]:
  foods[a-1]+=1

cnt=0
for j in foods:
  if j==N:
    cnt+=1

print(cnt)
Problem p03244 (python)

Fixed submission:
n = int(input())
alist  = list(map(int,input().split()))
list1 = alist[1::2]
list2 = alist[0::2]
from collections import Counter
dic1 = Counter(list1).most_common()
dic2 = Counter(list2).most_common()
dic1.append([0,0])
dic2.append([0,0])
if dic1[0][0]!=dic2[0][0]:
  print(n - dic1[0][1] - dic2[0][1])
else:
  print(min(n - dic1[0][1] - dic2[1][1], n -dic1[1][1] - dic2[0][1]))

Buggy submission (verdict: Runtime Error):
n = int(input())
alist  = list(map(int,input().split()))
list1 = alist[1::2]
list2 = alist[0::2]
from collections import Counter
dic1 = Counter(list1).most_common()
dic2 = Counter(list2).most_common()

if dic1[0][0]!=dic2[0][0]:
  print(n - dic1[0][1] - dic2[0][1]+1)
else:
  print(min(n - dic1[0][1] - dic2[1][1]+1, n -dic1[1][1] - dic2[0][1]+1))
Problem p03289 (python)

Fixed submission:
s = list(input())
flg = 'WA'
if s[0] == 'A':
    if 'C'in s[2:len(s)-1]:
        s.remove('A')
        s.remove('C')
        s = ''.join(s)
        if s.islower() == True:
            flg = 'AC'
print(flg)

Buggy submission (verdict: Runtime Error):
s=list(input())
fld="WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s=' '.join(s)
    if s.islower()==True:
      flg="AC"

print(flg)

Buggy submission (verdict: Runtime Error):
s=list(input())
fld="WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s=''.join(s)
    if s.islower()==True:
      flg="AC"

print(flg)
Problem p03316 (python)

Fixed submission:
n=str(input())
s=0
for i in range(len(n)):
  s+=int(n[i])

n=int(n)
if n%s==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
s=0
if 1<=n<10:
  print("Yes")
  exit()
else:
  while n>10:
    s+=n%10
    n//=10
  if n%s==0:
    print("Yes")
    exit()

print("No")
Problem p03474 (python)

Fixed submission:
a,b=map(int,input().split())
s=str(input())
e=["0",'1','2','3','4','5','6','7','8','9']
for i in range(len(s)):
  if a==i:
    if s[i]!='-':
      print("No")
      exit()
  else:
    if s[i] not in e:
      print("No")
      exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=str(input())
e=["0",'1','2','3','4','5','6','7','8','9']
for i in range(len(s)):
  if a=i:
    if s[i]!='-':
      print("No")
      exit()
  else:
    if s[i] not in e:
      print("No")
      exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=str(input())
e=[0,1,2,3,4,5,6,7,8,9]
for i in range(len(s)):
  if a=i:
    if s[i]!='-':
      print("No")
      exit()
  else:
    if s[i] not in e:
      print("No")
      exit()

print("Yes")
Problem p03544 (python)

Fixed submission:
n=int(input())
l=[0 for i in range(n+1)]
l[0]=2
l[1]=1
for j in range(2,n+1):
  l[j]=l[j-1]+l[j-2]
print(l[n])

Buggy submission (verdict: Runtime Error):
n=int(input())
L=[]
L.append(2)
L.append(1)
for i in range(3,n+1):
  x=L[i-1]+L[i-2]
  L.append(x)

print(L[n])
Problem p03548 (python)

Fixed submission:
x,y,z=map(int,input().split())
n=0
while True:
  if n*y+(n+1)*z>x:
    print(n-1)
    exit()
  n+=1

Buggy submission (verdict: Runtime Error):
x,y,z=int(input().split())
while True:
  n=0
  if n*y+(n+1)*z>x:
    print(n-1)
    exit()
  n+=1
Problem p03563 (python)

Fixed submission:
r=int(input())
g=int(input())
print(2*g-r)

Buggy submission (verdict: Runtime Error):
r=int(input())
g=int(input())
print(2g-r)