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

Fixed submission:
s = str(input())
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
_in = list(map(int, input().split()))
k = _in[0]
n = _in[1]
p = 0
_i = list(map(int, input().split()))
dis = 0
mdis = k - _i[n-1] + _i[0]
for i in range(0,n-2):
    dis = _i[i+1]- _i[i]
    if dis>mdis:
        mdis = dis
print(k-mdis)

Buggy submission (verdict: Runtime Error):
_in = list(map(int, input().split()))
k = _in[0]
n = _in[1]
p = 0
_i = list(map(int, input().split()))
dis = 0
mdis = k - _i[n-1] + _i[0]
for i in range(1,n-2):
    dis = _i[i+1]- _i[i]
    if dis>=mdis:
        mdis = dis
print(k-mdis)

Buggy submission (verdict: Runtime Error):
s = str(input())
if s[3]==s[4] && s[5]==s[6]:
    pritn("Yes")
else:
    print("No")
Problem p02771 (python)

Fixed submission:
a,b,c=input().split()
 
if a==b==c:
  print("No")
elif a==b!=c:
  print("Yes")
elif a==c!=b:
  print("Yes")
elif a!=b==c:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
i=list(map(int,input().split()))
a=0
for x in range(N):
    if i[x]%2==0:
        if i[x]%3!=0:
            if i[x]%5!=0:
                x+=1
if a==0:
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
N=int(input())
i=list(map(int,input().split()))
x=0
for x in range(N):
  if x%2==0:
    if x%3!=0:
      if x%5!=0:
        x+=1
if x==0:
  print("APPROVED")
else:
  print("DENIED")

Buggy submission (verdict: Runtime Error):
N=int(input())
i=list(map(int,input().split()))
x=0
for x in range(N):
  if x%2==0:
    if x%3!=0:
      if x%5!=0:
        x+=1
if x==0:
  return "APPROVED"
else:
  return "DENIED"
Problem p02859 (python)

Fixed submission:
r=int(input())
print(r*r)

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
s = str(raw_input())
k=n/2
if s[0:h] == s[h:n]:
    print 'Yes'
else:
    print 'No'
Problem p02860 (python)

Fixed submission:
n = int(raw_input())
s = str(raw_input())
h=n/2
if s[0:h] == s[h:n]:
    print 'Yes'
else:
    print 'No'

Buggy submission (verdict: Runtime Error):
n=int(input())
k=n/2;
s=input()
p=s[k:]
t=s[:k]
if p=t print 'Yes' else print 'No'

Buggy submission (verdict: Runtime Error):
n=int(input())
k=n/2;
s=input()
p=s[k:]
t=s[:k]
if p=t print 'Yes' else print 'No'
Problem p03252 (python)

Fixed submission:
from collections import Counter
s = input()
t = input()

sc = Counter(s)
tc = Counter(t)

if sorted(sc.values()) == sorted(tc.values()):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = np.array(list(input()))
t = np.array(list(input()))
num = 0
for i in set(t):
  if np.sum(s==i) == np.sum(t==i):
    num += 1
    continue
  if len(set(s[t==i])) == 1:
    num += 1
    continue
if num == len(set(t)):
  print("Yes")
else:
  print("No")
Problem p03013 (python)

Fixed submission:
from collections import deque
def C():
    N, M = map(int, input().split())
    A = set([int(input()) for _ in range(M)])
    dp = deque([1, 1 if 1 not in A else 0])
    MOD = 1000000007
    for i in range(2,N+1):
        #print(i, dp)
        if i in A:
            dp.append(0)
        else:
            dp.append((dp[0]+dp[1]) % MOD)
        dp.popleft()
    print(dp[-1])

C()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**5)
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
MOD = 1000000007
def Fib(n, A, MOD, memo={}):
    if n in A:
        return 0
    elif n == 0:
        return 1
    elif n == 1:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = ( Fib(n-1, A, MOD, memo) + Fib(n-2, A, MOD, memo) ) % MOD
        return memo[n]
