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

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

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

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

Buggy submission (verdict: Runtime Error):

a = input()
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):

a = input()
print(a+a ** 2+a ** 3)

Buggy submission (verdict: Runtime Error):

a = input()
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
import sys
a = input()
print(a+a^2+a^3)

Buggy submission (verdict: Runtime Error):
a=input()
ans=a+a^2+a^3
print(ans)
Problem p02614 (python)

Fixed submission:
h,w,k=map(int,input().split())
table=[]
for i in range(h):
  row=str(input())
  table.append(row)

ans = 0
for maskR in range(1 << h):
    for maskC in range(1 << w):
        black = 0
        for i in range(h):
            for j in range(w):
                if ((maskR >> i) & 1) == 0 and ((maskC >> j) & 1) == 0 and table[i][j] == '#': 
                    black = black + 1
        if black == k: 
            ans = ans + 1
print(ans)

Buggy submission (verdict: Runtime Error):
h,w,k=map(int,input().split())
table=[]
cntr=[]
cntc=[]
for i in range(h):
  row=str(input())
  table.append(row)
  cntr.append(row.count('#'))

for i in range(w):
  b_num=0
  for j in range(h):
    if table[j][i]=="#":
      b_num+=1
  cntc.append(b_num)
total=sum(cntr)
def myfunc(r,c):
    if r==0 and c==0:
        return 0
    elif r==0:
        return cntc[c-1]
    elif c==0:
        return cntr[r-1]
    else:
        return (cntr[r-1] + cntc[c-1]) if table[r-1][c-1]!="#" else (cntr[r-1] + cntc[c-1]-1)
ans=0    
for i in range(h):
    for j in range(i+1,h,1):
        if k == total-(cntr[i]+cntr[j]):
            ans+=1
for i in range(w):
    for j in range(i+1,h,1):
        if k == total-(cntc[i]+cntc[j]):
            ans+=1
for i in range(h+1):
    for j in range(w+1):
        #print(myfunc(i,j))
        if k==(total-myfunc(i,j)):
            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())
arr = list(map(int,input().split()))

arr.sort()
res = 1
flg = True
for i in arr:
    res*=i
    if res >10**18:
        flg = False
        print('-1')
    # print(res, res >=10**18)
if(flg):print(res)
Problem p02677 (python)

Fixed submission:
A,B,H,M=map(float,input().split())
from math import sin, cos, pi,sqrt

C = abs(30*H-5.5*M)
C = C if C <= 180 else 360-C
c =sqrt(A**2+B**2-2*A*B*cos(C*pi/180))
print(c)

Buggy submission (verdict: Runtime Error):
A,B,H,M=map(float,input().split())
from math import sin, cos, pi

C = abs(30*H-5.5*M)
C = C if C <= 180 : 360-C
c =sqrt(A**2+B**2-2*A*B*cos(C*pi/180))
print(C)
Problem p02681 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,k = map(int,input().split())
if a+b >= k:
    print(a)
else: 
    print(a-abs(k-a-b))

Buggy submission (verdict: Runtime Error):
a,b,c,k = map(int,input().split())
if k <= a+b:print(a)
else: print(a-(k-a-b))
Problem p02741 (python)

Fixed submission:
arr = "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51".split(", ")
K = int(input())
print(arr[K-1])

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
hei = int(h / 2) if h % 2 == 0 else (int(h / 2) + 1)
wid = int(h / 2) if h % 2 == 0 else int((h - 1) / 2)
res = int(w / 2) * (hei + wid) if w % 2 == 0 else (int(w / 2) * (hei + wid)) + hei
print(res)
Problem p02760 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a = []
for i in range(3):
  tmp = input()
  a.append(list(map(int, tmp.split())))

n = int(input())
# print('n', n)
b = []
for j in range(n):
    b.append(int(input()))

# print('a', a)
# print('b', b)

for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j] = 0

