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

Fixed submission:

S = int(input())
K = int(input())

s = str(S)
l = len(s)

for i in range(K):
 if i>=len(s):
  print(s[-1])
  exit()
 if s[i] != '1':
  print(s[i])
  exit()

print(1)

Buggy submission (verdict: Runtime Error):

S = int(input())
K = int(input())

if S <= 9:
 print(S)
else:
 s = str(S)
 index = 0
 while True:
  if s[index] != '1':
   print(s[index])
   break
  elif index == K:
   print(s[index])
   break
  else:
   index += 1
Problem p03339 (python)

Fixed submission:

N = int(input())
S = input()

W = [0]
E = [0]

for i in range(N): 
  s = S[i]
  if s == "W":
    W.append(W[-1] + 1)
    E.append(E[-1])
  else:
    W.append(W[-1])
    E.append(E[-1] + 1)


ans = float("inf")
for i in range(N):
  ans = min(ans, W[i] + (E[-1] - E[i+1]))
print(ans)

Buggy submission (verdict: Runtime Error):
8
WWWWWEEE

Buggy submission (verdict: Runtime Error):
v
Problem p03471 (python)

Fixed submission:

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

for x in range(N + 1):
  for y in range(N - x + 1):
    z = N - x - y
    
    if x * 10000 + y * 5000 + z * 1000 == Y:
      print(x, y, z)
      exit()

print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):

for x in range(N):
  for y in range(N):
    z = N - x - y
    
    if z < 0:
      continue

    if x * 10000 + y * 5000 + z * 1000 == Y:
      print(x, y, z)
      exit()

print(-1, -1, -1)
Problem p03473 (python)

Fixed submission:
print(48 - int(input()))

Buggy submission (verdict: Runtime Error):

N = int(input())
M = [list(map(int, input().split())) for _ in range(N-1)]

for i in range(N-1):
    tm = 0 #時刻を表す
    for j in range(i, N-1):
        if tm < M[j][1]: #開通していない
            tm = M[j][1]
        elif tm % M[j][2] != 0: #発車していない
            tm += M[j][2] - (tm % M[j][2])
 
        tm += M[j][0]
 
    print(tm)
print(0)
Problem p03545 (python)

Fixed submission:
Z = []
for s in input():
  Z.append(int(s))

def dfs(index, value, ops):
  if index == 4:
    if value == 7:
      print("{}{}{}{}{}{}{}=7".format(Z[0],ops[0],Z[1],ops[1],Z[2],ops[2],Z[3]))
      # print(f"{Z[0]}{ops[0]}{Z[1]}{ops[1]}{Z[2]}{ops[2]}{Z[3]}=7")
      exit()
    return
  dfs(index + 1, value + Z[index], ops + ["+"])
  dfs(index + 1, value - Z[index], ops + ["-"])

dfs(1, Z[0], [])

Buggy submission (verdict: Runtime Error):
Z = []
for s in input():
  Z.append(int(s))

def dfs(index, value, ops):
  if index == 4:
    if value == 7:
      print(f"{Z[0]}{ops[0]}{Z[1]}{ops[1]}{Z[2]}{ops[2]}{Z[3]}=7")
      exit()
    return
  dfs(index + 1, value + Z[index], ops + ["+"])
  dfs(index + 1, value - Z[index], ops + ["-"])

dfs(1, Z[0], [])
Problem p02812 (python)

Fixed submission:
n = int(input())
s = input()
i = 0
count = 0

while i < len(s):
    if not (s[i] == 'A'):
        i+=1
        continue

    i+=1
    if not i < len(s):
        break
    if not (s[i] == 'B'):
        continue

    i+=1
    if not i < len(s):
        break
    if not (s[i] == 'C'):
        continue

    i+=1
    count+=1

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
i = 0
count = 0