print(Fib(N, A, MOD))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**10)
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
MOD = 1000000007
def Fib(n, A, MOD, memo={}):
    if n in A:
        return 0
    elif n == 0:
        return 1
    elif n == 1:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = ( Fib(n-1, A, MOD, memo) + Fib(n-2, A, MOD, memo) ) % MOD
        return memo[n]
print(Fib(N, A, MOD))
Problem p02596 (python)

Fixed submission:
k = int(input())
t = 7
ans=0
for i in range(k):
    if t%k==0:
        ans=i+1
        break
    else:
        t = (t*10+7)%k
        
if ans >0:
    print(ans) 
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
k = int(input())
t = 7
ans=0
for i in range(k):
  if t%k==0:
    ans=i+1
  	break
  else:
    t = (t*10+7)%k
        
if ans >0:
  print(ans) 
else:
  print(-1)
Problem p02627 (python)

Fixed submission:
from sys import stdin, stdout
read = stdin.readline
write = stdout.write
flush = stdout.flush
xr = xrange

def main():
	c = read().strip()
	if ord(c) - ord('A') <= 26: write('A\n')
	else: write('a\n')

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
from sys import stdin, stdout
read = stdin.readline
write = stdout.write
flush = stdout.flush
xr = xrange

def main():
	c = read().strip()
	if ord(c) - ord('A') <= 26: write('A\n')
	else: write('a\n')

if __name__ == "__main__":
	main()
Problem p02623 (python)

Fixed submission:
import bisect


def main():
    N, M, K = map(int, input().split())
    A = [int(v) for v in input().split()]
    B = [int(v) for v in input().split()]
    ruisekiA = [0 for _ in range(N+1)]
    ruisekiB = [0 for _ in range(M+1)]
    for i in range(N):
        ruisekiA[i + 1] = ruisekiA[i] + A[i]
    for i in range(M):
        ruisekiB[i + 1] = ruisekiB[i] + B[i]

    ans = 0
    # A を i 個 使う
    for i in range(N+1):
        tans = i
        tk = K - ruisekiA[i]
        if tk < 0:
            break
        idx = bisect.bisect_left(ruisekiB, tk)
        if M+1 == idx or ruisekiB[idx] != tk:
            idx -= 1
        tans += idx
        ans = max(ans, tans)
    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import bisect

def main():
    N, M, K = map(int, input().split())
    A = [int(v) for v in input().split()]
    B = [int(v) for v in input().split()]
    if N < M:
        for _ in range(M-N):
            A.append(0)
    else:
        for _ in range(N-M):
            B.append(0)
    C = [v1+v2 for v1, v2 in zip(A, B)]
    ruisekiA = [0 for _ in range(len(C)+1)]
    ruisekiB = [0 for _ in range(len(C)+1)]
    ruisekiC = [0 for _ in range(len(C)+1)]
    for i in range(len(C)):
        ruisekiA[i + 1] = ruisekiA[i] + A[i]
        ruisekiB[i + 1] = ruisekiB[i] + B[i]
        ruisekiC[i + 1] = ruisekiC[i] + C[i]

    ans = 0
    # i番目までは両方読む
    for i in range(len(C)+1):
        tans = i * 2
        tk = K - ruisekiC[i]
        if tk < 0:
            continue

        # A だけ、Bだけで何冊読めるか考える
        idx_a = bisect.bisect_left(ruisekiA, tk + ruisekiA[i])
        if ruisekiA[idx_a] != tk + ruisekiA[i]:
            idx_a -= 1
        idx_b = bisect.bisect_left(ruisekiB, tk + ruisekiB[i])
        if ruisekiB[idx_b] != tk + ruisekiB[i]:
            idx_b -= 1
        ans = max(ans, max(tans+idx_a-i, tans+idx_b-i))
    print(ans)


if __name__ == '__main__':
    main()
Problem p02693 (python)

Fixed submission:
k=int(input())
a,b=map(int, input().split())
ok=False
for i in range(a, b+1):
  ok = ok or (i % k == 0)
print(['NG','OK'][ok])