def check(a):
    #　たてビンゴ
    # 斜め
    if a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
            print('Yes')
            exit()
    if a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 0:
            print('Yes')
            exit()
    for i in range(3):
        if (a[0][i] == 0 and a[1][i] == 0 and a[2][i] == 0):
            print('Yes')
            exit()
        if a[i] == [0, 0, 0]:
            print('Yes')
            exit()
    print('No')

check(a)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = []
for i in range(3):
  tmp = input()
  a.append(list(map(int, tmp.split())))

n = int(input())
# print('n', n)
b = []
for j in range(n):
    b.append(int(input()))

# print('a', a)
# print('b', b)

def rep(a):
    for i in range(3):
        for j in range(3):
            if a[i][j] in b:
            a[i][j] = 0

def check(a):
    #　たてビンゴ
    # 斜め
    if a[0][0] == 0 & a[1][1] == 0 & a[2][2] == 0:
            print('Yes')
            exit()
    if a[0][2] == 0 & a[1][1] == 0 & a[2][0] == 0:
            print('Yes')
            exit()
    for i in range(3):
        if (a[0][i] == 0 & a[1][i] == 0 & a[2][i] == 0):
            print('Yes')
            exit()
        if a[i] == [0, 0, 0]:
            print('Yes')
            exit()
    print('No')

rep(a)
check(a)
Problem p02765 (python)

Fixed submission:
n, r = map(int, input().split())

def calc(n, r):
  if n >= 10:
    return r
  else:
    return r + 100*(10-n)

print(calc(n, r))

Buggy submission (verdict: Runtime Error):
n, r = input().split()

def calc(n, r):
  if n >= 10:
    return n
  else:
    return 100*(10-r)

return calc(n,r)
Problem p03262 (python)

Fixed submission:
N,X = map(int, input().split())
target = list(map(int, input().split()))

distances = [abs(i - X) for i in target]

def GCD(x,y):
    if y == 0:
        return x
    else:
        return GCD(y, x % y)
res = 0
for d in distances:
    res = GCD(res, d)
print(res)

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

distances = [abs(i - X) for i in target]

def GCD(x,y):
    if x == 0:
        return y
    else:
        return GCD(y, x % y)
res = 0
for d in distances:
    res = GCD(res, d)
print(res)
Problem p03830 (python)

Fixed submission:
N = int(input())

primes = set()
for i in range(2,N+1):
    for p in primes:
        if i % p == 0:
            break
    else:
        primes.add(i)

len_prime = len(primes)
d = dict(zip(list(primes), [1 for i in range(len_prime)]))

for i in range(2, N+1):
    while i != 1:
        for p in primes:
            if i % p == 0:
                d[p]+= 1
                i //= p
res = 1
for i in d.values():
    res*=i
print(res % 1000000007)

Buggy submission (verdict: Runtime Error):
m=int(input())
import math

N=math.factorial(m)
n= int(N**.5)
res = len(str(N))
arr = []
tmp = N
for i in range(2,n+1):
    if tmp % i == 0:
        while tmp % i == 0:
            arr.append(i)
            tmp //= i
if tmp != 1: arr.append(tmp)
arr += [1, N]
print(len(arr) % (10**9+7))
Problem p02641 (python)

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

if n == 0:
    print(x)
    exit()

p = list(map(int,input().split()))

allList=[]

for i in range(-201,301):
    allList.append(i)

diff = set(allList) ^ set(p)



diff = list(diff)
diff.append(x)
diff = sorted(diff)

# print(diff)

ind = diff.index(x)
# print(ind)

# if x == 100:
    

a = diff[ind-1]
b = diff[ind+1]
# print(a,b)

ax = abs(x-a)
bx = abs(x-b)

# print(ax,bx)

if ax==bx:
    if a < b:
        print(a)
        exit()
    else:
        print(b)
        exit()

if ax > bx:
    print(b)
else:
    print(a)

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

if n == 0:
    print(x)
    exit()

p = list(map(int,input().split()))

allList=[]

for i in range(1,101):
    allList.append(i)
    
