Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x,k,d=map(int,input().split())
o =x//d
if x <0 and x-(1*d*0)+(1*d*(k-0)) <=0:
    print(x-(1*d*0)+(1*d*(k-0)))
    exit()
else:
    print(min(x+(1*d*o,x+(1*d*(o+1),x+(1*d*(o-1)))
    exit()
    
if x >0 and x-(1*d*k)+(1*d*(0)) >=0:
    print(x-(1*d*k)+(1*d*(0)))
    exit()
else:
   print( min(x-(1*d*o,x-(1*d*(o+1),x-(1*d*(o-1)))
   exit()


Fixed submission:
x,k,d=map(int,input().split())
x =abs(x)
o =x//d
if (x-d*k) >=0:
    print(x-d*k)
    exit()
else:
    if (k-o)%2==0:
        print(abs(x%d))
        exit()
    else:
        print(abs(x%d-d))
        exit()

Buggy python submission (verdict: Runtime Error):
x,k,d=map(int,input().split())
o =x//d
if x <0 and x-(1*d*0)+(1*d*(k-0)) <=0:
    print(x-(1*d*0)+(1*d*(k-0)))
    exit()
else:
    print(min(x+(1*d*o,x+(1*d*(o+1),x+(1*d*(o-1)))
    
if x >0 and x-(1*d*k)+(1*d*(0)) >=0:
    print(x-(1*d*k)+(1*d*(0)))
    exit()
else:
   print( min(x-(1*d*o,x-(1*d*(o+1),x-(1*d*(o-1)))


Fixed submission:
x,k,d=map(int,input().split())
x =abs(x)
o =x//d
if (x-d*k) >=0:
    print(x-d*k)
    exit()
else:
    if (k-o)%2==0:
        print(abs(x%d))
        exit()
    else:
        print(abs(x%d-d))
        exit()

Buggy python submission (verdict: Time Limit Exceeded):
x,k,d=map(int,input().split())
s = abs(x-(1*d*0)+(1*d*(k-0)))
for i in range(k+1):
    s =min(abs(x-(1*d*i)+(1*d*(k-i))),s)
print(s)

Fixed submission:
x,k,d=map(int,input().split())
x =abs(x)
o =x//d
if (x-d*k) >=0:
    print(x-d*k)
    exit()
else:
    if (k-o)%2==0:
        print(abs(x%d))
        exit()
    else:
        print(abs(x%d-d))
        exit()
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
T = list(map(int,input().split()))
Number = []
for j in range(N-K+1):
    Num=1
    for i in range(K):
        Num *=T[i+j]/10***3
    Number.append(Num)

for p in range(N-K):
    if Number[p+1] - Number[p] >0:
        print('Yes')
    else:
        print('No')
    

Fixed submission:
N,K = map(int,input().split())
T = list(map(int,input().split()))
for p in range(N-K):
    if T[p] - T[p+K] <0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
T = list(map(int,input().split()))
Number = []
for j in range(N-K+1):
    Num=1
    for i in range(K):
        Num *=T[i+j]
    Number.append(Num)

for p in range(N-K):
    if Number[p+1] - Number[p] >0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N,K = map(int,input().split())
T = list(map(int,input().split()))
for p in range(N-K):
    if T[p] - T[p+K] <0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
T = list(map(int,input().split()))
Number = []
for j in range(N-K+1):
    Num=1
    for i in range(K):
        Num *=T[i+j]
    Number.append(Num)

for p in range(N-K):
    if Number[p+1] - Number[p] >0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N,K = map(int,input().split())
T = list(map(int,input().split()))
for p in range(N-K):
    if T[p] - T[p+K] <0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n,m = map(int,input().split())
g = [[] for _ in range(n)]
for _ in range(m):
    a,b = map(int,input().split())
    a-=1
    b-=1
    g[a].append(b)
    g[b].append(a)
    
def bfs(u):
    queue = deque([u])
    d = [None]*n    
    d[u] = 0
    while queue:
        v=queue.popleft()
        for i in g[v]:
            if d[i] is None:
                p[i] = v
                queue.append(i)
    return d

p = [None]*n
d = bfs(0)
print('Yes')
        
for q in range(1,n):
    print(int(p[q])+1)

Fixed submission:
from collections import deque
n,m = map(int,input().split())
g = [[] for _ in range(n)]
for _ in range(m):
    a,b = map(int,input().split())
    a-=1
    b-=1
    g[a].append(b)
    g[b].append(a)
    
def bfs(u):
    queue = deque([u])
    d = [None]*n
    
    d[u] = 0
    while queue:
        v=queue.popleft()
        for i in g[v]:
            if d[i] is None:
                d[i] = d[v]+1
                p[i] = v
                queue.append(i)
    return d

p = [None]*n
d = bfs(0)
if None in p[1:]:
    print('No')
else:
    print('Yes')
        
for q in range(1,len(p)):
    print(int(p[q])+1)
Buggy python submission (verdict: Time Limit Exceeded):
# ABC158 B - Count Balls

N,A,B = map(int,input().split())
A_A = 0
B_B = 0
for i in range(N):
    if N >= A:
        A_A +=A
        N -=A
    else:
        A_A +=N
        break
    if N >= B:
        B_B +=B
        N -=B
    else:
        B_B +=N
        break
print(A_A)
    


Fixed submission:
# ABC158 B - Count Balls

M,A,B = map(int,input().split())
import math
C = math.floor(M/(A+B))
N = M%(A+B)
E = C*A
A_A = 0
B_B = 0
for i in range(N):
    if N >= A:
        A_A +=A
        N -=A
    else:
        A_A +=N
        break
    if N >= B:
        B_B +=B
        N -=B
    else:
        B_B +=N
        break
print(A_A+E)

Buggy python submission (verdict: Time Limit Exceeded):
# ABC158 B - Count Balls

N,A,B = map(int,input().split())
A_A = 0
B_B = 0
for i in range(N):
    if N >= A:
        A_A +=A
        N -=A
    else:
        A_A +=N
        break
    if N >= B:
        B_B +=B
        N -=B
    else:
        B_B +=N
        break
print(A_A)
    


Fixed submission:
# ABC158 B - Count Balls

M,A,B = map(int,input().split())
import math
C = math.floor(M/(A+B))
N = M%(A+B)
E = C*A
A_A = 0
B_B = 0
for i in range(N):
    if N >= A:
        A_A +=A
        N -=A
    else:
        A_A +=N
        break
    if N >= B:
        B_B +=B
        N -=B
    else:
        B_B +=N
        break
print(A_A+E)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
for i in range(N):
    if N >=2**i and N <2**(i+1):
        print(i+1)

Fixed submission:
N,K = map(int,input().split())
for i in range(N):
    if N >=K**i and N <K**(i+1):
        print(i+1)
        break
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=[]
for i in range(n):
    a=str(input())
    A.append(a)
import collections
c = collections.Counter(A)
C=[i[0] for i in c.items() if i[1] >= c.most_common()[0][1]]
C.sort(reverse=False)
for j in range(len(C)):
    print(C[j])

Fixed submission:
n = int(input())
S=[]
for i in range(n):
    s=input()
    S.append(s)
S.sort()
import collections
c = collections.Counter(S)
values, counts = zip(*c.most_common())
print(values[0])
for i in range(len(counts)-1):
    if counts[i] == counts[i+1]:
        print(values[i+1])
    else:
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
# ABC149 B - Greedy Takahashi
a,b,k = map(int,input().split())

for i in range(k):
    if a>0:
        a -=1
    else:
        if b>0:
            b -=1
print(str(a)+' '+str(b))

Fixed submission:
# ABC149 B - Greedy Takahashi
a,b,k = map(int,input().split())

if a-k>=0:
    a -=k
else:
    k -= a
    a=0
    if b-k>=0:
        b -=k
    else:
        b=0
print(str(a)+' '+str(b))
Buggy python submission (verdict: Runtime Error):
n,q = map(int,input().split())

v = [[] for i in range(n)]
for i in range(n-1):
  a,b = map(int,input().split())
  a -= 1 # listのindex参照をそのまま使いたいので頂点id(1から始まっている)を-1しておく
  b -= 1 # aと同様
  v[a].append(b)
  v[b].append(a)

f = [0]*n
for i in range(q):
  p,x = map(int,input().split())
  p -= 1 # aと同様
  f[p] += x

def dfs(x,d,s): # x:計算する頂点（上側）, d:計算済み(0)か否か(1), s:頂点xの値
  for y in v[x]: # 頂点xとつながる各頂点yの計算を行う
    if d[y]: # 頂点yが計算未了の場合
      s += f[y] # 頂点xの値sに頂点yの値を足す
      ans[y] = s # 頂点yの値はsに確定
      d[y] = 0 # 頂点yの計算は終わったのでd[y]=0とする
      dfs(y,d,s) # 頂点yの下層についても再帰的に計算
      s -= f[y] # 頂点yの下層の計算が終わったので、sを頂点xの値に戻す

ans = [0]*n
d = [1]*n
d[0] = 0
ans[0] = f[0]
s = f[0]
dfs(0,d,s)
Z=[str(a) for a in ans]
Z=" ".join(Z)
print(Z)

Fixed submission:
n,q=map(int, input().split())
go_list=[[] for i in range(n+1)]
cnt=[0]*(n+1)
Oya=[False]*(n+1)
Oya[1]=True
for i in range(n-1):
    a,b=map(int, input().split())
    go_list[a].append(b)
    go_list[b].append(a)

for i in range(q):
    p,x=map(int, input().split())
    cnt[p]+=x

from collections import deque
que=deque()

que.append(1)
sumi=[False]*(n+1)
sumi[1]=True
while que:
    ne=que.popleft()
    for i in go_list[ne]:
        if not sumi[i]:
            cnt[i]+=cnt[ne]
            sumi[i]=True
            que.append(i)

cnt.pop(0)
print(*cnt)

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

v = [[] for i in range(n)]
for i in range(n-1):
  a,b = map(int,input().split())
  a -= 1 # listのindex参照をそのまま使いたいので頂点id(1から始まっている)を-1しておく
  b -= 1 # aと同様
  v[a].append(b)
  v[b].append(a)

f = [0]*n
for i in range(q):
  p,x = map(int,input().split())
  p -= 1 # aと同様
  f[p] += x

def dfs(x,d,s): # x:計算する頂点（上側）, d:計算済み(0)か否か(1), s:頂点xの値
  for y in v[x]: # 頂点xとつながる各頂点yの計算を行う
    if d[y]: # 頂点yが計算未了の場合
      s += f[y] # 頂点xの値sに頂点yの値を足す
      ans[y] = s # 頂点yの値はsに確定
      d[y] = 0 # 頂点yの計算は終わったのでd[y]=0とする
      dfs(y,d,s) # 頂点yの下層についても再帰的に計算
      s -= f[y] # 頂点yの下層の計算が終わったので、sを頂点xの値に戻す

ans = [0]*n
d = [1]*n
d[0] = 0
ans[0] = f[0]
s = f[0]
dfs(0,d,s)
print(*ans)

Fixed submission:
n,q=map(int, input().split())
go_list=[[] for i in range(n+1)]
cnt=[0]*(n+1)
Oya=[False]*(n+1)
Oya[1]=True
for i in range(n-1):
    a,b=map(int, input().split())
    go_list[a].append(b)
    go_list[b].append(a)

for i in range(q):
    p,x=map(int, input().split())
    cnt[p]+=x

from collections import deque
que=deque()

que.append(1)
sumi=[False]*(n+1)
sumi[1]=True
while que:
    ne=que.popleft()
    for i in go_list[ne]:
        if not sumi[i]:
            cnt[i]+=cnt[ne]
            sumi[i]=True
            que.append(i)

cnt.pop(0)
print(*cnt)
Buggy python submission (verdict: Runtime Error):
S=[]
cho=[0]
p=0
n = int(input())
for i in range(n):
    s=sorted(input())
    if s in S:
        cho[p]+=1
        p+=1
    S.append(s)
import collections
from scipy.special import comb
a=0
Sd=list(set(S))
c = collections.Counter(S)
for p in  range(len(Sd)):
    if c[Sd[p]] >=2:
        a  += comb(c[Sd[p]], 2, exact=True)
print(a)

Fixed submission:
S=[]
n = int(input())
for i in range(n):
    s=''.join(sorted(input()))
    S.append(s)
import collections
from scipy.special import comb
a=0
Sd=list(set(S))
c = collections.Counter(S)
for p in  range(len(Sd)):
    if c[Sd[p]] >=2:
        a  += comb(c[Sd[p]], 2, exact=True)
print(a)

Buggy python submission (verdict: Runtime Error):
S=[]
cho=[0]
p=0
n = int(input())
for i in range(n):
    s=sorted(input())
    if s in S:
        cho[p]+=1
        p+=1
    S.append(s)
import collections
from scipy.special import comb
a=0
Sd=list(set(S))
c = collections.Counter(S)
for p in  range(len(Sd)):
    if c[Sd[p]] >=2:
        a  += comb(c[Sd[p]], 2, exact=True)
print(a)

Fixed submission:
S=[]
n = int(input())
for i in range(n):
    s=''.join(sorted(input()))
    S.append(s)
import collections
from scipy.special import comb
a=0
Sd=list(set(S))
c = collections.Counter(S)
for p in  range(len(Sd)):
    if c[Sd[p]] >=2:
        a  += comb(c[Sd[p]], 2, exact=True)
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
S=[]
n = int(input())
for i in range(n):
    s=sorted(input())
    S.append(s)
cnt=0
for j in range (len(S)):
    for p in range(j+1,len(S)):
        if S[j]==S[p]:
            if j!=p:
                cnt+=1
print(cnt)
        

Fixed submission:
S=[]
n = int(input())
for i in range(n):
    s=''.join(sorted(input()))
    S.append(s)
import collections
from scipy.special import comb
a=0
Sd=list(set(S))
c = collections.Counter(S)
for p in  range(len(Sd)):
    if c[Sd[p]] >=2:
        a  += comb(c[Sd[p]], 2, exact=True)
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
# ABC136 C - Build Stairs

n = int(input())
h = list(map(int,input().split()))
for i in range(len(h)-1):
    if h[i] - min(h[i+1:]) >= 2:
        print('No')
        exit()
print('Yes')

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
base=0
for h in H:
    if base>h:
        print("No")
        break
    base=max(base,h-1)
else:
    print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
# ABC136 C - Build Stairs

n = int(input())
h = list(map(int,input().split()))
for i in range(len(h)):
    for j in range(i+1,len(h)):
        if h[i] - h[j] >= 2:
            print('No')
            exit()
print('Yes')

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
base=0
for h in H:
    if base>h:
        print("No")
        break
    base=max(base,h-1)
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)
dl = [0]
m = [e for e in n%10 if e not in dl]
s = np.ceil(n/10)*10
print(int(np.sum(s)-(10-min(m))))

Fixed submission:
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)
dl = [0]
s = np.ceil(n/10)*10

if max(n%10)==0:
    print(int(np.sum(s)))
    exit()
m = [e for e in n%10 if e not in dl]
print(int(np.sum(s)-(10-min(m))))

Buggy python submission (verdict: Runtime Error):
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)

m = [e for e in n%10 if e not in dl]
s = np.ceil(n/10)*10
print(int(np.sum(s)-min(m)))

Fixed submission:
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)
dl = [0]
s = np.ceil(n/10)*10

if max(n%10)==0:
    print(int(np.sum(s)))
    exit()
m = [e for e in n%10 if e not in dl]
print(int(np.sum(s)-(10-min(m))))

Buggy python submission (verdict: Runtime Error):
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)

m = [e for e in n%10 if e not in dl]
s = np.ceil(n/10)*10
print(int(np.sum(s)-min(m)))

Fixed submission:
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)
dl = [0]
s = np.ceil(n/10)*10

if max(n%10)==0:
    print(int(np.sum(s)))
    exit()
m = [e for e in n%10 if e not in dl]
print(int(np.sum(s)-(10-min(m))))

Buggy python submission (verdict: Runtime Error):
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)

m = [e for e in n%10 if e not in dl]
s = np.ceil(n/10)*10
print(int(np.sum(s)-min(m))

Fixed submission:
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)
dl = [0]
s = np.ceil(n/10)*10

if max(n%10)==0:
    print(int(np.sum(s)))
    exit()
m = [e for e in n%10 if e not in dl]
print(int(np.sum(s)-(10-min(m))))

Buggy python submission (verdict: Runtime Error):
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)

m = [e for e in n%10 if e not in dl]
s = np.ceil(n/10)*10
print(np.sum(s)-min(m))

Fixed submission:
# B - Five Dishes
import numpy as np
n=[]
for i in range(5):
    t = int(input())
    n.append(t)
n = np.array(n)
dl = [0]
s = np.ceil(n/10)*10

if max(n%10)==0:
    print(int(np.sum(s)))
    exit()
m = [e for e in n%10 if e not in dl]
print(int(np.sum(s)-(10-min(m))))
Buggy python submission (verdict: Runtime Error):
# その24
# ABC121 B - Can you solve this?

n,m,c=map(int,input().split())
B = np.array(list(map(int,input().split())))
K=[]
for i in range(n):
    A = list(map(int,input().split()))
    K.append(A)

import numpy as np
pp = np.array(K)
l = (pp*B).sum(axis=1)+c

t = 0
for i in range(len(l)):
    if l[i] > 0:
        t+=1
print(t)


Fixed submission:
# その24
# ABC121 B - Can you solve this?

import numpy as np

n,m,c=map(int,input().split())
B = np.array(list(map(int,input().split())))
K=[]
for i in range(n):
    A = list(map(int,input().split()))
    K.append(A)

pp = np.array(K)
l = (pp*B).sum(axis=1)+c

t = 0
for i in range(len(l)):
    if l[i] > 0:
        t+=1
print(t)

Buggy python submission (verdict: Runtime Error):
# その24
# ABC121 B - Can you solve this?

n,m,c=map(int,input().split())
B = np.array(list(map(int,input().split())))
K=[]
for i in range(n):
    A = list(map(int,input().split()))
    K.append(A)

import numpy as np
pp = np.array(K)
l = (pp*B).sum(axis=1)+c

t = 0
for i in range(len(l)):
    if l[i] > 0:
        t+=1
print(t)


Fixed submission:
# その24
# ABC121 B - Can you solve this?

import numpy as np

n,m,c=map(int,input().split())
B = np.array(list(map(int,input().split())))
K=[]
for i in range(n):
    A = list(map(int,input().split()))
    K.append(A)

pp = np.array(K)
l = (pp*B).sum(axis=1)+c

t = 0
for i in range(len(l)):
    if l[i] > 0:
        t+=1
print(t)
Buggy python submission (verdict: Runtime Error):
n =int(input())
W=[]
w=''
for i in range(n):
    if i !=0 and w[-1] !=str(input())[0]:
        print('No')
        exit()
    else:
        w=str(input())
        W.append(w)
if len(W) != len(list(set(W))):
    print('No')
    exit()
print('Yes')

Fixed submission:
n =int(input())
W=[]
w=''
for i in range(n):
    s=str(input())
    if i !=0 and w[-1] != s[0]:
        print('No')
        exit()
    else:
        w=s
        W.append(w)
if len(W) != len(list(set(W))):
    print('No')
    exit()
print('Yes')
Buggy python submission (verdict: Runtime Error):
n=int(input())
cnt=0
for x in range(n):
    for y in range(n):
        if x*4+y*7==n:
            print('Yes')
            exit'
print('No')

Fixed submission:
n=int(input())
cnt=0
for x in range(n):
    for y in range(n):
        if x*4+y*7==n:
            print('Yes')
            exit()
print('No')
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())
L=[]
for i in range(a,b+1):
    L.append(i)
L.sort(reverse=True)
O=L[:k]+L[-k:]
O=list(set(O))
O.sort(reverse=False)
for j in range(len(O)):
    print(O[j])

Fixed submission:
a,b,k = map(int,input().split())
A=[]
for i in range(a,min(a+k,b+1)):
    A.append(i)
B=[]
for i in range(b,max(b-k,a-1),-1):
    B.append(i)
C=list(set(A+B))
C.sort(reverse=False)
for j in range(len(C)):
    print(C[j])

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())
L=[]
for i in range(a,b+1):
    L.append(i)
L.sort(reverse=True)
O=L[:k]+L[-k:]
O=list(set(O))
O.sort(reverse=False)
for j in range(len(O)):
    print(O[j])

Fixed submission:
a,b,k = map(int,input().split())
A=[]
for i in range(a,min(a+k,b+1)):
    A.append(i)
B=[]
for i in range(b,max(b-k,a-1),-1):
    B.append(i)
C=list(set(A+B))
C.sort(reverse=False)
for j in range(len(C)):
    print(C[j])
Buggy python submission (verdict: Runtime Error):
N = int(input())
Y = int(input())
for x in range(N+1):
    for y in range(N+1):
        for z in range(N+1):
            if 10000*x+5000*y+1000*z == Y:
                print(x,y,z)

Fixed submission:
n, y = map(int, input().split())
for i in range(n + 1):
    for j in range(n - i + 1):
        if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
            print(i, j, n - i - j)
            exit()
print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
N, A, B = [int(input()) for i in range(3)]
count = 0
for n in range(1,N+1):
    s = 0
    t = n
    while (n>0):
        s = s + n%10
        n = n//10
    if s >= A and s <= B:
        count +=t
print(count)
    

Fixed submission:
N, A, B = map(int, input().split())
count = 0
for n in range(1,N+1):
    s = 0
    t = n
    while (n>0):
        s = s + n%10
        n = n//10
    if s >= A and s <= B:
        count +=t
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
M=1
for i in range(1,N):
    for j in range(2,N):
        if i**j<= N:
            M = max(M,i**j)
        else:
            break
print(M)
            

Fixed submission:
N = int(input())
M=1
for i in range(1,N):
        if i**2<= N:
            M = max(M,i**2)
        else:
            break
print(M)
Buggy python submission (verdict: Runtime Error):
# その13
# A - Palindromic Number

N = int(input())

if N[0] == N[2]:
    print('Yes')
else:
    print('No')



Fixed submission:
# その13
# A - Palindromic Number

N = str(input())

if N[0] == N[2]:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
# その13
# A - Palindromic Number

N = int(input())

if N[0] = N[2]:
    print('Yes')
else:
    print('No')



Fixed submission:
# その13
# A - Palindromic Number

N = str(input())

if N[0] == N[2]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
#その10

O = str(input())
E = str(input())
P = []
for i in range(len(O)):
    P.append(O[i])
    if i <= len(E):
        P.append(E[i])
print(''.join(P))

Fixed submission:
#その10

O = str(input())
E = str(input())
P = []
for i in range(len(O)):
    P.append(O[i])
    if i < len(E):
        P.append(E[i])
print(''.join(P))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = 1
for i in range(N):
    p *= (i+1)
tp = p%((10**9)+7)
print(tp)

Fixed submission:
ans=1
n=int(input())
for i in range(1,n+1):
    ans*=i
    ans=ans%(10**9+7)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = 1
for i in range(N):
    p *= (i+1)
tp = p%((10**9)+7)
print(tp)

Fixed submission:
ans=1
n=int(input())
for i in range(1,n+1):
    ans*=i
    ans=ans%(10**9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
for i in range(len(s)):
    if s[i]=='A':
        a=i
        break
for j in reversed(range(len(s))):
    if s[j]=='Z':
        b=j
        break
print(b-a+1)

Fixed submission:
s =str(input())
for i in range(len(s)):
    if s[i]=='A':
        a=i
        break
for j in reversed(range(len(s))):
    if s[j]=='Z':
        b=j
        break
print(b-a+1)
Buggy python submission (verdict: Time Limit Exceeded):
k,s= map(int,input().split())
cnt=0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z==s:
                cnt+=1
print(cnt)

    

Fixed submission:
k,s= map(int,input().split())
cnt=0
for x in range(k+1):
    for y in range(k+1):
        if 0 <= s-x-y <= k:
            cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
#B
n = int(input())
count=0
mcount=0
for i in range(n):
    a,b = list(map(int, input().split()))
    if a==b:
        count+=1
        if mcount<count:
            mcount = count
            if mcount=3:
                break
    else:
        count=0
if mcount=3:
    print("Yes")
else:
    print("No")

Fixed submission:
#B
n = int(input())
count=0
mcount=0
for i in range(n):
    a,b = list(map(int, input().split()))
    if a==b:
        count+=1
        if mcount<count:
            mcount = count
            if mcount==3:
                break
    else:
        count=0
if mcount==3:
    print("Yes")
else:
    print("No")