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

Fixed submission:
n,k = map(int, input().split())
h = list(map(int, input().split()))
count = 0
for i in range(n):
  if h[i] >= k:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
h = list(map(int, input().split()))
count = 0
for i in range(n):
  if h[n] >= k:
    count += 1
print(count)
Problem p02899 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans)):
       print(ans[j] , end = " ")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans):
       print(ans[j] , end = " ")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0 for in range(n)]
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans):
       print(ans[j] , end = " ")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0 for in range(n)]
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans):
       print(ans[i] , end = " ")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0 for in range(n)
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans):
       print(ans[i] , end = " ")
Problem p02945 (python)

Fixed submission:
a, b = map(int, input().split())
num = []
num.append(a+b)
num.append(a-b)
num.append(a*b)
print(max(num))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
l = []
l.append(a+b)
l.append(a-b)
l.append(a*b)
print(max(a))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
l = []
l.append(a+b)
l.append(a-b)
l.appned(a*b)
print(max(a))
Problem p02969 (python)

Fixed submission:
r = int(input())
menseki = 3 * r ** 2
print(menseki)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [0 for n in range(n)]
for i in range(n):
  a[i] = int(input())
a_max = max(a)
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    a.sort()
    a.reverse()
    print(a[1])
Problem p03399 (python)

Fixed submission:
l =[]
s = []
for i in range(4):
  l.append(int(input()))
if l[0] <= l[1]:
  s.append(l[0])
else:
  s.append(l[1])
if l[2] <= l[3]:
  s.append(l[2])
else:
  s.append(l[3])
print(sum(s))

Buggy submission (verdict: Runtime Error):
l =[]
s = []
for i in range(4):
  l.appned(int(input()))
if l[0] <= l[1]:
  s.appned(l[0])
else:
  s.append(l[1])
if l[2] <= l[3]:
  s.appned(l[2])
else:
  s.appned(l[3])
print(sum(s))
Problem p03469 (python)

Fixed submission:
s = list(input())
s[3] = "8"
x = ""
for i in range(len(s)):
  x += s[i]
print(x)

Buggy submission (verdict: Runtime Error):
s = input()
s[3] = "8"
print(s)
Problem p03694 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input()split())
print(max(a)-min(a))
Problem p03711 (python)

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

Buggy submission (verdict: Runtime Error):
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
x,y = map(int, input().split())
if (x in a and y in a) or (x in b and y in b):
Problem p03773 (python)

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

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

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

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

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
h = int(input())
print((a+B)*h//2)
Problem p03486 (python)

Fixed submission:
s = input()
t = input()
s = list(s)
s.sort()
t = list(t)
t.sort(reverse = True)
if t>s:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s, t = input().split()
s = list(s)
s.sort()
t = list(t)
t.sort(reverse = True)
if t>s:
    print('Yes')
else:
    print('No')
Problem p02630 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
q = int(input())
num = [0] * 100010
b = [0] * q
c = [0] * q
for i in range(q):
    b[i], c[i] = map(int, input().split())

for i in a:
    num[i] += 1

s = sum(a)

for i in range(q):
    s += (c[i]-b[i])*num[b[i]]
    num[c[i]] += num[b[i]]
    num[b[i]] = 0
    print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
LIST = [0]*(10001)
Q = int(input())


b =[0]*Q
c =[0]*Q
for i in range(Q):
    b[i], c[i] = map(int, input().split())

for i in A:
    LIST[i]+=1

s = sum(A)

for i in range(Q):
    s += LIST[b[i]]*(c[i]-b[i])
    LIST[c[i]]+=LIST[b[i]]
    LIST[b[i]] = 0
    print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
LIST = [0]*(10001)
Q = int(input())


b =[0]*Q
c =[0]*Q
for i in range(Q):
    b[i], c[i] = map(int, input().split())

for i in A:
    LIST[i]+=1

s = sum(A)

for i in range(Q):
    LIST[c[i]]+=LIST[b[i]]
    s += LIST[b[i]]*(c[i]-b[i])
    LIST[b[i]] = 0
    print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
LIST = [0]*(10001)
sum = sum(A)
for i in A:
    LIST[i]+=1
Q = int(input())
b =[0]*Q
c =[0]*Q
for i in range(Q):
    b[i], c[i] = map(int, input().split())
for i in range(Q):
    LIST[c[i]]+=LIST[b[i]]
    sum+=LIST[b[i]]*(c[i]-b[i])
    LIST[b[i]]= 0
    print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
LIST = [0]*(10001)
sum = sum(A)
for i in A:
    LIST[i]+=1
Q = int(input())
b =[]
c =[]
for _ in range(Q):
    bs, cs = map(int, input().split())
    b.append(bs)
    c.append(cs)
for i in range(Q):
    LIST[c[i]]+=LIST[b[i]]
    sum+=LIST[b[i]]*(c[i]-b[i])
    LIST[b[i]]= 0
    print(sum)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
LIST = [0]*(10000+1)
for i in A:
    LIST[i]+=1

sum = sum(A)
for _ in range(Q):
    b, c = map(int, input().split())
    LIST[c]+=LIST[b]
    sum+=LIST[b]*(c-b)
    LIST[b]= 0
    print(sum)
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
S = []
C = []
for i in range(M):
    s, c = map(int, input().split())
    S.append(s)
    C.append(c)

for i in range(10000):
    tmp = str(i)
    if len(tmp)!=N:
        continue
    flag = True
    for j in range(M):
        if int(tmp[S[j] - 1]) != C[j]:
            flag = False
    if flag == True:
        print(tmp)
        exit()
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
ans = [-1]*N
for i in range(M):
    s,m =map(int, input().split())
    if ans[s-1]!=m and ans[s-1]!=-1:
        print(-1)
        exit()
    ans[s-1]=m
if ans[0]==0:
    print(-1)
    exit()
if ans[0]==-1 and ans[1]==0:
    ans[0]=1
for i in range(N):
    if ans[i]==-1:
        ans[i]=0
Ans = [str(a) for a in ans]
print(''.join(Ans))
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(max(0,a-2*b))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
s = a-2*b
if(s >= 0):
    print(s)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
s = a-2*b
if(s > 0):
    print(s)
else:
    print(0)
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())
ans = 2019
if R - L >= 2019:
    print(0)