diff = set(allList) ^ set(p)

diff = list(diff)
diff.append(x)
diff = sorted(diff)

# print(diff)

ind = diff.index(x)
# print(ind)

# if x == 100:
    

a = diff[ind-1]
if x != 100:
    b = diff[ind+1]
else:
    print(a)
    exit()

ax = abs(a-x)
bx = abs(b-x)

# print(ax,bx)

if ax==bx:
    if a < b:
        print(a)
    else:
        print(b)

if ax > bx:
    print(b)
    exit()

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

if n == 0:
    print(x)
    exit()

p = list(map(int,input().split()))

allList=[]

for i in range(1,101):
    allList.append(i)
    
diff = set(allList) ^ set(p)

diff = list(diff)
diff.append(x)
diff = sorted(diff)

# print(diff)

ind = diff.index(x)
# print(ind)

a = diff[ind-1]
b = diff[ind+1]

ax = abs(a-x)
bx = abs(b-x)

# print(ax,bx)

if ax==bx:
    if a < b:
        print(a)
    else:
        print(b)

if ax > bx:
    print(b)
    exit()
Problem p02761 (python)

Fixed submission:
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]

for i in range(1000):
    ans = str(i)
    if len(ans) != n:
        continue
    for s, c in sc:
        if int(ans[s-1]) != c:
            break
    else:
        print(ans)
        exit()

print(-1)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]

for i in range(1000):
    ans = str(i)
    for s, c in sc:
        print(s, c, ans)
        if int(ans[s-1]) != c:
            break
    else:
        print(ans)
        exit()

print(-1)
Problem p02642 (python)

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

dp=[0]*(max(A)+1)

for a in A:
    for x in range(a,len(dp),a):
        dp[x]+=1

count=0
for a in A:
    if dp[a]==1:
        count+=1

print(count)

Buggy submission (verdict: Runtime Error):
X,N = map(int, input().split())
if N==0:
    print(X)
else:
    p=list(map(int,input().split()))
    A=[i for i in range(100) if i not in p]

mini=101
minip=101
for i in range(N):
    if abs(p[i]-X) <=mini:
        mini= abs(p[i]-X)
        minip=p[i]
        

minimini=101
answer=101
for a in A:
    if abs(a-minip)<minimini:
        minimini=abs(a-minip)
        answer=a

print(answer)
Problem p02658 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
A.sort()
answer=1

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

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main(){
  long long N;
  cin >>N;
  
  
  vector<long long> A(N);
  for(int i=0; i<N; i++){
    cin >> A[i];
  }
  
  sort(begin(A),end(A));
  
  long long answer=1;
  for(int i=0; i<N; i++){
    answer*=A[i];
  }
  
  if(answer>1000000000000000000){
  	cout<< -1 << endl;
  }else{
    cout << answer << endl;
  }
  
}
Problem p02780 (python)

Fixed submission:
from itertools import accumulate

N,K = map(int, input().split())
p=list(map(int,input().split()))

q=[0]+p
q=list(accumulate(q)) 

ans=[]
for i in range(N-K+1):
    ans.append(((q[i+K]-q[i])+K)*0.5)

print(max(ans))

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


ans=[]
for j in  range(1,N-K+1):
    temp=0
    temp+=(0.5*(sum(p[j:j+K])+K))
    ans.append(temp)
    

print(max(ans))

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

final_answer=0
for i in range(N-K+1):
    ans=0
    for j in  range(i,i+K):
        ans+=(0.5*(p[j]+1))
        if ans>=final_ans:
            final_ans=ans

print(final_ans)
Problem p02783 (python)

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

count=0
while H >0:
    H -=A
    count+=1
    
print(count)

Buggy submission (verdict: Runtime Error):
H=int(input())
A=int(input())
 
