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

Fixed submission:
n,a,b=map(int,input().split())
s=a+b
if n%s==0:
    print(int(n/s)*a)
else:
    if n%s>=a:
        print(int(n//s+1)*a)
    else:
        print(int(n//s)*a+n%s)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
s=a+b
if n%s==0:
    print(int(n/s)*a)
else:
    if n%s>=a:
        print(int(n//s+1)*a)
    else:
        print(int(n//s+)*a+n%s)
Problem p02831 (python)

Fixed submission:
import fractions
a,b=map(int,input().split())
c=fractions.gcd(a,b)
ans=a*b/c
print(int(ans))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
c=math.gcd(a,b)
ans=a*b/c
print(int(ans))

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b=map(int,input().split())
c=gcd(a,b)
ans=a*b/c
print(int(ans))

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b=map(int,input().split())
c=gcd(a,b)
ans=a*b/c
print(int(ans))
Problem p02987 (python)

Fixed submission:
n=input()
m=set(n)
if len(m)==2 and n.count(n[0])==2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=input()
m=set(n)
if len(m)==2 and n.count(m[0]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=input()
m=set(n)
a,b=0,0
for i in n:
    if len(m)!=2:
        print("No")
        break
    if i==m[0]:
        a+=1
    elif i==m[1]:
        b+=1
else:
    if a==2 and b==0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n=input()
m=set(sorted(n))
a,b=0,0
for i in n:
    if len(m)!=2:
        print("No")
        break
    if i==m[0]:
        a+=1
    elif i==m[1]:
        b+=1
else:
    if a==2 and b==0:
        print("Yes")
    else:
        print("No")
Problem p02989 (python)

Fixed submission:
n=int(input())-1
l=list(map(int,input().split()))
l.sort()
m=n//2
if l[m]==l[m+1]:
    print(0)
else:
    print(l[m+1]-l[m])

Buggy submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
ans=0
for i in range(n-2):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)
Problem p03042 (python)

Fixed submission:
n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12) or (int(f)>12 and l=="00") or (int(l)>12 and f=="00") :
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 or l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")

Buggy submission (verdict: Runtime Error):
n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12):
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")

Buggy submission (verdict: Runtime Error):
n=input():
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12):
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")
Problem p03834 (python)

Fixed submission:
a=input()
l=a.split(",")
print(l[0]+" "+l[1]+" "+l[2])

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
print(a+" "+b+" "+c)
Problem p02580 (python)

Fixed submission:
H, W, M = map(int, input().split())
Hdst = [0]*H
Wdst = [0]*W
DST = [[0] * M for i in range(2)]
for i in range(M):
    hi, wi = map(int, input().split())
    Hdst[hi-1] += 1
    Wdst[wi-1] += 1
    DST[0][i] = hi-1
    DST[1][i] = wi-1

Hdstmax = max(Hdst)
Wdstmax = max(Wdst)
Hbomb = [i for i, x in enumerate(Hdst) if x == Hdstmax]
Wbomb = [i for i, x in enumerate(Wdst) if x == Wdstmax]

Hchk = [False]*H
Wchk = [False]*W
for i in Hbomb:
    Hchk[i] = True
for i in Wbomb:
    Wchk[i] = True

tmp = 0
for i in range(M):
    if Hchk[DST[0][i]] and Wchk[DST[1][i]]:
        tmp += 1

if len(Hbomb)*len(Wbomb) == tmp:
    print(Hdstmax + Wdstmax - 1)
else:
    print(Hdstmax + Wdstmax)

Buggy submission (verdict: Runtime Error):
H, W, M = map(int, input().split())
Hdst = [0]*H
Wdst = [0]*W
DST = [[0] * W for i in range(H)]
for i in range(M):
    hi, wi = map(int, input().split())
    Hdst[hi-1] += 1
    Wdst[wi-1] += 1
    DST[hi-1][wi-1] = 1

Hbomb = [i for i, x in enumerate(Hdst) if x == max(Hdst)]
Wbomb = [i for i, x in enumerate(Wdst) if x == max(Wdst)]

ans = 0
for i in Hbomb:
    for j in Wbomb:
        if Hdst[i] + Wdst[j] - DST[i][j] > ans:
            ans = Hdst[i] + Wdst[j] - DST[i][j]

print(ans)
Problem p02596 (python)

Fixed submission:
K = int(input())
ans = 1
X = 7
cnt = K
while(cnt > 0):
#     print('rem={}'.format(X%K))
    rem = X % K
    if rem == 0:
        print(ans)
        break
    else:
        ans += 1
        X = rem*10 + 7 
        cnt -= 1

if rem != 0:
    print(-1)

Buggy submission (verdict: Runtime Error):
K = int(input())
ans = 1
X = 7
cnt = K
while(cnt > 0):
#     print('rem={}'.format(X%K))
    rem = X % K
    if rem == 0:
        print(ans)
        break
    else:
        remlst.append(rem)
        ans += 1
        X = rem*10 + 7 
        cnt -= 1

if rem != 0:
    print(-1)

Buggy submission (verdict: Runtime Error):
K = int(input())
ans = 1
X = 7
cnt = K
while(cnt > 0):
#     print('rem={}'.format(X%K))
    rem = X % K
    if rem == 0:
        print(ans)
        break
    else:
        remlst.append(rem)
        ans += 1
        X = rem*10 + 7 
        cnt -= 1

if cnt == 0:
    print(-1)
Problem p02572 (python)

Fixed submission:
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = list(map(int, input().split()))
s=0
ss=0
for i in range(n):
    if i > 0:
        ss += a[i-1]%mod
    s += ss * a[i] % mod
print(s%mod)

Buggy submission (verdict: Runtime Error):
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = list(map(int, input().split())
s=0
ss=0
for i in range(n):
    ss += a[i]%mod
    s += ss * a[i] % mod
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = np.array(map(int, input().split())
s=0
ss=0
for i in range(n):
  ss += a[i]%mod
  s += ss * a[i] % mod
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = np.array(map(int, input().split())
s=0
ss=0
for i in range(n):
    ss += a[i]%mod
    s += ss * a[i] % mod
print(s)
Problem p02629 (python)

Fixed submission:
N = int(input()) 
ans='' 
while N>0:
    N -= 1
    ans += chr(ord('a') + N % 26) 
    N //= 26
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
N = int(input()) 
ans='' 
while N>0:
    N -= 1
    ans += chr(ord('a') + N % 26) N //= 26
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
N = int(input()) ans='' whileN>0:
N -= 1
ans += chr(ord('a') + N % 26) N //= 26
print(ans[::-1])
Problem p02570 (python)

Fixed submission:
[D, T, S] = [int(i) for i in input().split()]
if D <= T * S:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
[D T S] = [int(i) for i in input().split()]
if D <= T * S:
  print("yes")
else:
  print("no")
Problem p02577 (python)

Fixed submission:
N=int(input())
if N % 9 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
line = input()
sum = 0
for i in range(len(line)):
  sum = sum + int(line[0])
 print(sum)
Problem p02594 (python)

Fixed submission:
X = int(input())
if X >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
X = int(input())
if x >= 30:
  print("Yes")
else:
  print("No")
Problem p02622 (python)

Fixed submission:
S = input()
T = input()
count = 0
for i in range(len(S)):
  if S[i] != T[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
for s, t in S, T:
  if s != t:
    count += 1
print(count)
Problem p02831 (python)

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

n = max(a,b)
m = min(a,b)
ans=0

for i in range(1,m+1):
    ans = n*i
    if (ans)%m==0:
        print(ans)
        exit(0)

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

for i in range(1,min(a,b)):
    if a%i==0 and b%i==0:
        ans=i

print(a*b//ans)
Problem p02862 (python)

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

if (x+y)%3 != 0:
    print(0)
    exit(0)

n = (2*y-x)//3
m = (2*x-y)//3

if n<0 or m<0:
    print(0)
    exit(0)

mi = min(n,m)
num = n+m
mod = 10**9+7
a = 1
b = 1

for i in range(mi):
    a = a*(num-i)%mod
    b = b*(mi-i)%mod

print((a*pow(b,mod-2,mod))%mod)

Buggy submission (verdict: Runtime Error):
import math

x, y = map(int, input().split())

a = x+y
b = abs(x-y)
c = (x+y)/3
e=1

if a%3 != 0:
    ans = 0
elif b==c:
    ans = 1
else:
    d=c / 2 + b / 2
    n=int(c-(c/2+b/2))

    for i in range(n):
        e*=d-i

    ans = int(e/math.factorial(n))%(10**9+7)

print(ans)
Problem p02881 (python)

Fixed submission:
import math

n = int(input())
num_i = 0

for i in range(1,int(math.sqrt(n))+1):
    if n%i == 0:
        num_i = i

num_j = n//num_i
ans = (num_i-1)+(num_j-1)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
num_i = 0

for i in range(1,int(math.sqrt(n))):
    if n%i == 0:
        num_i = i

num_j = n//num_i
ans = (num_i-1)+(num_j-1)

print(ans)
Problem p03221 (python)

Fixed submission:
n, m = map(int, input().split())
py = []
mli = [0]*n
li = [""]*m

for i in range(m):
    p,y = map(int, input().split())
    py.append([p,y,i])

py.sort(key=lambda x: x[1])

for p,y,i in py:
    mli[p-1] += 1
    pi = str(p).zfill(6)
    yi = str(mli[p-1]).zfill(6)
    li[i] = pi+yi

for i in li:
    print(i)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
py = []
mli = [0]*m
li = [""]*m

for i in range(m):
    p,y = map(int, input().split())
    py.append([p,y,i])

py.sort(key=lambda x: x[1])

for p,y,i in py:
    mli[p-1] += 1
    pi = str(p).zfill(6)
    yi = str(mli[p-1]).zfill(6)
    li[i] = pi+yi

for i in li:
    print(i)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
py = []
mli = [0]*m
li = [""]*m

for i in range(m):
    p,y = map(int, input().split())
    py.append([p,y,i])

py.sort(key=lambda x: x[1])

for p,y,i in py:
    mli[p-1] += 1
    pi = '{0:06d}'.format(p)
    yi = '{0:06d}'.format(mli[p-1])
    li[i] = str(pi)+str(yi)

for i in li:
    print(i)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
py = []
mli = [0]*m
li = [""]*m

for i in range(m):
    p,y = map(int, input().split())
    py.append([p,y,i])

py.sort(key=lambda x: x[1])

for p,y,i in py:
    mli[p] += 1
    pi = '{0:06d}'.format(p)
    yi = '{0:06d}'.format(mli[p])
    li[i] = str(pi)+str(yi)

for i in li:
    print(i)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
py = []
mli = [0]*m
li = [""]*m

for i in range(m):
    p,y = map(int, input().split())
    py.append([p,y,i])

py.sort(key=lambda x: x[1])

for p,y,i in py:
    mli[p] += 1
    pi = '{0:05d}'.format(p)
    yi = '{0:05d}'.format(mli[p])
    li[i] = str(pi)+str(yi)

for i in li:
    print(i)
Problem p03803 (python)

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

if a==1:
    a+=13

if b==1:
    b+=13

if a>b:
    print('Alice')
elif a<b:
    print('Bob')
else:
    print('Draw')

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

if a>b:
    print(Alice)
elif a<b:
    print(Bob)
else:
    print(Drow)
Problem p02580 (python)

Fixed submission:
import sys


H, W, M = map(int, input().split())
bomb = [tuple(map(lambda x: int(x) - 1, s.split())) for s in sys.stdin.readlines()]
X = [0] * H  # X:各行の爆破対象の個数
Y = [0] * W  # Y:各列の爆破対象の個数
for h, w in bomb:
    X[h] += 1
    Y[w] += 1
maxX = max(X)
maxY = max(Y)

R = [h for h, x in enumerate(X) if x == maxX]  # R:爆破対象の数が最大となる行の番号
C = [w for w, y in enumerate(Y) if y == maxY]  # C:爆破対象の数が最大となる列の番号

bomb = set(bomb)
for r in R:
    for c in C:
        # (r, c)に爆破対象が存在しないとき, maxX + maxY が答えとなることが確定するため, 
        # 即座に探索を終了する.
        if (r, c) not in bomb:
            print(maxX + maxY)
            exit()
print(maxX + maxY - 1)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
from collections import defaultdict

H, W,M = map(int, input().split())
h = [0] * M
w = [0] * M
mine = [[0] * W for i in range(H)]
for i in range(M):
    x, y = map(int, input().split())
    w[x-1] += 1
    h[y-1] += 1
    mine[x-1][y-1] = 1

w_max = max(w)
h_max = max(h)

w_list = []
h_list = []
for i in range(M):
    if w[i] == w_max:
        w_list.append(i)
    if h[i] == h_max:
        h_list.append(i)

for y in h_list:
    for x in w_list:
        if mine[y][x] == 0:
            print(w_max + h_max)
            sys.exit()

print(w_max+h_max-1)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
from collections import defaultdict

H, W,M = map(int, input().split())
h = [0] * M
w = [0] * M
for i in range(M):
    x, y = map(int, input().split())
    w[x-1] += 1
    h[y-1] += 1

w_max = max(w)
h_max = max(h)

print(w_max+h_max-1)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
from collections import defaultdict

H, W,M = map(int, input().split())
h = [0] * M
w = [0] * M
mine = 
for i in range(M):
    x, y = map(int, input().split())
    w[x-1] += 1
    h[y-1] += 1

w_max = max(w)
h_max = max(h)

print(w_max+h_max-1)
Problem p03013 (python)

Fixed submission:
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

j = 0
sum = []

for i in range(N+1):
    if j < M and i == A[j]:
        sum.append(0)
        if j < M-1:
            j += 1
    elif i == 0 or i == 1:
        sum.append(1)
    else:
        sum.append(sum[i-2] + sum[i-1])


print(sum[N]%1000000007)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

j = 0
sum = []

for i in range(N+1):
    if i == A[j]:
        sum.append(0)
        if j < M-1:
            j += 1
    elif i == 0 or i == 1:
        sum.append(1)
    else:
        sum.append(sum[i-2] + sum[i-1])


print(sum[N]%1000000007)

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

j = 0
sum = []

for i in range(N+1):
    if i == A[j]:
        sum.append(0)
        if j < M-1:
            j += 1
            continue
    elif i == 0 or i == 1:
        sum.append(1)
    else:
        sum.append(sum[i-2] + sum[i-1])


print(sum[N]%1000000007)

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

j = 0
sum = []

for i in range(N+1):
    if i == A[j]:
        sum.append(0)
        if j < M-1:
            j += 1
    elif i == 0 or i == 1:
        sum.append(1)
    else:
        sum.append(sum[i-2] + sum[i-1])


print(sum[N]%1000000007)

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

j = 0
sum = []

for i in range(M+1):
    if i == A[j]:
        sum.append(0)
        if j < M-1:
            j += 1
    elif i == 0 or i == 1:
        sum.append(1)
    else:
        sum.append(sum[i-2] + sum[i-1])


print(sum[N]%1000000007)

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

j = 0
sum = []

for i in range(N+1):
    if i == A[j]:
        sum.append(0)
        if j < M-1:
            j += 1
    elif i == 0 or i == 1:
        sum.append(1)
    else:
        sum.append(sum[i-2] + sum[i-1])


print(sum[N]%1000000007)
Problem p03038 (python)

Fixed submission:
from collections import deque
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [[0] * 2 for i in range(M)]
for i in range(M):
    BC[i][0],BC[i][1] = map(int, input().split())

A.sort()
BC = sorted(BC, key=lambda x:x[1],reverse=True)

k = 0
for i in range(M):
    for j in range(BC[i][0]):
        
        if k >= N:
            print(sum(A))
            sys.exit()
        
        if A[k] < BC[i][1]:
            A[k] = BC[i][1]
            k += 1
        else:
            print(sum(A))
            sys.exit()

print(sum(A))

Buggy submission (verdict: Runtime Error):
from collections import deque

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [[0] * 2 for i in range(M)]
for i in range(M):
    BC[i][0],BC[i][1] = map(int, input().split())

A.sort()
BC = sorted(BC, key=lambda x:x[1],reverse=True)
flag = False

k = 0
for i in range(M):
    for j in range(BC[i][0]):
        if A[k] < BC[i][1]:
            A[k] = BC[i][1]
            k += 1
        else:
            print(sum(A))
            flag = True
            break
    if flag == True:
        break

print(sum(A))

Buggy submission (verdict: Runtime Error):
from collections import deque
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [[0] * 2 for i in range(M)]
for i in range(M):
    BC[i][0],BC[i][1] = map(int, input().split())

A.sort()
BC = sorted(BC, key=lambda x:x[1],reverse=True)

k = 0
for i in range(M):
    for j in range(BC[i][0]):
        if A[k] < BC[i][1]:
            A[k] = BC[i][1]
            k += 1
        else:
            print(sum(A))
            sys.exit()

print(sum(A))
Problem p03805 (python)

Fixed submission:
import itertools

N, M = map(int, input().split())
graph = [[0] * N for i in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    graph[a-1][b-1] = 1
    graph[b-1][a-1] = 1

p = list(itertools.permutations(range(N)))

Sum = 0

for i in range(len(p)):
    if p[i][0] != 0:
        break
    for j in range(N - 1):
        if graph[p[i][j]][p[i][j + 1]] != 1:
            break
        elif j == N - 2:
            Sum += 1

print(Sum)

Buggy submission (verdict: Runtime Error):
import itertools

N, M = map(int, input().split())
graph = [[0] * N for i in range(N)]
for i in range(N):
    a, b = map(int, input().split())
    graph[a-1][b-1] = 1
    graph[b-1][a-1] = 1

p = list(itertools.permutations(range(N)))

Sum = 0

for i in range(len(p)):
    if p[i][0] != 0:
        break
    for j in range(N - 1):
        if graph[p[i][j]][p[i][j + 1]] != 1:
            break
        if j == N - 2:
            Sum += 1

print(Sum)
Problem p02570 (python)

Fixed submission:
d,t,s = map(int,input().split())
if (t * s) >= d :
    print("Yes")
else :
    print("No")

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

mod = 10 ** 9 + 7
total = 0
y = sum(list1)

for i in range(0,n-1):
    x = y- sum(list1[:i+1])
    total += list1[i] * x % mod

total = total % mod
print(total)
Problem p02594 (python)

Fixed submission:
x = int(input())

if x >= 30 :
  print("Yes")
 

else: 
  print("No")

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

p = [list(map(int,input().split())) for i in range(n)]

kyori = d * d
count = 0

for s in range(n):
  nagasa = p[s][0] * p[s][0] + p[s][1] * p[s][1]
  if nagasa <= kyori:
    count += 1
    
print(count)
Problem p02595 (python)

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

p = [list(map(int,input().split())) for i in range(n)]

kyori = d * d
count = 0

for s in range(n):
  nagasa = p[s][0] * p[s][0] + p[s][1] * p[s][1]
  if nagasa <= kyori:
    count += 1
    
print(count)

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

p = [list(map(int,input().split())) for i in range n]

kyori = d * d
count = 0

for s in range(n):
  nagasa = p[s][0] * p[s][0] + p[s][1] * p[s][1]
  if nagasa <= kyori:
    count += 1
    
print(count)
Problem p02676 (python)

Fixed submission:
k = int(input())
s = input()
x = len(s)
if x <= k :
  print(s)
else:
  print(s[0:k] + "...")

Buggy submission (verdict: Runtime Error):
k = int(input())
s = inpur()
x = len(s)

if k >= x:
  print(s)

else:
  print(s + "...")

Buggy submission (verdict: Runtime Error):
k = int(input())
s = inpur()
x = len(s)

if k >= s:
  print(s)

else:
  print(s + "...")
Problem p02725 (python)

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

Ai = list(map(int,input().split()))
kyori = []

for x in range(n-1):
  kyori.append(Ai[x+1]-Ai[x])
  
kyori.append(Ai[0]+k-Ai[n-1])

kyori.remove(max(kyori))

print(sum(kyori))

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

Ai = list(map(int,input().split()))
kyori = []

for x in range(n-1):
  kyori.append(Ai[x+1]-Ai[x])
  
kyori.append(Ai[0]+k-Ai[n-1])

kyoto.remove(max(kyori))

print(sum(kyori))
Problem p02779 (python)

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

for x in range(n-1):
  if an[x+1]-an[x] == 0:
    print("NO")
    break

else:
  print("YES")

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

for x in range(n-1):
  if an[i+1]-an[i] == 0:
    print("NO")
    break

else:
  print("YES")
Problem p02785 (python)

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

enemy.sort(reverse=True)

if k >= n :
  print(0)

else:
  

  for x in range(k):
    enemy[x] = 0
  
  print(sum(enemy))

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

enemy.sort(reverse=True)

for x in range(k):
  enemy[x] = 0
  
print(sum(enemy))
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
elif s[:n//2] == s[n//2:] :
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
elif s[:n/2] == s[n/2:] :
  print("Yes")
else:
  print("No")
Problem p02933 (python)

Fixed submission:
n = int(input())
a = input()
print(a if n >= 3200 else "red")

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

for x in a :
  b.append(1/x)
  
c = sum(b)
ans = 1/c
print(ans)
Problem p02570 (python)

Fixed submission:
d,t,s=map(int,input().split())

if d/s > t:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
d,t,s=map(int,input().split())

if d//s > t:
  print('No')
else:
  print('Yes'
Problem p02596 (python)

Fixed submission:
import sys
k=int(input())
l=[]
x=7%k
if x == 0:
  print(1)
  sys.exit()
for i in range(2,k+1):
  num=(x*10+7)%k
  x=num
  l.append(num)
  if num==0:
    print(i)
    break
if 0 not in l:
  print(-1)

Buggy submission (verdict: Runtime Error):
k=int(input())
l=[]
x=7%k
if x == 0:
  print(1)
  break
for i in range(2,k+1):
  x=7%k
  num=(x*10+7)%k
  x=num
  l.append(num)
  if num==0:
    print(i)
    break
if 0 not in l:
  print(-1)

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

l=[]
for i in range(1,k+1):
  x=7%k
  num=(x*10+7)%k
  x=num
  l.append(num)
  if num==0:
  	print(i)
    break
if 0 not in l:
  print(-1)

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

l=[]
for i in range(1,k+1):
  x=7%k
  num=(x*10+7)%k
  x=num
  l.append(num)
  if num==0:
  	print(i)
    break
  if 0 not in l:
    print(-1)
Problem p02622 (python)

Fixed submission:
S=input()  
T=input()
num = 0
for i in range(len(S)):
	if S[i] != T[i]:
		num= num+1
print(num)

Buggy submission (verdict: Runtime Error):
    a=list(input())
    b=list(input())
    count=0
    for str_i in range (len(a)):
      if a[str_i:] != b[str_i:]:
        count+=1
    print(count)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
count=0
for str_i in range (len(a)):
	if a[str_i:] != b[str_i:]:
		count+=1
    print(count)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
count=0
for str_i in range (len(a)):
  if a[str_i] != b[str_i]:
	count+=1
print(count)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
count=0
for str_i in range (len(a)):
	if a[str_i] != b[str_i]:
      count+=1
print(count)

Buggy submission (verdict: Runtime Error):
S=string(input())
T=string(input())
num = 0
for i in range(len(S)):
    if S[i] != T[i]:
        num= num+1
print(num)

Buggy submission (verdict: Runtime Error):
S=string(input())
T=string(input())
num = 0
for i in len(S):
  if S[i] != T[i]:
    num= num+1
print(num)
Problem p02676 (python)

Fixed submission:
s=int(input())
k=input()
if len(k) <=s:
  print(k)
else:
  print(k[:s] + '...')

Buggy submission (verdict: Runtime Error):
s=int(input())
k=input()
if len(s) <=k:
  print(s)
else:
  print(s[:k] + '...')

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
if len(s) <=k:
  print(s)
else:
  print(s[:k] + '...')