while i < len(s):
    if not (s[i] == 'A'):
        i+=1
        continue
    i+=1
    if not (s[i] == 'B'):
        i+=1
        continue
    i+=1
    if not (s[i] == 'C'):
        i+=1
        continue
    i+=1
    count+=1

print(count)
Problem p03284 (python)

Fixed submission:
string = input()
array = string.split(' ')
N = int(array[0])
K = int(array[1])
if N % K == 0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
for i in range(int(N/4)):
    amount = (i + 1) * 4
    for j in range(int(N/7)):
        amount += 7
        if(amount == N):
            print('Yes')
            sys.exit()
print('No')

Buggy submission (verdict: Runtime Error):
string = input()
N, K = string.split(' ')
if N % K == 0:
    print(0)
else:
    print(1)
Problem p03289 (python)

Fixed submission:
import sys

S = list(input())
if S[0] != 'A':
    print('WA')
    sys.exit()

S_aida = S[2:-1]
if S_aida.count("C") != 1:
    print('WA')
    sys.exit()

S.pop(0)
S.pop(S.index('C'))

for string in S:
    if not string.islower():
        print('WA')
        sys.exit()

print('AC')

Buggy submission (verdict: Runtime Error):
S = list(input())
if S[0] != 'A':
    print('WA')
    exit

S_aida = S[2:-1]
if S_aida.count("C") != 1:
    print('WA')
    exit

S.pop(0)
S.pop(S.index('C'))

for string in S:
    if not string.islower():
        print('WA')
        exit

print('AC')
Problem p02772 (python)

Fixed submission:

x = int(input())

n = []
# for i in range(x):
#     n[i] = int(input())
n = [int(e) for e in input().split()]

def cal(n):
    count = 0
    for i in range(len(n)):
        if n[i] % 2 == 0:
           if n[i] % 3 == 0 or n[i] % 5 == 0:
                count += 1
        else:
            count += 1
    if count == len(n):
        print("APPROVED")
    else:
        print("DENIED")

cal(n)

Buggy submission (verdict: Runtime Error):
x = input()
n = []
for i in range(x):
    n[i] = input()

def cal(n):
    count = 0
    for i in range(len(n)):
        if n[i] % 2 == 0 and n[i] % 3 == 0 and n[i] % 5 == 0:
            count += 1
    if count == len(n):
        print("APPROVED")
    else:
        print("DENIED")

cal(n)

Buggy submission (verdict: Runtime Error):
x = input()
n = []
for i in range(x):
    n[i] = input()

def cal(n):
    count = 0
    for i in range(len(n)):
        if (n[i] % 2 == 0) and ((n[i] % 3 == 0) and (n[i] % 5 == 0)):
            count += 1
    if count == len(n):
        print("APPROVED")
    else:
        print("DENIED")

cal(n)
Problem p02830 (python)

Fixed submission:
N = int(input())
S,T = input().split()

S = list(S)
T = list(T)
A = []
for i in range(N):
    A.append(S[i])
    A.append(T[i])
print(''.join(A))

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

S = list(S)
T = list(T)
A = [] 
for i in range(N):
    A.append(S[i])
    A.append(T[i])
print(''.join(A))
Problem p03494 (python)

Fixed submission:
input()
A=list(map(int,input().split()))
ans=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input(), split()))
ans = 0
while all(a % 2 == 0 for a in A):
    A = [a / 2 for a in A]
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input(), split()))
ans = 0
while all(a % 2 == 0 for a in A):
    A = [a / 2 for ain A]
    ans += 1
print(ans)
Problem p03860 (python)

Fixed submission:
print("A"+input()[8]+"C")

Buggy submission (verdict: Runtime Error):
print(input()[0]+input()[0]+input()[0])
Problem p04044 (python)

Fixed submission:
N, L = map(int, input().split())
S = sorted([input() for i in range(N)])

print(''.join(S))

Buggy submission (verdict: Runtime Error):
N, L = input().split()
string_list = [input() for i in range(int(N))]
string_list.soted()
ans = ''
for i in string_list:
    ans += i