ans=int(H//A)+1
print(ans)

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

ans=int(H/A)+1
print(ans)
Problem p03611 (python)

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

count=[0 for _ in range(max(A)+1)]
for i in range(n):
  count[A[i]]+=1
  
answer=0
if n>3:
  for i in range(0,n-2):
    tmp=sum(count[i:i+3])
    if tmp>answer:
      answer=tmp
elif n==2:
  if len(count)>3:
    answer=1
  else:
    answer=2
elif n==1:
  answer=1

print(answer)

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

count=[0 for _ in range(max(A)+1)]
for i in range(n):
  count[A[i]]+=1

  
answer=0
for i in range(0,n-3):
  tmp=int(count[i])+int(count[i+1])+int(count[i+2])
  if tmp>answer:
    answer=tmp
    
print(answer)
Problem p03624 (python)

Fixed submission:
S=str(input())

import string
alphabet="".join([i for i in string.ascii_lowercase if i not in S])

if(alphabet):
  print(alphabet[0])
else:
  print("None")

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
  
int main() {
  string S;
  cin >> S;
  
  int bucket[26]={0};//バケット
  
  for(int i=0;i<S.length();i++){
    int tmp= S.at(i)-'a';
    bucket[tmp]++;
  }
  
  int ans=-1;//答えを格納
  for(int i=0; i<26; i++){
    if (bucket[i]==0){
      ans=i;
      break;
    }
  }
  
  if(ans==-1){
    cout << "None" << endl;
  }else{
    printf("%c\n",ans+97);
  }
  
  return 0;
      
}

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
  
int main() {
  string S;
  cin >> S;
  
  int bucket[26]={0};//バケット
  
  for(int i=0;i<S.length();i++){
    int tmp= S.at(i)-'a';
    bucket[tmp]++;
  }
  
  int ans=-1;//答えを格納
  for(int i=0; i<26; i++){
    if (bucket[i]==0){
      ans=i;
      break;
    }
  }
  
  if(ans==-1){
    cout << "None" << endl;
  }else{
    printf("%c\n",ans+97);
  }
      
}
Problem p02718 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
s=0
b=True
for i in a:
  s+=i

  
for i in range(0,m):
  if a[i]>=s/4/m:
    b=True
  else:
    b=False
    
if b:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
s=0
b=True
for i in a:
  s+=a
  
for i in range(0,m):
  if a[i]>=s/4/m:
    b=True
  else:
    b=False
    
if b:
  print('Yes')
else:
  print('No')

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

count=0
sum=0

for i in a:
  sum+=i
  
for i in a:
  if a>=(sum/4*m):
    count+=1

if count>=m:
  print('Yes')
else:
  print('No')

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

a=list(map(int,input().split()))

sum=0
count=0
for i in a:
  sum+=a
  
for i in a:
  if a>=(sum/4*m):
    count+=1
    
if(count>=m):
  print('Yes')
else:
  print('No')
Problem p03844 (python)

Fixed submission:
a = input().split()

if a[1]=='+':
  print(int(a[0])+int(a[2]))
elif a[1]=='-':
  print(int(a[0])-int(a[2]))

Buggy submission (verdict: Runtime Error):
a = list(input().split())

if a[1]=='+':
  print(int(a[0])+int(a[2]))
else if a[1]=='-':
  print(int(a[0])-int(a[2]))
Problem p03962 (python)

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

print(len(a))

Buggy submission (verdict: Runtime Error):
a=[]
for i in range(3):
  a.append(int(input()))
  
set(a)

print(len(a))
Problem p02612 (python)

Fixed submission:
a=int(input())
b=a % 1000
if b>>0:
  print(1000-b)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a=input(int())
b=a % 1000
if b>>0:
  print(1000-b)
else:
  print(0)
Problem p02621 (python)

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

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

Fixed submission:
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for i in range(N):
    S = str(input())
    if S == 'AC':
        ac += 1
    elif S == 'WA':
        wa += 1
    elif S == 'TLE':
        tle += 1
    elif S == 'RE':
        re += 1
print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(re))