Buggy submission (verdict: Runtime Error):
k=int(input())
a,b=map(int, input().split())
ok=False
for i in range(a, b+1):
  ok = ok or i % k
print(['NG','OK'][ok])
Problem p02847 (python)

Fixed submission:
d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
s=input()
print(7 - d.index(s))

Buggy submission (verdict: Runtime Error):
    d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
    s=input()
    print(7 - d.index(s))

Buggy submission (verdict: Runtime Error):
d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
s=input()
print(7 - d.find(s))
Problem p02633 (python)

Fixed submission:
from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *
from sys import stdin,stdout
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
import math
import math
import time
from queue import Queue
# PradeepGhosh_2017076

def seive(n):
	l=[True]
	l=l*(n+1)
	for i in range(2,int(sqrt(n))+1):
		if(l[i]==True):
			val=i*i
			while(val<len(l)):
				l[val]=False
				val+=i
	prime=[]
	for i in range(2,len(l)):
		if(l[i]==True):
			prime.append(i)
	return prime

def dp(l,i,n,val,ans):
	if(i>=n or val<0):
		return 1000000
	elif(val==0):
		return 0
	else:
		if(ans[i]==1000000):
			ans[i]=min(min(1+dp(l,i+1,n,val-l[i],ans),1+dp(l,i,n,val-l[i],ans)),dp(l,i+1,n,val,ans))
		return ans[i]