print(ans)

Buggy submission (verdict: Runtime Error):
N, L = input().split()
string_list = [input() for i in range(int(L))]
string_list.soted()
ans=''
for i in string_list:
    ans += i
    
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
words = [input() for i in range(N)]
words=words.sort()
for word in words:
  print(word,"")
Problem p02909 (python)

Fixed submission:
s=input()
if s=='Sunny':
    print('Cloudy')
elif s=='Cloudy':
    print('Rainy')
elif s=='Rainy':
    print('Sunny')

Buggy submission (verdict: Runtime Error):
s=input()
if s=='Sunny':
    print('Cloudy')
elif s=='Cloudy':
    print('Rainy')
else s=='Rainy':
    print('Sunny')
Problem p02921 (python)

Fixed submission:
be=input()
af=input()
ans=0
for i in range (3):
    if be[i]==af[i]:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
be=input()
af=input()
ans=0
for i in range (3):
  	if be[i]==af[i]:
    	ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
be=input()
af=input()
ans=0
for i in range (2):
  	if be[i]==af[i]:
    	ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
be=str(input())
af=str(input())
ans=0
for i in range 3:
  	if be[i]==af[i]:
    	ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
be=list(map(str,input().split()))
af=list(map(str,input().split()))
ans=0
for i in range 2:
  	if be[i]==af[i]:
    	ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
be=list(map(str,input().split()))
af=list(map(str,input().split()))
ans=0
for i in range (0,2):
  	if be[i]==af[i]:
    	ans+=1
print(ans)
Problem p02953 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
    if(h[i]<h[i+1]):
        h[i+1]-=1
    if(h[i]>h[i+1]):
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n=int(input())
h=map(int, input().split())
for i in range(n-1):
    if(h[i]<h[i+1]):
        h[i+1]-=1
    if(h[i]>h[i+1]):
        print('No')
        return
print('Yes')

Buggy submission (verdict: Runtime Error):
n=int(input())
h=[int,input().split() for _ in range(n)]
for i in range(n-1):
    if(h[i]<h[i+1]):
        h[i+1]-=1
    if(h[i]>h[i+1]):
        print('No')
        return
print('Yes')
Problem p02993 (python)

Fixed submission:
S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
    print('Bad')
else:
    print('Good')

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
ans=0
for a in range(b):
  if a%c!=0 or a%d!=0:
    ans+=1
print(ans)
Problem p03000 (python)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
d=0
for i in range (0,n):
    d+=l[i]
    if d<=x:
        ans=ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
d=[0]*n
for i in range (2,n+1):
    d[i]=d[i-1]+l[i-1]
    if d[i]<=x:
        ans=ans+1
    else:
        break
print(ans)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
d=[0]*n
for i in range (1,n+1):
    d[i]=d[i-1]+l[i-1]
    if d[i]<=x:
        ans=ans+1
    else:
        break
print(ans)
Problem p03068 (python)

Fixed submission:
N=int(input())
S=str(input())
K=int(input())
Slist = list(S)
S_changed= S
for i in range(N):
    if S[K-1]!=S[i]:
        Slist[i]='*'
        S_changed="".join(Slist)
print(S_changed)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=str(input())
K=int(input())
Slist = list(S)
for i in range(N):
    if S[K-1]!=S[i]:
        Slist[i]='*'
        S_changed="".join(Slist)
print(S_changed)
Problem p03071 (python)

Fixed submission:
A,B=map(int,input().split())
if A>=B:
    a=A-1
    if a>=B:
        print(A+a)
    else :
        print(A+B)
elif B>A:
    b=B-1
    if b>=A:
        print(b+B)
    else :
        print(B+A)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=[int(x) for x in input().split()]
cnt=1
tall=H[0]
for i in range(1,N):
    if tall<=H[i]:
        tall=H[i]
        cnt+=1
print(cnt)
Problem p03079 (python)