Buggy submission (verdict: Runtime Error):
C:\pycharm\code_atcoder\venv\Scripts\python.exe C:/pycharm/code_atcoder/173B.py
6
AC
TLE
AC
AC
WA
TLE
AC x 3
WA x 1
TLE x 2
RE x 0

プロセスは終了コード 0 で完了しました

Buggy submission (verdict: Runtime Error):
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for i in range(N):
    S = str(input())
    if S == 'AC':
        ac += 1
    elif S == 'WA':
        wa += 1
    elif S == 'TLE':
        tle += 1
    elif S == 'RE':
        re += 1
print('AC x '+ac)
print('WA x '+wa)
print('TLE x '+tle)
print('RE x '+re)
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()))

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

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

if 0 in A:
    print(0)

x = 1
for i in range(N):
    x = x * A[i]
    if x>10**18:
        x = -1
print(x)
Problem p02718 (python)

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

s = sum(A)
A = sorted(A,reverse=True)

for i in range(N):
    if i == M-1:
        if (s/(4*M))>A[i]:
            print('No')
        else:
            print('Yes')

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

s = sum(A)
A.sort(reverse=True)

for i in range(1,N+1):
    if i == M:
        if (s/(4*M))>A[i]:
            print('No')
        else:
            print('Yes')
Problem p02760 (python)

Fixed submission:
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
N = int(input())

for i in range(N):
    b = int(input())
    for t in range(3):
        if A1[t] == b:
            A1[t] = -1
        elif A2[t] == b:
            A2[t] = -1
        elif A3[t] == b:
            A3[t] = -1

if A1 == [-1, -1, -1] \
        or A2 == [-1, -1, -1] \
        or A3 == [-1, -1, -1] \
        or A1[1] == A2[1] == A3[1] == -1 \
        or A1[2] == A2[2] == A3[2] == -1 \
        or A1[0] == A2[0] == A3[0] == -1 \
        or A1[0] == A2[1] == A3[2] == -1 \
        or A1[2] == A2[1] == A3[0] == -1 \
        or A1[0] == A2[0] == A3[0] == -1 \
        or A1[1] == A2[1] == A3[1] == -1 \
        or A1[2] == A2[2] == A3[2] == -1:
    print('Yes')
else:
    print('No')

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

for i in range(N):
    b = int(input())
    for t in range(3):
        if A1[t] == b:
            A1[t] = -1
        elif A2[t] == b:
            A2[t] = -1
        elif A3[t] == b:
            A3[t] = -1

if A1 == A2 == A3 == [-1, -1, -1] or A1[1] == A2[1] == A3[1] == -1 or A1[2] == A2[2] == A3[2] == -1　or A1[0] == A2[0] == A3[0] == -1 or A1[0] == A2[1] == A3[2] == -1 or A1[2] == A2[1] == A3[0] == -1:
    print('Yes')
else:
    print('No')
Problem p02899 (python)

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

B = [0]*N
for i in range(N):
    B[A[i]-1] = i+1

print(' '.join(map(str,B)))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
B = [0]*(N)
for i in range(N):
    B[A[i]] = A[i]
print(B)
Problem p02621 (python)

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

Buggy submission (verdict: Runtime Error):
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
print(a+a*+a**)
Problem p02696 (python)

Fixed submission:
A,B,N=map(int,input().split())
x=min(B-1,N)
print(int(A*x/B)-int(x/B)*A)

Buggy submission (verdict: Runtime Error):
import math

A,B,N=map(int,input().split())
ans=[0]*(N+1)
for x in range(0,N+1):
    a=math.floor(A*x/B)
    b=A*math.floor((x/B))
    ans[x]+=a-b
print(max(ans))

Buggy submission (verdict: Runtime Error):
import math

A,B,N=map(int,input().split())
ans=[0]*(N+1)
for x in range(0,N+1):
    a=math.floor(A*x/B)
    b=A*math.floor((x/B))
    ans[x]+=a-b
print(max(ans))

Buggy submission (verdict: Runtime Error):
import math