else:
    for i in range(L, R + 1):
        for j in range(i + 1, R + 1):
            ans = min(ans, (i * j) % 2019)
    print(ans)

Buggy submission (verdict: Runtime Error):
import math
N, D = map(int, input().split())
x = [list(map(int,input().split())) for i in range(N)]
tmp = 0
ans = 0
for i in range(N):
    for j in range(i + 1,N):
        for d in range(D):
            tmp += (x[i][d] - x[j][d])**2
        tmp = math.sqrt(tmp)
        if tmp.is_integer():
            ans += 1
        tmp = 0
print(ans)
Problem p02713 (python)

Fixed submission:
from functools import reduce
import functools
import fractions
 
@functools.lru_cache(maxsize=None)
def gcd(*numbers):
  return reduce(gcd_, numbers)

@functools.lru_cache(maxsize=None)
def gcd_(a, b):
  if (b == 0):
    return a
  return gcd(b, a % b)
 
sum = 0
K = int(input())
 
for i in range(1,K+1):
  for j in range(i,K+1):
    for k in range(j,K+1):
      if (i == j) & (j == k):
        sum += gcd(i,j,k)
      elif (i == j) & (j != k):
        sum += gcd(i,j,k)*3
      elif (i != j) & (j == k):
        sum += gcd(i,j,k)*3
      elif (i != j) & (j != k):
        sum += gcd(i,j,k)*6

print(sum)

Buggy submission (verdict: Runtime Error):
from functools import reduce
import fractions

def gcd(*numbers):
	return reduce(fractions.gcd, numbers)

sum = 0
K = int(input())

for i in range(K):
  for j in range(K):
    for k in rage(K):
      sum += gcd(i,j,k)
      
print(sum)
Problem p02714 (python)

Fixed submission:
n = int(input())
s = input()

arr = []
R = len(list(filter(lambda x:x == 'R', s)))
G = len(list(filter(lambda x:x == 'G', s)))
B = len(list(filter(lambda x:x == 'B', s)))
tot = R*G*B

for i in range(n):
  for j in range(i+1, n):
    k = 2*j-i
    if k >= n:
      continue
    if (s[i] != s[j]) and (s[i] != s[k]) and (s[j] != s[k]):
      tot -= 1

print(tot)

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

arr = []
R = len(list(filter(lambda x:x == 'R', s)))
G = len(list(filter(lambda x:x == 'G', s)))
B = len(list(filter(lambda x:x == 'B', s)))
tot = R*G*B