Fixed submission:
A,B,C=map(int,input().split())
if A==C and A==B:
    print('Yes')
else :
    print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
s=input()
if s.count('R')>s.count('B'):
    print('Yes')
else:
    print('No')
Problem p03085 (python)

Fixed submission:
b=input()
if b=='A':
    print('T')
elif b=='T':
    print('A')
elif b=='C':
    print('G')
else:
    print('C')

Buggy submission (verdict: Runtime Error):
b=input()
if b=A:
    print('T')
elif b=T:
    print('A')
elif b=C:
    print('G')
else:
    print('C')

Buggy submission (verdict: Runtime Error):
b=input()
if b='A':
    print('T')
elif b='T':
    print('A')
elif b='C':
    print('G')
else:
    print('C')
Problem p03101 (python)

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for d in range(n)]
ans=0
for i in range(n):
  C=c
  for j in range(m):
    C=C+a[i][j]*b[j]
    if C>0:
      ans=ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for i in range(n)]
ans=0
for i in range(n):
  C=c
  for j in range(m):
    C=C+a[i][j]*b[j]
    if C>0:
      ans=ans+1
print(ans)
Problem p03102 (python)

Fixed submission:
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for d in range(n)]
ans=0
for i in range(n):
    C=c
    for j in range(m):
        C+=a[i][j]*b[j]
    if C>0:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
for d in range(n):
  a=[list(map(int,input().split()))]
ans=0
for i in range(n):
    C=c
    for j in range(m):
        C+=a[i][j]*b[j]
    if C>0:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
for i in range(n):
  a=list(map(int,input().split()))
ans=0
for i in range(n):
  C=c
  for j in range(m):
    C=C+a[i][j]*b[j]
    if C>0:
      ans=ans+1
print(ans)
Problem p03323 (python)

Fixed submission:
A,B=map(int,input().split())
if A<=8 and B<=8:
    print('Yay!')
else :
    print(':(')

Buggy submission (verdict: Runtime Error):
A,B=map(iny,input().split())
if A<=8 and B<=8:
    print('Yay!')
else :
    print(':(')
Problem p03478 (python)

Fixed submission:
N,A,B=map(int,input().split())
total=[]
for i in range(1,N+1):
    ans=i%10+i//10%10+i//100%10+i//1000%10+i//10000%10
    if A<=ans and ans<=B:
        total.append(i)
print(sum(total))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
for i in range(1,N+1):
    ans=i%10+i/10%10+i/100%10+i/1000%10+i/10000%10
    if A<=ans and ans<=B:
        total.append(ans)
print(sum(total))
Problem p03494 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
loop=True
cnt=0
while loop:
    for i in range(n):
        if a[i]%2==0:
            a[i]=a[i]/2
        else:
          loop=False
          break
    cnt=cnt+1