A,B,N=map(int,input().split())
ans=[0]*(N+1)
for x in range(0,N+1):
    a=math.floor(A*x/B)
    b=A*math.floor((x/B))
    ans[x]+=a-b
print(ans)

Buggy submission (verdict: Runtime Error):
import math

A,B,N=map(int,input().split())
ans=[0]*N
for x in range(0,N+1):
    a=math.floor(A*x/B)
    b=A*math.floor((x/B))
    ans[x-1]+=a-b
print(max(ans))

Buggy submission (verdict: Runtime Error):
import math

A,B,N=map(int,input().split())
ans=[0]*N
for x in range(0,N+1):
    a=math.floor(((A*x)/B))
    b=A*math.floor((x/B))
    ans[x-1]+=a-b
print(max(ans))

Buggy submission (verdict: Runtime Error):
A,B,N=map(int,input().split())
ans=[0]*N
for x in range(0,N+1):
    a=int((A*x)/B)
    b=A*int(x/B)
    ans[x-1]+=a-b
print(max(ans))
Problem p02713 (python)

Fixed submission:
K=int(input())
ans=0

def gcd2(a,b):
    if b==0:
        return a
    return gcd2(b,a%b)
def gcd3(a,b,c):
    return gcd2(gcd2(a,b),c)

for i in range(1,K+1):
    for j in range(i,K+1):
        for k in range(j,K+1):
            if i==j==k:
                ans+=gcd3(i,j,k)
            elif i==j or j==k:
                ans+=gcd3(i,j,k)*3
            else:
                ans+=gcd3(i,j,k)*6

print(ans)

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

def gcd2(a,b):
    if b==0:
        return a
    return gcd2(b,a%b)
def gcd3(a,b,c):
    return gcd2(gcd2(a,b),c)

for i in range(1,K+1):
    for j in range(i,K+1):
        for k in range(k,K+1):
            if i==j==k:
                ans+=gcd3(i,j,k)
            elif i==j or j==k:
                ans+=gcd3(i,j,k)*3
            else:
                ans+=gcd3(i,j,k)*6

print(ans)
Problem p03448 (python)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
count=0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if ((500*i)+(100*j)+(50*k))==X:
                count+=1

print(count)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
X=int(input())
count=0
for i in range(A+1):
    for j in range(B+1):
        for K in range(C+1):
            if ((500*i)+(100*j)+(50*k))==0:
                count+=1

print(count)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
c=(a*b)%2
if c==0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=(a*b)%2
if c==0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=(a*b)%2
if c==0:
    print("Even")
else:
    print("Odd")

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

if (a*b)%2==0:
    print("Even")
else:
    print("Odd")
Problem p03494 (python)

Fixed submission:
ans=10**9
n=int(input())
a=list(map(int,input().split()))

for A in a:
    cnt=0
    while A % 2==0: 
        A//=2
        cnt+=1
      
    if cnt<ans:
        ans=cnt
print(ans)

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

for A in a:
    cnt=0
    while A%2==0:
        A=A//2
        cnt=cnt+1

print(cnt)

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

for A in a:
    while int(A)%2==0:
        print(A)
        if int(A)%2==1:
            break
Problem p02687 (python)

Fixed submission:
s=input()
print('ABC' if s=='ARC' else 'ARC')

Buggy submission (verdict: Runtime Error):
s=input()
print('ABC' if s='ARC' else 'ARC')
Problem p02690 (python)

Fixed submission:
x=int(input())
a=[]
for i in range(220):
  a.append(i**5)
for i in range(220):
  y=a[i]-x
  if y in a:
    print(i,a.index(y))
    break
  elif -y in a:
    print(i,-a.index(-y))
    break

Buggy submission (verdict: Runtime Error):
x=int(input())
a=[]
for i in range(220):
  a.append[i**5]
for i in range(220):
  y=x-a[i]
  if y in a:
    print(i,a.index(y))
    break
  elif -y in a:
    print(i,-a.index(y))