from queue import Queue
def factors(n):
	l=[]
	for i in range(1,int(sqrt(n))+1):
		if(n%i==0):
			if(n//i==i):
				l.append(i)
			else:
				l.append(i)
				l.append(n//i)
	return l
def check1(s,v,x):
	while(True):
		if(v not in s):
			return v
		else:
			v-=1
def check2(s,v,x):
	while(True):
		if(v not in s):
			return v
		else:
			v+=1

if __name__ == '__main__':
	# l=seive(1000000)
	# s=set(l)
	# t=int(input())
	# for i in range(t):
	# 	n=int(input())
	# 	if(n==2):
	# 		print(1)
	# 	else:
	# 		if(n in s):
	# 			n=n-1
	# 		j=n-1
	# 		while(j>0):
	# 			if(n%j==0):
	# 				break
	# 			j-=1
	# 		print(j)
	x=int(input())
	c=0
	ans=0
	while(ans!=360):
		ans+=x
		if(ans>360):
			ans-=360
		c+=1
	print(c)

Buggy submission (verdict: Runtime Error):
x=int(input())
print(int(math.ceil(360/x)))
Problem p03072 (python)

Fixed submission:
n = input()
n = int(n)
l=[i for i in map(int,input().split())]
maximum=l[0]
c=0
for i in range(n):
	if(l[i]>=maximum):
		maximum=l[i]
		c=c+1
print(c)

Buggy submission (verdict: Runtime Error):
n = input()
n = int(n)
l=[]
l=input().split(" ")
maximum=l[0]
c=1
for i in range(1,n):
	if(l[i]>=maximum):
		maximum=l[i]
		c=c+1
print(c)
Problem p02711 (python)

Fixed submission:
t=input()
n=t[0]
m=t[1]
o=t[2]

if n != "7" and m != "7" and o !="7":
    print("No")
else:
    print("Yes")

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

if n != "7" and m != "7" and o !="7":
    print("No")
else:
    print("Yes")
Problem p02820 (python)

Fixed submission:
import math
n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=input()
hand=[[] for _ in range(k)]
for i in range(len(t)):
    hand[i%k].append(t[i])

def janken(str):
    if str == "r":
        return p
    elif str == "s":
        return r
    else:
        return s

counter=0

for ha in hand:
    dp=[janken(ha[0])]
    if len(ha) == 1:
        counter += dp[0]
        continue

    if ha[0]==ha[1]:
        dp.append(dp[0])
    else:
        dp.append(janken(ha[0])+janken(ha[1]))
    
    for i in range(2,len(ha)):
        if ha[i-1] != ha[i]:
            dp.append(dp[i-1]+janken(ha[i]))
        elif ha[i] != ha[i-2]:
            dp.append(dp[i-1])
        elif dp[i-2] == dp[i-1]:
            dp.append(dp[i-1]+janken(ha[i]))
        else:
            dp.append(dp[i-1])
    counter += dp[-1]
            

print(counter)

Buggy submission (verdict: Runtime Error):
import math
n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=input()
hand=[[] for _ in range(k)]
for i in range(len(t)):
    hand[i%k].append(t[i])

def janken(str):
    if str == "r":
        return p
    elif str == "s":
        return r
    else:
        return s

counter=0

for ha in hand:
    dp=[janken(ha[0])]
    if ha[0]==ha[1]:
        dp.append(dp[0])
    else:
        dp.append(janken(ha[0])+janken(ha[1]))
    
    for i in range(2,len(ha)):
        if ha[i-1] != ha[i]:
            dp.append(dp[i-1]+janken(ha[i]))
        elif ha[i] != ha[i-2]:
            dp.append(dp[i-1])
        elif dp[i-2] == dp[i-1]:
            dp.append(dp[i-1]+janken(ha[i]))
        else:
            dp.append(dp[i-1])
    counter += dp[-1]
            

print(counter)
Problem p02790 (python)

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

l = a * int(b)
r = b * int(a)
 
l = int(l)
r = int(r)
 
if l > r:
    print(l)
else:
    print(r)

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

l = a ** int(b)
r = b ** int(a)

l = int(l)
r = int(r)

if l > r:
    print(l)
else
    print(r)
Problem p02959 (python)

Fixed submission:
n=int(input())
m=list(map(int,input().split()))
h=list(map(int,input().split()))
a=0
for i in range(n):
  if h[i]<m[i]:
    a+=h[i]
  else:
    a+=m[i]
    r=h[i]-m[i]
    s=min(m[i+1],r)
    a+=s
    m[i+1]-=s
print(a)

Buggy submission (verdict: Runtime Error):
n=int(input())
m=list(map(int,input().split()))
h=list(map(int,input().split()))
a=0
for i in range(N):
  if h[i]<m[i]:
    a+=h[i]
  else:
    a+=m[i]
    r=h[i]-m[i]
    s=min(m[i+1],r)
    a+=s
    m[i+1]-=s
print(a)
Problem p03013 (python)

Fixed submission:
MOD=10**9+7
N,M=map(int,input().split())
a=[-1]

for i in range(M):
  a.append(int(input()))
s=[1]
b=0 if 1 in a else 1
s.append(b)
p,q=-1,-1
j=-1
for i in range(2,N+1):
  while j<M:
    if a[j+1]<=i:
      j+=1
    else:
      break
  v=s[i-2]+s[i-1]
  if a[j]==i:
    v=0
  s.append(v%MOD)
print(s[N])

Buggy submission (verdict: Runtime Error):
MOD=10**9+7
N,M=map(int,input().split())
a=[]

for i in range(M):
  a.append(int(input()))
s=[1]
b=0 if 1 in a else 1
s.append(b)
p,q=-1,-1
j=-1
for i in range(2,N+1):
  while j<M-1:
    if a[j+1]<=i:
      j+=1
    else:
      break
  v=s[i-2]+s[i-1]
  if a[j]==i:
    v=0
  s.append(v%MOD)
print(s[N])
Problem p03017 (python)

Fixed submission:
N,A,B,C,D=map(int,input().split())
S=input()

if C<D:
  if B<C:
    d=0
    if "##" in S[A-1:D]:
      d=1
    print("Yes" if d==0 else "No")
  else:
    d=0
    if "##" in S[A-1:C]:
      d=1
    if "##" in S[B-1:D]:
      d=1
    print("Yes" if d==0 else "No") 
else:
  d=0
  if "##" in S[A-1:C]:
    d=1
  if "..." not in S[B-2:D+1]:
    d=1
  print("Yes" if d==0 else "No")

Buggy submission (verdict: Runtime Error):
N,A,B,C,D=map(int,input().split())
S=input()

if C<D:
  if B<C:
    d=0
    if "##" in S[A-1:D]:
      d=1
    print("Yes" if d==0 else "No")
  else:
    d=0
    if "##" in S[A-1:C]:
      d=1
    if "##" in S[B-1:D]:
      d=1
    print("Yes" if d==0 else "No") 
else:
  d=0
  d=4/0
  if "##" in S[A-1:C]:
    d=1
  if "..." not in S[B-1:D]:
    d=1
  print("Yes" if d==0 else "No")
Problem p03104 (python)

Fixed submission:
A,B=map(int,input().split())
A=max(0,A-1)
P=[2**i for i in range(41)]
i=0
ans=0
while P[i]<=B:
  q=((B+1)//P[i])
  r=(B+1)%P[i]
  Q=((A+1)//P[i])
  R=(A+1)%P[i]
  coB=(q//2)*P[i]+[0,r][q%2]
  coA=(Q//2)*P[i]+[0,R][Q%2]
  if (coB-coA)%2==1:
    ans+=P[i]
  i+=1
print(ans)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
A=max(0,A-1)
P=[2**i for i in range(40)]
i=0
ans=0
while P[i]<=B:
  q=((B+1)//P[i])
  r=(B+1)%P[i]
  Q=((A+1)//P[i])
  R=(A+1)%P[i]
  coB=(q//2)*P[i]+[0,r][q%2]
  coA=(Q//2)*P[i]+[0,R][Q%2]
  if (coB-coA)%2==1:
    ans+=P[i]
  i+=1
print(ans)
Problem p03805 (python)

Fixed submission:
import itertools
N,M=map(int,input().split())
edge=[]
for i in range(N+1):
  edge.append([0]*(N+1))
for j in range(M):
  a,b=map(int,input().split())
  edge[a][b]=1
  edge[b][a]=1
roots=list(itertools.permutations(range(2,N+1)))
ans=0
for root in roots:
  pos=1
  for i in range(N-1):
    nxt=root[i]
    if edge[pos][nxt]==1:
      pos=nxt
    else:
      break
  else:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
N,M=map(int,input().split())
edge=[]
for i in range(N+1):
  edge.append([0]*(N+1))
for j in range(N):
  a,b=map(int,input().split())
  edge[a][b]=1
  edge[b][a]=1
roots=list(itertools.permutations(range(2,N+1)))
ans=0
for root in roots:
  pos=1
  for i in range(N-1):
    nxt=root[i]
    if edge[pos][nxt]==1:
      pos=nxt
    else:
      break
  else:
    ans+=1
print(ans)
Problem p02623 (python)

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

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)

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

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
  print(a)
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
    ans = max(ans, i + j)

print(ans)
Problem p02693 (python)

Fixed submission:
k = int(input())
a, b = map(int, input().split())
x = 0
  
while True:
  x += k
  
  if a <= x <= b:
    print('OK')
    break
  
  if x > b:
    print('NG')
    break

Buggy submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input().split())
x = 0
  
while True:
  x += k
  
  if a <= x <= b:
    print('OK')
	break
  
  if x > b:
    print('NO')
    break
Problem p02712 (python)

Fixed submission:
n = int(input())

ans = 0

for i in range(1, n + 1):
  if i % 3 != 0 and i % 5 != 0:
    ans += i

print(ans)

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

ans = 0

for i in range(1, n + 1):
  if i % 3 != 0 ans i % 5 != 0:
    ans += i

print(ans)
Problem p02676 (python)

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

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(S[K-1:-1]
Problem p02779 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    if i != len(A)-1:
        if A[i] == A[i+1]:
            f = 1
            break
        
if f > 0:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    if A[i] == A[i+1]:
        f = 1
        break
        
if f > 0:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
f = 0
A.sort()
for i in range(len(A)):
    # if A.count(i) > 1:
    if A[i] == A[i+1]:
        f = 1
        break
        
if f > 0:
    print("NO")
else:
 print("YES")
Problem p02879 (python)

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

if a > 9 or b > 9:
    print('-1')
else:
	print(a*b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = 0
for i in range(1,10):
    if n % i != 0:
        continue
    else:
        if n / i <= 9:
            a += 1
            break
        else:
            continue
if a == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = 0
for i in range(1,10):
    if n % i != 0:
        continue
    else:
        if n / i <= 9:
            a += 1
            break
        else:
            continue
if a == 1:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = 0
for i in range(1,10):
	if n % i != 0:
        continue
    else:
        if n / i <= 9:
            a += 1
            break
        else:
            continue
if a == 1:
	print('Yes')
else:
	print('No')
Problem p02729 (python)

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

print(int((N*(N-1)/2)+(M*(M-1)/2)))

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

for i in range(N):
    flag = 0
    for j in range(len(T)):
        if A[i] == T[j][0]:
            T[j][1] += 1
            flag = 1
            break
    if flag == 0:
        T.append([A[i],1])
T2 = []
for i in range(len(T)):
    T2.append(T[i][1])

def hoge(List):
    ans = 0
    for i in range(len(List)):
        ans += (List[i]-1)*List[i]//2
    return ans

for i in range(N):
    for j in range(len(T)):
        if T[j][0] == A[i]:
            T2[j] -= 1
            print(hoge(T2))
            T2[j] += 1
            break
Problem p02723 (python)

Fixed submission:
S = list(input())

if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
# Problem D - Line++

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

# initialization
INF = N
kyori_graph = [[INF]*N for i in range(N)]
kosu_list = [0]*(N-1)

# graph search
for i in range(N):
    for j in range(i+1, N):
        # グラフの更新
        kyori_graph[i][j] = min(abs(j-i), abs(X-1-i)+1+abs(j-(Y-1)))
        # abs((Y-1)-i)+1+abs(j-(X-1))

# 個数の数え上げ
for i in range(N):
    for j in range(i+1, N):
        kyori = kyori_graph[i][j]
        kosu_list[kyori-1] += 1

# output
for k in kosu_list:
    print(k)
Problem p02793 (python)

Fixed submission:
import fractions

N = int(input())
A_list = list(map(int, input().split()))

mod = 10**9+7

R = 1 # 最小公倍数
# 最小公倍数を求める
for A in A_list:
    R *= A // fractions.gcd(R, A)

# Bの合計を求める
ans = 0
for A in A_list:
    ans = ans + R // A # 計算は小数として出してはダメだから//を使う

ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
A_list = list(map(int, input().split()))

mod = 10**9+7

R = 1 # 最小公倍数
# 最小公倍数を求める
for A in A_list:
    R *= A // fractions.gcd(R, A)

# Bの合計を求める
ans = 0
for A in A_list:
    ans = ans + (R / A)

print(int(ans%(mod+7)))

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
A_list = list(map(int, input().split()))

R = 1 # 最小公倍数
# 最小公倍数を求める
for A in A_list:
    R = R * A // fractions.gcd(R, A)

# Bの合計を求める
ans = 0
for A in A_list:
    ans = ans + (R / A)

print(int(ans%(pow(10,9)+7)))

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
A_list = list(map(int, input().split()))

R = 1 # 最小公倍数
# 最小公倍数を求める
for A in A_list:
    R = R * A // fractions.gcd(R, A)

# Bの合計を求める
ans = 0
for A in A_list:
    ans = ans + (R / A)

print("%d"%(ans%(pow(10,9)+7)))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
A_list = list(map(int, input().split()))

R = 1 # 最小公倍数
# 最小公倍数を求める
for A in A_list:
    R = R * A // math.gcd(R, A)

# Bの合計を求める
ans = 0
for A in A_list:
    ans = ans + (R / A)

print("%d"%(ans%(pow(10,9)+7)))
Problem p02860 (python)

Fixed submission:

n=int(input())
s=input()
a=s[:n//2]
if s==a+a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
a=s[:n//2]
if s=a+a:
  print("Yes")
else:
  print("No")