print(cnt-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=map(int,input().split())
loop=True
cnt=0
while loop:
    for i in range(n):
        if a[i]%2==0:
            a[i]=a[i]/2
        else:
          loop=False
          break
    cnt=cnt+1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=map(int,input().split())
loop=True
cnt=0
while True:
    for i in range(n):
        if a[i]%2==0:
            a[i]=a[i]/2
        else:
          loop=False
          break
    cnt=cnt+1
print(cnt)
Problem p03632 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if b>c and a<d:
    print((min(b,d)-max(a,c)))
else :
    print(0)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if b>=c:
    printabs((min(b,d)-max(a,c)))
else :
    print(0)
Problem p03636 (python)

Fixed submission:
s=input()
print(s[0]+str(len(s)-2)+s[-1])

Buggy submission (verdict: Runtime Error):
s=input()
print(s[0])
print(len(s)-2)
print(s[s-1])
Problem p03679 (python)

Fixed submission:
X,A,B=map(int,input().split())
if B<=A:
    print('delicious')
elif (B-A)<=X:
    print('safe')
else:
    print('dangerous')

Buggy submission (verdict: Runtime Error):
X,A,B=map(int,input().split())
if C-B>A:
    print('dangerous')
elif C-B==A:
    print('safe')
else:
    print('delicious')
Problem p03711 (python)

Fixed submission:
x,y=map(int,input().split())
g1=[1,3,5,7,8,10,12]
g2=[4,6,9,11]
if (((x in g1) and (y in g1)) or ((x in g2) and (y in g2))):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
g1=[1,3,5,7,8,10,12]
g2=[4,6,9,11]
if (((x in g1) and (y in g1)) or ((x in g2) and (y in g2)))
    print('Yes')
else:
    print('No')
Problem p03795 (python)

Fixed submission:
N=int(input())
print (int((N*800-int(N/15)*200)))

Buggy submission (verdict: Runtime Error):
N=int(input())
print int((N*800-(N/15)*200))
Problem p03844 (python)

Fixed submission:
A,op,B=map(str,input().split())
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
a,op,b=map(input().split())
A=int(a)
B=int(b)
if op == '+':
    print(A+B)
else:
    print(A-B)

Buggy submission (verdict: Runtime Error):
A=int(input())
op=input()
B=int(input())
if op == '+':
    print(A+B)
else:
    print(A-B)

Buggy submission (verdict: Runtime Error):
A=int,input()
op=input()
B=int,input()
if op == '+':
    print(A+B)
else:
    print(A-B)
Problem p03852 (python)

Fixed submission:
c=input()
if (c == 'a' or c== 'i' or c == 'u' or c == 'e' or c == 'o') :
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
c=input()
if c == a or c== i or c == u or c == e or c == o :
    print('vowel')
else:
    print('consonant')
Problem p03860 (python)

Fixed submission:
a,b,c = map(str,input().split())
B = list(b)
print("A"+B[0]+"C")

Buggy submission (verdict: Runtime Error):
a,b,c=map(str,input().split())
s=list[b]
print("A"+s[0]+"C")

Buggy submission (verdict: Runtime Error):
a,b,c=map(input().split())
s=list[b]
print("A"+s[0]+"C")

Buggy submission (verdict: Runtime Error):
a,b,c=map(input().split())
s=list[b]
print("A"+b[0]+"C")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
s=list(b)
print("a"+"b[0]"+"c")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
s=list[b]
print(a+b[0]+c)
Problem p03943 (python)

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

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
if((a+b+c)%3=0):
    print("Yes")
else:
    print("No")
Problem p04011 (python)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy submission (verdict: Runtime Error):
a=[N,K,X,Y]
for i in range(0,4):
    a=a.append(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy submission (verdict: Runtime Error):
a=[N,K,X,Y]
for i in range(0,4):
    a=append(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(/n))
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print((K*X)+((N-K)*Y))
else:
    print(N*X)

Buggy submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print((K*X)+((N-K)*Y))
else:
    print((N*X))

Buggy submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print((K*X)+((N-K)*Y))
else:
    print(int(N*X))

Buggy submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print(int((K*X)+((N-K)*Y)))
else:
    print(int(N*X))

Buggy submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
print(int((K*X)+((N-K)*Y)))
Problem p04029 (python)

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

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

Fixed submission:
N,L=map(int,input().split())
list=[]
i=0
while i<N:
    S=input()
    list.append(S)
    i+=1
list.sort()
print(''.join(list))

Buggy submission (verdict: Runtime Error):
N,L=map(input().split())
list=[]
i=0
while i<N:
    S=input()
    list.append(S)
    i+=1
list.sort()
print(''.join(list))
Problem p02772 (python)

Fixed submission:
n = int(input())
arr = []
arr = list(map(int, input().split()))
flag = 0
count = 0
for i in range(n):
  num = arr[i]
  if num % 2 == 0:
    count += 1
    if(num % 6 == 0) or (num % 10 == 0):
      flag += 1
      
if flag == count:
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
int n = input()
arr = []
arr = list(map(int, input().split()))
for i in range(n):
  num = arr[i]
  if num % 2 == 0:
    if (num % 6 == 0) or (num % 10 == 0):
      print("APPROVED")
    else:
      print("DENIED")
Problem p02802 (python)

Fixed submission:
N, M = [int(s) for s in input().split(' ')]
ac = 0
wa = 0
result = dict()
fail = dict()
for m in range(M):
    p, s = input().split(' ')
    if p in result and result[p] == 'AC':
        continue
    if s == 'WA':
        fail[p] = fail.get(p, 0) + 1
        result[p] = s
    elif s == 'AC': # AC
        ac += 1
        wa += fail.get(p, 0) 
        result[p] = s
    
print(str(ac) + ' ' + str(wa))

Buggy submission (verdict: Runtime Error):
N, M = [int(s) for s in input().split(' ')]
ac = 0
wa = 0
result = dict()
fail = dict()
for m in range(M):
    p, s = input().split(' ')
    if p in result and result[p] == 'AC':
        continue
    if s == 'WA':
        fail[p] = fail.get(p, 0) + 1
        result[p] = s
    elif s == 'AC': # AC
        ac += 1
        wa += fail[p]
        result[p] = s
    
print(str(ac) + ' ' + str(wa))
Problem p03076 (python)

Fixed submission:
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = min([m % 10 for m in [a,b,c,d,e] if m % 10 != 0] + [10])
time = 10 * (math.ceil(a / 10) + math.ceil(b / 10)+ math.ceil(c / 10)+ math.ceil(d / 10)+ math.ceil(e / 10)) - (10 - sub)
print(int(time))

Buggy submission (verdict: Runtime Error):
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = min(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (math.ceil(a / 10) + math.ceil(b / 10)+ math.ceil(c / 10)+ math.ceil(d / 10)+ math.ceil(e / 10)) - (10 - sub)
print(int(time))

Buggy submission (verdict: Runtime Error):
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = miin(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (ceil(a / 10) + ceil(b / 10)+ ceil(c / 10)+ ceil(d / 10)+ ceil(e / 10)) - (10 - sub)
print(int(time))

Buggy submission (verdict: Runtime Error):
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = miin(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (ciel(a / 10) + ciel(b / 10)+ ciel(c / 10)+ ciel(d / 10)+ ciel(e / 10)) - (10 - sub)
print(time)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = miin(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (ciel(a / 10) + ciel(b / 10)+ ciel(b / 10)+ ciel(b / 10)+ ciel(b / 10)) - (10 - sub)
print(time)
Problem p03212 (python)

Fixed submission:
Ns = input()
N = int(Ns)
Nl = len(Ns)
ret = set()
def doit(t, f , s, now):
    if t + f + s == 0:
        if int(now) <= N:
            ret.add(now)
        return
    if t > 0:
        doit(t - 1, f, s, now + str(3)) 
    if f > 0:
        doit(t, f - 1, s, now + str(5)) 
    if s > 0:
        doit(t, f, s - 1, now + str(7)) 
    
for seven in range(1, Nl - 1):
    for five in range(1, Nl - seven):
        least = Nl - seven - five
        for three in range(1, least + 1):
            doit(three, five, seven, '')

print(len(ret))

Buggy submission (verdict: Runtime Error):
Ns = input()
N = int(Ns)
Nl = len(Ns)
ret = 0
def doit(t, f , s, now):
    if t + f + s == 0:
        if int(now) <= N:
            ret += 1
        return
    if t > 0:
        doit(t - 1, f, s, now + str(3)) 
    if f > 0:
        doit(t, f - 1, s, now + str(5)) 
    if s > 0:
        doit(t, f, s - 1, now + str(7)) 
    
for seven in range(1, Nl - 1):
    for five in range(1, Nl - seven):
        least = Nl - seven - five
        for three in range(1, least + 1):
            doit(three, five, seven, '')

print(ret)