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

Fixed submission:
MOD = 998244353
def pow(n,k,m):#n^k mod m
    ans = 1
    while k>0:
        if(k & 1):ans = (ans*n) % m
        n = (n*n)%m
        k >>= 1
    return ans

n = int(input())
a =[int(input()) for i in range(n)]
s = sum(a)
dp1 = [0 for i in range(s+1)] #dp1[x]:Bの和=xとなるような塗り方の総数

dp1[0] = 1

for i in  a:
    dpp1 = [0 for i in range(s+1)]
    for j in range(s+1):
        if j+i <= s:dpp1[j+i] = (dp1[j]+dpp1[j+i]) % MOD
        dpp1[j] = (dp1[j]*2 + dpp1[j]) % MOD
    dp1 = dpp1[:]

if s % 2 == 1:
    ans1 = sum(dp1[(s//2) + 1:]) % MOD
    print((pow(3,n,MOD)-ans1*3) % MOD)
    exit()

ans1 = sum(dp1[(s//2):]) % MOD

dp2 = [0 for i in range(s+1)]

dp2[0] = 1

for i in a:
    dpp2 = [0 for i in range(s+1)]
    for j in range(s+1):
        if j+i <= s:dpp2[j+i] = (dp2[j]+dpp2[j+i]) % MOD
        dpp2[j] = (dp2[j] + dpp2[j]) % MOD
    dp2 = dpp2[:]

print((pow(3,n,MOD)-(ans1*3 - dp2[s//2]*3)) % MOD)

Buggy submission (verdict: Runtime Error):
MOD = 998244353
def pow(n,k,m):#n^k mod m
    ans = 1
    while k>0:
        if(k & 1):ans = (ans*n) % m
        n = (n*n)%m
        k >>= 1
    return ans

n = int(input())
a =[int(input()) for i in range(n)]
s = sum(a)
dp1 = [0 for i in range(s+1)] #dp1[x]:Bの和=xとなるような塗り方の総数

dp1[0] = 1

for i in range a:
    dpp1 = [0 for i in range(s+1)]
    for j in range(s+1):
        if j+i <= s:dpp1[j+i] = (dp1[j]+dpp1[j+i]) % MOD
        dpp1[j] = (dp1[j]*2 + dpp1[j]) % MOD
    dp1 = dpp1[:]

if s % 2 == 1:
    ans1 = sum(dp1[(s//2) + 1:]) % MOD
    print((pow(3,n,MOD)-ans1*3) % MOD)
    exit()

ans1 = sum(dp1[(s//2):]) % MOD

dp2 = [0 for i in range(s+1)]

dp2[0] = 1

for i in a:
    dpp2 = [0 for i in range(s+1)]
    for j in range(s+1):
        if j+i <= s:dpp2[j+i] = (dp2[j]+dpp2[j+i]) % MOD
        dpp2[j] = (dp2[j] + dpp2[j]) % MOD
    dp2 = dpp2[:]

print((pow(3,n,MOD)-(ans1*3 - dp2[s//2]*3)) % MOD)
Problem p03096 (python)

Fixed submission:
MOD = 10**9+7

n = int(input())

dp = [0 for i in range(n+1)]

if(n == 1):
    print("1")
    exit()
if(n==2):
    print("1")
    exit()

dic = {}

ind = [0 for i in range(n+1)]

for i in range(1,n+1):
    c = int(input())
    if c in dic:
        ind[i] = dic[c][-1]
        dic[c].append(i)
    else:
        dic[c] = [i]

dp[0] , dp[1],dp[2] = 1,1,1

for i in range(3,n+1):
    dp[i] = (dp[i] + dp[i-1]) % MOD
    if(ind[i] == 0):continue
    if(ind[i] == i-1):continue
    dp[i] = (dp[i] + dp[ind[i]]) % MOD

print(dp[n])

Buggy submission (verdict: Runtime Error):
MOD = 10**9+7

n = int(input())

dp = [0 for i in range(n+1)]


dic = {}

ind = [0 for i in range(n+1)]

for i in range(1,n+1):
    c = int(input())
    if c in dic:
        ind[i] = dic[c][-1]
        dic[c].append(i)
    else:
        dic[c] = [i]

dp[0] , dp[1],dp[2] = 1,1,1

for i in range(3,n+1):
    dp[i] = (dp[i] + dp[i-1]) % MOD
    if(ind[i] == 0):continue
    if(ind[i] == i-1):continue
    dp[i] = (dp[i] + dp[ind[i]]) % MOD

print(dp[n])
Problem p03832 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

MOD = 10**9 + 7

def ex_euclid(a,b,c,d):
    if (b == 1) : return d
    x = a // b
    y = a % b
    return ex_euclid(b,y,d,(c[0]-x*d[0],c[1]-x*d[1]))
    
 
def mod_inv(a,p):
    x = ex_euclid(p,a,(1,0),(0,1))
    return x[1] % p

n,a,b,c,d = map(int,input().split())

gp = b-a+1

dp = [[-1 for j in range(n+1)] for i in range(gp)]

tb1=[0,1]
tb2=[1] #便宜上0の逆元は0にする
for i in range(2,n+1):
    tb1.append((tb1[i-1]*i) % MOD)
for i in range(1,n+1):
    tb2.append(mod_inv(tb1[i],MOD))
    

for i in range(gp):dp[i][0] = 1


def dfs(sum,k):
    summ = sum
    if(k < 0):
        if (sum != 0):return 0
        else : return 1
    if dp[k][sum] != -1: return dp[k][sum]
    kk = k+a
    temp = dfs(sum,k-1)
    temp1 = 1
    for i in range(c-1):
        if (sum < 0):break
        temp1 = (temp1 * tb1[sum] * tb2[sum-kk]*tb2[kk]) % MOD 
        sum -= kk
    for i in range(c,d+1):
        if(sum-kk < 0) : break
        temp1 = (temp1 * tb1[sum] * tb2[sum-kk]*tb2[kk]) % MOD
        sum -= kk
        temp = (temp + temp1*dfs(sum,k-1)*tb2[i]) % MOD

    dp[k][summ] = temp
    return temp
    

        
ans = dfs(n,gp-1)



print(ans)

Buggy submission (verdict: Runtime Error):
MOD = 10**9 + 7

def ex_euclid(a,b,c,d):
    if (b == 1) : return d
    x = a // b
    y = a % b
    return ex_euclid(b,y,d,(c[0]-x*d[0],c[1]-x*d[1]))
    
 
def mod_inv(a,p):
    x = ex_euclid(p,a,(1,0),(0,1))
    return x[1] % p

n,a,b,c,d = map(int,input().split())

gp = b-a+1

dp = [[-1 for j in range(n+1)] for i in range(gp)]

tb1=[0,1]
tb2=[1] #便宜上0の逆元は0にする
for i in range(2,n+1):
    tb1.append((tb1[i-1]*i) % MOD)
for i in range(1,n+1):
    tb2.append(mod_inv(tb1[i],MOD))
    

for i in range(gp):dp[i][0] = 1


def dfs(sum,k):
    summ = sum
    if(k < 0):
        if (sum != 0):return 0
        else : return 1
    if dp[k][sum] != -1: return dp[k][sum]
    kk = k+a
    temp = dfs(sum,k-1)
    temp1 = 1
    for i in range(c-1):
        if (sum < 0):break
        temp1 = (temp1 * tb1[sum] * tb2[sum-kk]*tb2[kk]) % MOD 
        sum -= kk
    for i in range(c,d+1):
        if(sum-kk < 0) : break
        temp1 = (temp1 * tb1[sum] * tb2[sum-kk]*tb2[kk]) % MOD
        sum -= kk
        temp = (temp + temp1*dfs(sum,k-1)*tb2[i]) % MOD

    dp[k][summ] = temp
    return temp
    

        
ans = dfs(n,gp-1)



print(ans)
Problem p02612 (python)

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

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

Fixed submission:
a1,a2,a3,a4,a5 = map(int, input().split())
ans = [a1,a2,a3,a4,a5]
print(ans.index(0)+1)

Buggy submission (verdict: Runtime Error):
a1 = input()
a2 = input()
a3 = input()
a4 = input()
a5 = input()
if a1 == 0:
  print(1)
if a2 == 0:
  print(2)
if a3 == 0:
  print(3)
if a4 == 0:
  print(4)
if a5 == 0:
  print(5)
Problem p02614 (python)

Fixed submission:
import numpy as np
import copy
import itertools
h,w,k = map(int, input().split())
s = [list(input()) for i in range(h)]
data = np.zeros(h*w).reshape(h,w)
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            data[i][j] = 1
 
ans = 0
## 塗らない場合
if np.sum(data == 1) == k:
    ans = 1
## すべて塗った場合
if k == 0:
    ans = 1
 
a = list()
b = list()
for i in range(1,h):
    a += list(itertools.combinations(range(h), i))
for i in range(1,w):
    b += list(itertools.combinations(range(w), i))
 
for i in a:
    for j in b:
        temp = data.copy()
        temp[i,:] = 2
        temp[:,j] = 2
        if np.sum(temp == 1) == k:
            ans += 1
 
for i in a:
    temp = data.copy()
    temp[i,:] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
for j in b:
    temp = data.copy()
    temp[:,j] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import copy
import itertools
h = int(input())
w = int(input())
k = int(input())
s = [list(input()) for i in range(h)]
data = np.zeros(h*w).reshape(h,w)
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            data[i][j] = 1

ans = 0
## 塗らない場合
if np.sum(data == 1) == k:
    ans = 1
## すべて塗った場合
if k == 0:
    ans = 1

a = list()
b = list()
for i in range(1,h):
    a += list(itertools.combinations(range(h), i))
for i in range(1,w):
    b += list(itertools.combinations(range(w), i))

for i in a:
    for j in b:
        temp = data.copy()
        temp[i,:] = 2
        temp[:,j] = 2
        if np.sum(temp == 1) == k:
            ans += 1

for i in a:
    temp = data.copy()
    temp[i,:] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
for j in b:
    temp = data.copy()
    temp[:,j] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
h = int(input())
w = int(input())
k = int(input())
s = [list(input()) for i in range(h)]
data = np.zeros(h*w).reshape(h,w)
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            data[i][j] = 1

ans = 0
## 塗らない場合
if np.sum(data == 1) == k:
    ans = 1
## すべて塗った場合
if k == 0:
    ans = 1

a = list()
b = list()
for i in range(1,h):
    a += list(itertools.combinations(range(h), i))
for i in range(1,w):
    b += list(itertools.combinations(range(w), i))

for i in a:
    for j in b:
        temp = data.copy()
        temp[i,:] = 2
        temp[:,j] = 2
        if np.sum(temp == 1) == k:
            ans += 1

for i in a:
    temp = data.copy()
    temp[i,:] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
for j in b:
    temp = data.copy()
    temp[:,j] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
print(ans)
Problem p02802 (python)

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

solved = [0]* 10**5
penalty = [0]* 10**5
penalty_sum = 0
for _ in range(m):
    q, result = input().split()
    q = int(q) - 1
    
    if result == 'AC':
        if solved[q] == 0:
            solved[q] = 1
            penalty_sum += penalty[q]
    else:
        if solved[q] == 0:
            penalty[q] += 1

print(str(sum(solved)) + " " + str(penalty_sum))

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

solved = [0]* 10*5
penalty_sum = 0
penalty = 0

for _ in range(m):
    q, result = input().split()
    q = int(q)
    
    if result == 'AC':
        if solved[q] == 0:
            penalty_sum += penalty
            penalty = 0
    else:
        if solved[q] == 0:
            penalty += 1

print(str(len(ac)) + " " + str(penalty_sum))
Problem p02983 (python)

Fixed submission:
L,R = map(int,input().split())

# L <= i,j <== R の中で、i*j mod 2019の最小値を求めよ

# L,R は 0 ~ 2*10^9

# (i*j) mod 2019 = (i mod 2019) * (j mod 2019) %2019

# =============================================================================
# for i in range(2019):
#     for j in range(i,2019):
#         a = (i*j) % 2019
#         b = (i % 2019)*(j % 2019) % 2019
#         if a != b:
#             print(i,a,b)
# =============================================================================

# 全探索: 2019*2019が最大

dist = (R - L)
if dist >= 2019:
    print("0")
else:
    ans = 999999
    for i in range(L,R):
        for j in range(i+1,R+1):
            ans = min(ans,(i*j) % 2019)
    print(ans)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())

# L <= i,j <== R の中で、i*j mod 2019の最小値を求めよ

# L,R は 0 ~ 2*10^9

# (i*j) mod 2019 = (i mod 2019) * (j mod 2019)

if(R <= 2019):
    ans = (R%2019)* ((R-1)%2019)

if(L >= 2019):
    if(L % 2019 < R % 2019):
        ans = (L % 2019)* ((L+1)%2019) % 2019
    else:
        ans = (R%2019)* ((R-1)%2019) % 2019
print(ans)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())

# L <= i,j <== R の中で、i*j mod 2019の最小値を求めよ

# L,R は 0 ~ 2*10^9

# (i*j) mod 2019 = (i mod 2019) * (j mod 2019)

if(R <= 2019):
    ans = (R%2019)* ((R-1)%2019)

if(L >= 2019):
    if(L % 2019 < R % 2019):
        ans = (L % 2019)* ((L+1)%2019)
    else:
        ans = (R%2019)* ((R-1)%2019)
print(ans)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())

# L <= i,j <== R の中で、i*j mod 2019の最小値を求めよ

# L,R は 0 ~ 2*10^9

# (i*j) mod 2019 = (i mod 2019) * (j mod 2019)

if(R <= 2019):
    ans = (R%2019)* ((R-1)%2019)

if(L >= 2019):
    ans = min(ans,(L%2019)* ((L+1)%2019))
print(ans)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())

# L <= i,j <== R の中で、i*j mod 2019の最小値を求めよ

# L,R は 0 ~ 2*10^9

# (i*j) mod 2019 = (i mod 2019) * (j mod 2019)

if(R <= 2019):
    ans = (R%2019)* ((R-1)%2019)

if(L >= 2019):
    ans = (L%2019)* ((L+1)%2019)
print(ans)
Problem p03076 (python)

Fixed submission:
x = [int(input()) for i in range(5)]

x_1 = [int(i / 10) for i in x]
x_2 = [(i % 10) for i in x]

ans = sum(x_1)*10 

for i in range(x_2.count(0)):
    x_2.remove(0)

if(x_2 != []):
    ans += min(x_2)
    ans += (len(x_2)-1)*10

print(ans)

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

x_1 = [int(i / 10) for i in x]
x_2 = [(i % 10) for i in x]

ans = sum(x_1)*10 

for i in range(x_2.count(0)):
    x_2.remove(0)

ans += min(x_2)
ans += (len(x_2)-1)*10

print(ans)
Problem p03101 (python)

Fixed submission:
a = [int(i) for i in input().split()] 
b = [int(i) for i in input().split()] 


c = a[0]*a[1] - ( b[0]*a[1] + b[1]*(a[0]-b[0]) )
print(c)

Buggy submission (verdict: Runtime Error):
a = [int(i) for i in input().split()] 

b = a[1]*a[2] - (a[3]*a[2] + a[4]*(a[1]-1[3]))
print(b)
Problem p03697 (python)

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

if( (a+b) >= 10):
    print("error")
else:
    print(a+b)

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

if( (a+b) >= 10):
    print("error")
else:
    print(A+B)

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

if( (a+b) >= 10):
    print("error")
else:
    print(A+B)
Problem p02922 (python)

Fixed submission:
a,b=map(int,input().split())
count=1
x=a
if b > 1:
  while x < b:
    x = x + (a-1)
    count += 1
  print(count)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
count=1
x=a
if b > 1:
  while X < b:
    x = x + (a-1)
    count += 1
  print(count)
else:
  print(0)
Problem p02946 (python)

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

for i in range(2*K-1):
  print(X-K+1+i,end=" ")

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

for i in range(2*K):
  list[i]=(X-K+1+i)
  print(*list)
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
    n,a,b=map(int,input().split())
    print(min(n*a,b))
Problem p03071 (python)

Fixed submission:
a,b=map(int, input().split())
sum=0
for i in range(2):
  if a>=b:
    sum+=a
    a=a-1
  else:
    sum+=b
    b=b-1
print(sum)

Buggy submission (verdict: Runtime Error):
l=[int(input()) for i in range(6)]
if l[4]-l[0] <=l[5]:
  print('Yay!')
else:
  print(':(')
Problem p03206 (python)

Fixed submission:
m=int(input())
if m==25:
  print('Christmas')
elif m==24:
  print('Christmas Eve')
elif m==23:
  print('Christmas Eve Eve')
elif m==22:
  print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
m=int(input())
if m==25:
  print('Christmas')
elif m==24:
  print('Christmas Eve')
elif m==23:
  print('Christmas Eve Eve')
elif: m==22:
  print('Christmas Eve Eve Eve')
Problem p03260 (python)

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

Buggy submission (verdict: Runtime Error):
    a,b=map(int,input().split())
    if a==2 or b==2:
      print('No')
    else:
      print('Yes')

Buggy submission (verdict: Runtime Error):
a,b=map(int(input().split()))
if a==2 or b==2:
  print('No')
else:
  print('Yes')
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
    print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif:
  abs(a-b)<=d and abs(b-d)<=d:
    print('Yes')
else:
  print('No')
Problem p03377 (python)

Fixed submission:
a,b,x=map(int,input().split())
if a<=x<=a+b:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a,b,x-map(int,input().split())
if a<=x<=b:
  print('YES')
else:
  print('NO')
Problem p03447 (python)

Fixed submission:
x,a,b=[int(input()) for i in range(3)]
print((x-a)%b)

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
print((x-a)%b)
Problem p03635 (python)

Fixed submission:
n,m=map(int,input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input())
print((n-a)*(m-1))
Problem p03729 (python)

Fixed submission:
a,b,c=input().split()
print('YES' if a[-1]==b[0] and b[-1] == c[0] else 'NO')

Buggy submission (verdict: Runtime Error):
a,b,c=input()
print('YES' if a[-1]==b[0] and b[-1] == c[0] else 'NO')
Problem p03737 (python)

Fixed submission:
a,b,c=input().split()
s=a[0].upper() + b[0].upper() + c[0].upper()
print(s)

Buggy submission (verdict: Runtime Error):
a,b,c=map(upper(),input().split())
print(a[0],b[0],c[0])
Problem p03777 (python)

Fixed submission:
a,b=input().split()
if a=='H' and b=='H':
  print('H')
elif a=='H' and b=='D':
  print('D')
elif a=='D' and b=='D':
  print('H')
else:
  print('D')

Buggy submission (verdict: Runtime Error):
a,b=input()
if a=='H' and b=='H':
  print('H')
elif a=='H' and b=='D':
  print('D')
elif a=='D' and b=='D':
  print('H')
else:
  print('D')
Problem p03826 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if a*b>=c*d:
  print(a*b)
else:
  print(c*d)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int.input().split())
if a*b>=c*d:
  print(a*b)
else:
  print(c*d)
Problem p03860 (python)

Fixed submission:
a,b,c=input().split()
print('A'+b[0]+'C')

Buggy submission (verdict: Runtime Error):
a,b,c=input()
print('A'+b[0]+'C')
Problem p03943 (python)

Fixed submission:
l=list(map(int,input().split()))
l=sorted(l)
if (l[0]+l[1])==l[2]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
l=list(map(int,input().split()))
l=sorted(l)
if s[0]+l[1]==s[2]:
  print('Yes')
else:
  print('No')
Problem p04029 (python)

Fixed submission:
n =int(input())
sum=0
for i in range(n):
  sum+=(i+1)
print(sum)

Buggy submission (verdict: Runtime Error):
n=int(input())
sum=0
for i in range(1:n+1):
  sum+=i
print(sum)
Problem p02971 (python)

Fixed submission:
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a_copy = a.copy()
biggest = max(a)
a_copy.remove(biggest)
second_biggest = max(a_copy)

for j in range(n):
    if a[j] == biggest:
        print(second_biggest)
    else:
        print(biggest)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a_copy = a.copy()
biggest = max(a)
a_copy.remove(biggest)
second_biggest = max(a_copy)

for j in range(n):
    if a[j] == biggest:
        print(second_biggest)
    else:
        print(biggest)
Problem p03494 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
amari = 0
ans = 0
while True:
    for i in A:
        amari += i%2
    if amari != 0:
        break
    elif amari == 0:
        for j in range(len(A)):
            A[j] = A[j]/2
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input('N='))
A = list(map(int,input().split()))
times = 0
while True:
  for i in A:
    amari += i%2
  if amari == 0:
    times += 1
    for j in A:
      j = j/2
  else:
    break
print(times)
Problem p02730 (python)

Fixed submission:
S=str(input())
def f(x):
  return x==x[::-1]
N=len(S)
S1=S[:(N-1)//2]
S2=S[(N+1)//2:]
if f(S) and f(S1) and f(S2):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
def f(x):
  return x==x[::-1]
S=str(input())
N=len(S)
S1=S[:(N-3)/2]
S2=S[(N+1)/2:]
if f(S) and f(S1) and f(S2):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S=str(input())
N=len(S)
X=(int(N)-1)/2
Y=(int(N)+3)/2
T=S[1,X]
U=S[Y,N]
if str(S)==str(S)[::-1] and str(T)==str(T)[::-1] and str(U)==str(U)[::-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=list()
N=len(S)
X=(int(N)-1)/2
Y=(int(N)+3)/2
T=S(range(1,X))
U=S(range(Y,N))
if str(S)==str(S)[::-1] and str(T)==str(T)[::-1] and str(U)==str(U)[::-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
N=len(S)
X=(int(N)-1)/2
Y=(int(N)+3)/2
T=S(range(1,X))
U=S(range(Y,N))
if str(S)==str(S)[::-1] and str(T)==str(T)[::-1] and str(U)==str(U)[::-1]:
  print("Yes")
else:
  print("No")
Problem p02772 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
count=0
for i in range(n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      pass
    else:
      count+=1
if count==0:
  print('APPROVED')
else:
  print('DENIED')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
l=0
for i in range(n):
  if a[i]%2==0:
    l.append(a[i])
for j in range(len(l)):
  if l[j]%3==0 or l[j]%5==0:
    l.remove(l[j])
if len(l)==0:
  print('APPROVED')
else:
  print('DENIED')
Problem p02886 (python)

Fixed submission:
n=int(input())
d=list(map(int,input().split()))
sum=0
for i in range(n):
  for j in range(n):
    if i!=j:
      sum+=d[i]*d[j]
print(sum//2)

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int,input().split()))
for i in range(n):
  for j in range(n):
    if i!=j:
      sum+=d[i]*d[j]
print(sum//2)
Problem p02934 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
sum=0
i=0
while i<=N-1:
  sum+=1/A[i]
  i+=1
rev=1/sum
print(rev)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(int(input()))
sum=0
i=0
while i<=N-1:
  sum+=1/A[i]
  i+=1
rev=1/sum
print(rev)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(int,input())
sum=0
i=0
while i<=N-1:
  sum+=1/A[i]
  i+=1
rev=1/sum
print(rev)
Problem p03085 (python)

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

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

Fixed submission:
A,B,K=map(int,input().split())
ans=[]
i=1
for i in range(1,101):
  if A%i==0 and B%i==0:
    ans.append(i)
    i+=1
ans.reverse()
print(ans[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
ans=[]
i=1
for i in range(1,101):
  if A%i==0 and B%i==0:
    ans.append(i)
    i+=1
print(ans[1])
Problem p03145 (python)

Fixed submission:
l=list(map(int,input().split()))
print(l[0]*l[1]//2)

Buggy submission (verdict: Runtime Error):
|AB|,|BC|,|CA|=map(int,input().split())
print(|AB|*|BC|*1/2)
Problem p03211 (python)

Fixed submission:
S=str(input())
M=len(S)
list=[]
i=0
for i in range(M-2):
  list.append(S[i:i+3])
  i+=1
N=len(list)
new_list=[]
j=0
for j in range(N):
  new_list.append(abs(int(list[j])-753))
print(min(new_list))

Buggy submission (verdict: Runtime Error):
S=str(input())
M=len(S)
list=[]
i=0
for i in range(N-2):
  list.append(S[i:i+3])
  i+=1
N=len(list)
new_list=[]
j=0
for j in range(N):
  new_list.append(abs(int(list[j])-753))
print(min(new_list))
Problem p03239 (python)

Fixed submission:
n,T=map(int,input().split())
ans=1001
for i in range(n):
  c,t=map(int,input().split())
  if t<=T:
    ans=min(ans,c)
if ans==1001:
  print('TLE')
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n,t=map(int,input().split())
c,t=[list(map(int,input().split())) for _ in range(n)]
l=[]
for i in range(n):
  if t[i]<=t:
    l.append([c[i],t[i]])
    if len(l)==0:
      print('TLE')
    else:
      l.sort()
      print(l[0][0])
Problem p03323 (python)

Fixed submission:
A,B=map(int,input().split())
if A>8 or B>8:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A<=8 and B<=8:
  print("Yay!")
ekse:
  print(":(")
Problem p03370 (python)

Fixed submission:
n,x=map(int,input().split())
m=[int(input()) for _ in range(n)]
y=x-sum(m)
print(n+y//min(m))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
m=[list(map(int,input().split())) for _ in range(n)]
y=x-sum(m)
print(n+y//min(m))
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a*b)%2==0:
  print(Odd)
else:
  print(Even)
Problem p03478 (python)

Fixed submission:
n,a,b=map(int,input().split())
x=[]
y=[]
for i in range(1,n+1):
  x.append(i)
for j in range(n):
  s=sum(list(map(int,str(x[j]))))
  if s>=a and s<=b:
    y.append(x[j])
print(sum(y))

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
l=[]
for i in range(1,n+1):
  s=sum(list(map(int,str(i))))
  if s>=a s<=b:
    l.append(i)
print(sum(l))