for i in range(n):
  for j in range(i+1, n):
    k = 2*j-i
    if k > n:
      continue
    if (s[i] != s[j]) & (s[i] != s[k]) & (s[j] != s[k]):
      tot -= 1

print(tot)
Problem p02719 (python)

Fixed submission:
n,m = map(int,input().split())
div = n//m
minval = div*m
maxval = (div+1)*m
print(min(abs(minval-n),abs(maxval-n)))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a=map(int,input().split())
a=sorted(a)
if a[-m] >= sum(a)/4/m:
    print("Yes")
else:
    print("No")
Problem p02730 (python)

Fixed submission:
s = list(input())
n = len(s)

def kaibun(st):
  sta = list()
  for k in range(len(st)//2):
    sta.append(st[k])
  for k in range(len(st)//2):
    if st[-(-len(st)//2)+k] != sta.pop():
      return False
  return True

if kaibun(s) == False:
  print('No')
elif kaibun(s[:(n-1)//2]) == False:
  print('No')
elif kaibun(s[(n+3)//2-1:]) == False:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
s = list(input())
n = len(s)

def kaibun(st):
  sta = list()
  for k in range(len(st)//2):
    sta.append(st[k])
  for k in range(len(st)//2):
    if st[-(-len(st)//2)+k] != sta.pop():
      return False
  return True

if kaibun(s) == False:
  print('No')
elif kaibun(s[:(n-1)//2]) == No:
  print('No')
elif kaibun(s[(n+3)//2-1:]) == No:
  print('No')
else:
  print('Yes')
Problem p02731 (python)

Fixed submission:
print((int(input())/3)**3)

Buggy submission (verdict: Runtime Error):
print(((int(input())/3)**3)

Buggy submission (verdict: Runtime Error):
print((int(input())**3)
Problem p02761 (python)

Fixed submission:
N,M = map(int,input().split())
sc = [list(map(int, input().split())) for _ in range(M)]
dic = {}
if sc == [] and N == 1:
  print(0)
  exit()
if sc == [[1,0]] and N == 1:
  print(0)
  exit()
for k in sc:
  if k[0] in dic:
    if dic[k[0]] != k[1]:
      print(-1)
      exit()
  else:
    dic[k[0]] = k[1]
ans = 0
if 1 in dic and dic[1] == 0:
  print(-1)
  exit()
for k in dic:
  ans += 10**(N-k) * dic[k]
if ans < 10**(N-1):
  ans += 10**(N-1)
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
sc = [list(map(int, input().split())) for _ in range(M)]
dic = {}
for k in sc:
  if k[0] in dic:
    if dic[k[0]] != k[1]:
      print(-1)
      exit()
  else:
    dic[k[0]] = k[1]
ans = 0
if dic[1] == 0:
  print(-1)
  exit()
for k in dic:
  ans += 10**(N-k) * dic[k]
if ans < 10**(N-1):
  ans += 10**(N-1)
print(ans)
Problem p02784 (python)

Fixed submission:
H,N = map(int, input().split())
A = list(map(int, input().split()))
if sum(A) >= H:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
H,N = map(int, input().split())
A = list(map(input().split()))
if sum(A) >= H:
  print('Yes')
else:
  print('No')
Problem p02830 (python)

Fixed submission:
N = int(input())
S,T = input().split()
S = list(S)
T = list(T)
ans = []
for s,t in zip(S,T):
  ans.append(s)
  ans.append(t)
print(''.join(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
S,T = input().split()
S = list(S)
T = list(T)
ans = []
for s,t in S,T:
  ans.append(s)
  ans.append(t)
print(''.join(ans))
Problem p02900 (python)

Fixed submission:
import numpy as np


a,b = map(int,input().split())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

lisa = prime_factorize(a)
lisb = prime_factorize(b)
lis = set(lisa) & set(lisb)
lis.add(1)
lis = sorted(list(lis))
devil = (max(a,b)/lis[-1])
if len(prime_factorize(devil)) == 1:
  if min(a,b) % devil == 0:
    lis.append(devil)
print(len(set(lis)))

Buggy submission (verdict: Runtime Error):
import numpy as np
import math

a,b = map(int,input().split())
def cf(x1,x2):
    cf = []
    for i in range(1,int(np.sqrt(max(x1,x2))+2)):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

def prime(num):
  for p in range(2, int(np.sqrt(num)+2)):
    if num % p == 0:
      return False
  return True

lis = cf(a,b)
for k,l in enumerate(lis):
  if prime(l) == False:
    lis[k] = -1
s = set(lis) - set([-1])
s.add(math.gcd(a,b))
print(len(s))
Problem p03136 (python)

Fixed submission:
import numpy as np


N = int(input())
L = list(map(int, input().split()))
maxL = max(L)
argmaxL = np.argmax(L)
L.pop(argmaxL)
if maxL < sum(L):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
maxL = max(L)
L.pop(maxL)
if maxL > sum(L):
  print('Yes')
else:
  print('No')
Problem p02854 (python)

Fixed submission:
import math

def solve():
    N = int(input())
    A = [int(i) for i in input().split()]
    S = sum(A)
    l = A[0]
    I = 0
    m = math.ceil(S / 2)
    for i in range(1, N):
        if (l + A[i]) <= m:
            l += A[i]
        else:
            I = i - 1
            break
    if l == S / 2:
        print(0)
        exit()
    c = A[I + 1]
    r = S - l - c
    ans1 = abs(r - (l + c))
    ans2 = abs(l - (r + c))
    print(min(ans1, ans2))

if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
def solve():
    N = int(input())
    A = [int(i) for i in input().split()]
    S = sum(A)
    l = A[0]
    I = 0
    for i in range(1, N):
        if l + A[i] < S / 2:
            l += A[i]
            I = i
    if l == S / 2:
        print(0)
        exit()
    c = A[I + 1]
    r = S - l - c
    ans1 = abs(r - (l + c))
    ans2 = abs(l - (r + c))
    print(min(ans1, ans2))

if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
def solve():
    N = int(input())
    A = [int(i) for i in input().split()]
    S = sum(A)
    l = A[0]
    I = 0
    for i in range(1, N):
        if l + A[i] <= S / 2:
            l += A[i]
            I = i
    if l == S / 2:
        print(0)
        exit()
    c = A[I + 1]
    r = S - l - c
    ans1 = abs(r - (l + c))
    ans2 = abs(l - (r + c))
    print(min(ans1, ans2))

if __name__ == "__main__":
    solve()
Problem p02687 (python)

Fixed submission:
s = input()

if s == 'ABC':
    print('ARC')
else:
    print('ABC')

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

for d in range(1, int(x**0.5)+1):
    if x % d == 0:
        for a in range(1,d+1):
            b = a - d
            if a**5 - b**5 == x:
                print(a, b)
                exit()
Problem p02761 (python)

Fixed submission:
n, m = map(int, input().split())
tmp = [10]*n

for _ in range(m):
    s,c = map(int, input().split())
    if tmp[s-1] == 10 or tmp[s-1]==c:
        tmp[s-1] = c
    else:
        print('-1')
        exit()

for i in range(n):
    if tmp[i] == 10:
        if i == 0 and n != 1:
            tmp[i] = 1
        else:
            tmp[i] = 0

ans = ''.join(map(str,tmp))

if n != 1 and ans[0] == '0':
    print('-1')
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
tmp = [10]*n

for _ in range(m):
    s,c = map(int, input().split())
    tmp[s-1] = min(tmp[s-1],c)
for i in range(n):
    if tmp[i] == 10:
        tmp[i] = 0

ans = ''.join(map(str,tmp))
if ans[0] == '0':
    print('-1')
else:
    print(num)
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()
print('A' if b == 'T')

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

Fixed submission:
def main():
    n, k, *h = map(int, open(0).read().split())
    dp = [float('inf')] * n
    dp[0] = 0
    for i in range(1, n):
        min_i = max(0, i-k)
        dp[i] = min([dp[j] + abs(h[i] - h[j]) for j in range(min_i, i)])
    print(dp[n-1])
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
n, k, *h = map(int, open(0).read().split())
dp = [math.inf] * n
dp[0] = 0
for i in range(1, n):
    for j in range(max(0, i-k), i):
        dp[i] = min(dp[j] + abs(h[i] - h[j]), dp[i])
print(dp[n-1])
Problem p03244 (python)

Fixed submission:
from collections import Counter

n, *v = map(int, open(0).read().split())
vo = Counter(v[::2])
ve = Counter(v[1::2])
vo_mc = vo.most_common()[0]
ve_mc = ve.most_common()[0]
if vo_mc[0] == ve_mc[0]:
    if vo_mc[1] > ve_mc[1]:
        ans = n//2 - vo_mc[1]
        if ve_mc[1] != n//2:
            ans += n//2 - ve.most_common()[1][1]
        else:
            ans += n//2
    elif vo_mc[1] < ve_mc[1]:
        ans =  n//2 - ve_mc[1]
        if vo_mc[1] != n//2:
            ans += n//2 - vo.most_common()[1][1]
        else:
            ans += n//2
    else:
        ans = n
        if ve_mc[1] != n//2:
            ans = min(n//2 - vo_mc[1] + n//2 - ve.most_common()[1][1], ans)
        if vo_mc[1] != n//2:
            ans = min(n//2 - vo.most_common()[1][1] + n//2 - ve_mc[1], ans)
        ans = min(n//2 - vo_mc[1] + n//2, ans)
else:
    ans = n//2 - vo_mc[1] + n//2 - ve_mc[1]
print(ans)

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

n, *v = map(int, open(0).read().split())
vo = Counter(v[::2])
ve = Counter(v[1::2])
vo_mc = vo.most_common()[0]
ve_mc = ve.most_common()[0]
if vo_mc[0] == ve_mc[0]: 
    if vo_mc[1] > ve_mc[1]:
        ans = n//2 - vo_mc[1]
        if ve_mc[1] != n//2:
            ans += n//2 - ve.most_common()[1][1]
        else:
            ans += n//2
    elif vo_mc[1] < ve_mc[1]:
        ans =  n//2 - ve_mc[1]
        if vo_mc[1] != n//2:
            ans += n//2 - vo.most_common()[1][1]
        else:
            ans += n//2
else:
    ans = n//2 - vo_mc[1] + n//2 - ve_mc[1]
print(ans)
Problem p03262 (python)

Fixed submission:
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

n, *spot = map(int, open(0).read().split())
spot.sort()
dist = set([spot[i+1]-spot[i] for i in range(n)])
print(gcd_list(dist))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n, *spot = map(int, open(0).read().split())
spot.sort()
dist = set([spot[i+1]-spot[i] for i in range(n)])
print(gcd_list(dist))
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())
for i in range(k):
    if s[i] != "1":
        break
print(s[i])

Buggy submission (verdict: Runtime Error):
s=str(input())
n = int(input())
for i in range(n):
    if s[i] != "1":
        print(int(s[i]))
        break
	else:
    	print("1")
Problem p03323 (python)

Fixed submission:
a,b = map(int, input().split())
ans=':('
if a<=8 and b<=8:
  ans = 'Yay!'
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
ans=′Yay!′
if a>=9 or b>=9:
  ans=′:(′
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
ans=′Yay!′
if a>9 or b>9:
  ans=′:(′
print(ans)
Problem p03361 (python)

Fixed submission:
h, w = map(int, input().split())
masu = ['.'*(w+2)]
masu += ['.' + input() + '.' for _ in range(h)]
masu.append('.'*(w+2))
ans = 'Yes'
for i in range(1,h+1):
    for j in range(1,w+1):
        if masu[i][j] == '#':
            if masu[i+1][j] == '#' or masu[i-1][j] == '#' or masu[i][j+1] == '#' or masu[i][j-1] == '#':
                continue
            else:
                ans = 'No'
                break
print(ans)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
masu = ['.'*(w+2)]
masu += ['.' + input() + '.' for _ in range(w)]
masu.append('.'*(w+2))
ans = 'Yes'
for i in range(1,h+1):
    for j in range(1,w+1):
        if masu[i][j] == '#':
            if masu[i+1][j] == '#' or masu[i-1][j] == '#' or masu[i][j+1] == '#' or masu[i][j-1] == '#':
                continue
            else:
                ans = 'No'
                break
print(ans)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
masu = ['.'*(w+2)]
masu += ['.' + input() + '.' for _ in range(w)]
masu.append('.'*(w+2))
ans = 'Yes'
for i in range(1,h):
    for j in range(1,w):
        if masu[i][j] == '#':
            if masu[i+1][j] == '#' or masu[i-1][j] == '#' or masu[i][j+1] == '#' or masu[i][j-1] == '#':
                continue
            else:
                ans = 'No'
                break
print(ans)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
masu = ['.'*(w+2)]
masu += ['.' + input() + '.' for _ in range(w)]
masu.append('.'*(w+2))
ans = 'Yes'
for i in range(1,h-1):
    for j in range(1,w-1):
        if masu[i][j] == '#':
            if masu[i+1][j] == '#' or masu[i-1][j] == '#' or masu[i][j+1] == '#' or masu[i][j-1] == '#':
                continue
            else:
                ans = 'No'
                break
print(ans)