Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input())
if a==b==c:
  print('No')
elif a==b or b==c or a==c:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b,c = map(int, input().split())
if a==b==c:
  print('No')
elif a==b or b==c or a==c:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [input() for hoge in range(n)]
b = sorted(a)
c = set(a)
d = 0
ans = []
for poge in c:
  if d < b.count(poge):
    d = b.count(poge)
for raw in b:
  if d == b.count(raw):
    ans.append(raw)
answer = sorted(set(ans))
for q in answer:
  print(q)

Fixed submission:
import collections
n = int(input())
a = [input() for hoge in range(n)]
counted = collections.Counter(a)
m = max(counted.values())
chars = [key for key, value in counted.items()
             if value == m]
c = sorted(chars)
for poge in c:
  print(poge)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p_list = list(map(int,input().split()))
for j in range(n):
  p_list[j] = (p_list[j]+1)/2
c = 0
for i in range(n-k+1):
  c = max(c,sum(p_list[i:i+k]))
print(c)

Fixed submission:
def hoge(x):
  return (int(x)+1)/2

n,k = map(int,input().split())
p_list = list(map(hoge,input().split()))
p_set = [0,p_list[0]]
t = 0
for i in range(1,n):
  p_set.append(p_set[i]+p_list[i])
for j in range(k,n+1):
  t = max(t,p_set[j]-p_set[j-k])
print(t)
Buggy python submission (verdict: Runtime Error):
h,n = map(int,input().split())
a = int().rstrip().split()
c = 0
for b in a:
  c += b
if h > c:
  print('No')
else:
  print('Yes')

Fixed submission:
h,n = map(int,input().split())
z = input()
a = z.split()
c = 0
for b in a:
  c += int(b)
if h > c:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a == b:
  print('Yes')
else:
  print('No)

Fixed submission:
a,b = map(int, input().split())
if a == b:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a = input()
print chr(ord(a) + 1)

Fixed submission:
a = input()
b = chr(ord(a) + 1)
print(b)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
pS_list = [list(input().split()) 
           for nesya in range(m)]
ac = 0
wa = 0
q_list = [0]*n
for ps in ps_list:
  p = int(ps[0])-1
  s = ps[1]
  if q_list[p] == 1:
    continue
  if s == 'WA':
    q_list[p] -= 1
  else:
    a = q_list[p]
    wa -= a
    ac += 1
    q_list[p] = 1
print(ac,wa)

Fixed submission:
n,m = map(int,input().split())
pS_list = [list(input().split()) 
           for nesya in range(m)]
ac = 0
wa = 0
q_list = [0]*n
for ps in pS_list:
  p = int(ps[0])-1
  s = ps[1]
  if q_list[p] == 1:
    continue
  if s == 'WA':
    q_list[p] -= 1
  else:
    a = q_list[p]
    wa -= a
    ac += 1
    q_list[p] = 1
print(ac,wa)
Buggy python submission (verdict: Runtime Error):
#関数を持ってくる
from collections import deque

#入力(座標をリストで扱いやすいように-1する)
r,c = map(int,input().split())
c_list = [list(input()) for nesya in range(r)]
for hoge in c_list:
  hoge.insert(0,'#')
  hoge.append('#')
c_list.insert(0,['#']*(c+2))
c_list.append(['#']*(c+2))

ans = 0
for i in range(r+2):
  for j in range(c+2):
    #dequeオブジェクトを作る
    d = deque()
    #その座標を扱ったかを調べるためのリストを作る
    hoge_list = [[-1]*(c+2) for motsu in range(r+2)]
    if  c_list[j][i] == '#':
      continue
    else:
      #スタート位置をdに加え、到達時刻を0にする
      d.append((j,i))
      hoge_list[j][i] = 0

      #当該の座標から動かすためのリストを作る
      move =[[1,0],[-1,0],[0,1],[0,-1]]

      #座標に対して作業する
      while len(d) > 0:
        #今から扱う座標をcoordとする
        coord = d.popleft()
  
        #縦横に移動したときそれぞれのマスに作業する
        for k in range(4):
          #移動した後の座標
          x = coord[1] + move[k][1]
          y = coord[0] + move[k][0]
    
          #作業が終わっている座標であったら無視する
          if hoge_list[y][x] != -1:
            pass
          #マスが壁であった場合-2を代入して終わる
          elif c_list[y][x] == '#':
            hoge_list[y][x] = -2
          #作業するマス
          else:
            #当該座標から1移動したはずである
            hoge_list[y][x] = hoge_list[coord[0]][coord[1]] + 1
            ans = max(hoge_list[y][x],ans)
            #dequeに加える
            d.append((y,x))
    

#ゴールの移動回数を出力する
print(ans)


Fixed submission:
#関数を持ってくる
from collections import deque

#入力(座標をリストで扱いやすいように-1する)
r,c = map(int,input().split())
c_list = [list(input()) for nesya in range(r)]
for hoge in c_list:
  hoge.insert(0,'#')
  hoge.append('#')
c_list.insert(0,['#']*(c+2))
c_list.append(['#']*(c+2))

ans = 0
for j in range(r+2):
  for i in range(c+2):
    #dequeオブジェクトを作る
    d = deque()
    #その座標を扱ったかを調べるためのリストを作る
    hoge_list = [[-1]*(c+2) for motsu in range(r+2)]
    if  c_list[j][i] == '#':
      continue
    else:
      #スタート位置をdに加え、到達時刻を0にする
      d.append((j,i))
      hoge_list[j][i] = 0

      #当該の座標から動かすためのリストを作る
      move =[[1,0],[-1,0],[0,1],[0,-1]]

      #座標に対して作業する
      while len(d) > 0:
        #今から扱う座標をcoordとする
        coord = d.popleft()
  
        #縦横に移動したときそれぞれのマスに作業する
        for k in range(4):
          #移動した後の座標
          x = coord[1] + move[k][1]
          y = coord[0] + move[k][0]
    
          #作業が終わっている座標であったら無視する
          if hoge_list[y][x] != -1:
            pass
          #マスが壁であった場合-2を代入して終わる
          elif c_list[y][x] == '#':
            hoge_list[y][x] = -2
          #作業するマス
          else:
            #当該座標から1移動したはずである
            hoge_list[y][x] = hoge_list[coord[0]][coord[1]] + 1
            ans = max(hoge_list[y][x],ans)
            #dequeに加える
            d.append((y,x))
    

#ゴールの移動回数を出力する
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
st = [list(input().split()) for nesya in range(n)]
x = input()
c = 0
for a in st:
  if x == st[0]:
    c = 0
  else:
    c += int(st[1])
print(c)

Fixed submission:
n = int(input())
st = [list(input().split()) for nesya in range(n)]
x = input()
c = 0
for a in st:
  if x == a[0]:
    c = 0
  else:
    c += int(a[1])
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
for i in range(1,n+2):
  if not i in a:
    break
  s = a.index(i)
  a = a[s:]
if i == 1:
  print(-1)
else:
  print(n-i+1)

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

Buggy python submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int,input().split()))
c = -1
k = 0
for i in range(1,n+1):
  if not i in a_list:
    k = i
    break
  a_list = a_list[c+1:]
  c = a_list.index(i)
if k == 1:
  print(-1)  
elif k > 0:
  print(n-k+1)
else:
  print(0)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
h = 0
for i in range(0,n):
  if a[i] != i-h+1:
    h += 1
if h == n:
  print(-1)
else:
  print(h)
Buggy python submission (verdict: Runtime Error):
n = int(input())
dl = list(map(int,input().split()))
if dl[0] != 0:
  print(0)
  exit()
d_dic = dict()
for d in dl:
  if d in d_dic:
    d_dic[d] += 1
  else:
    d_dic[d] = 1
l = max(d_dic.keys())
ans = 1
for i in range(l):
  ans *= d_dic[i]**d_dic[i+1]
  ans = ans%998244353
print(ans)

Fixed submission:
n = int(input())
dl = list(map(int,input().split()))
if dl[0] != 0:
  print(0)
  exit()
d_dic = dict()
for d in dl:
  if d in d_dic:
    d_dic[d] += 1
  else:
    d_dic[d] = 1
l = max(d_dic.keys())
for i in range(l):
  if not i in d_dic:
    print(0)
    exit()
if d_dic[0] != 1:
  print(0)
  exit()
ans = 1
for i in range(l):
  ans *= d_dic[i]**d_dic[i+1]
  ans = ans%998244353
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
if 2b >= a:
  print(0)
else:
  print(a - 2*b)

Fixed submission:
a,b = map(int, input().split())
if 2*b >= a:
  print(0)
else:
  print(a - 2*b)
Buggy python submission (verdict: Time Limit Exceeded):
def is_ok(arg):
  #問題の定義
  return l[i]-l[j] < l[arg]
 
def nibutan(ng,ok):
  while (abs(ok-ng)>1):
    mid = (ok+ng)//2
    if is_ok(mid):
      ok = mid
    else:
      ng = mid
  return ok

n = int(input())
l = list(map(int,input().split()))
c = 0
l.sort(reverse=True)
for i in range(n-2):
  for j in range(i+1,n-1):
    a = nibutan(n,j)
    c += a-j
print(c)

Fixed submission:
#関数を持ってくる
from bisect import bisect_left
#入力
n = int(input())
l_list = list(map(int,input().split()))
#ソート
l_list.sort()
#答えの数を数えるものを作る
ans = 0
#三角形の中で一番短い辺aに対して
for i in range(n-2):
  a = l_list[i]
  #2番目に短い辺bが存在し
  for j in range(i+1,n-1):
    b = l_list[j]
    #一番長い辺cの下限値であるa+bのリスト内で入る位置x
    x = bisect_left(l_list,a+b)
    #cとして考えられる値はjとxの間の個数
    ans += x-j-1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort(reverse=True)
ans = 0
for i in range(n):
  a = l_list[i]
  for j in range(i+1,n):
    for k in range(j+1,n):
      if a < l_list[j]+l_list[k]:
        ans += 1
print(ans)

Fixed submission:
#関数を持ってくる
from bisect import bisect_left
#入力
n = int(input())
l_list = list(map(int,input().split()))
#ソート
l_list.sort()
#答えの数を数えるものを作る
ans = 0
#三角形の中で一番短い辺aに対して
for i in range(n-2):
  a = l_list[i]
  #2番目に短い辺bが存在し
  for j in range(i+1,n-1):
    b = l_list[j]
    #一番長い辺cの下限値であるa+bのリスト内で入る位置x
    x = bisect_left(l_list,a+b)
    #cとして考えられる値はjとxの間の個数
    ans += x-j-1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from math import sqrt

a,b = map(int,input().split())
n = gcd(a,b)
k = n
s = set()
s.add(1)
for i in range(2,int(sqrt(n))+10**8):
  while n%i == 0:
    n = n//i
    s.add(i)
  if n == 1:
    break
if len(s) == 1 and k != 1:
  print(len(s)+1)
else:
  print(len(s))

Fixed submission:
from fractions import gcd
from math import sqrt

a,b = map(int,input().split())
n = gcd(a,b)
k = n
s = set()
s.add(1)
for i in range(2,int(sqrt(n))+1):
  while n%i == 0:
    n = n//i
    s.add(i)
  if n == 1:
    break
s.add(n)
print(len(s))
Buggy python submission (verdict: Runtime Error):
a = int(inpput())
print(a**3)

Fixed submission:
a = int(input())
print(a**3)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h_list = list(map(int,input().split()))
max = 0
ans = 0
for t in range(0,n):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if ans >= max:
      max = ans
  else:
    ans = 0
print(max)

Fixed submission:
n = int(input())
h_list = list(map(int,input().split()))
max = 0
ans = 0
for t in range(0,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if ans >= max:
      max = ans
  else:
    ans = 0
print(max)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h_list = list(map(int,input().split()))
ans_list =[]
ans = 0
for t in range(1,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if t == n-2:
      ans_list.append(ans)
  else:
    ans_list.append(ans)
    ans = 0
print(max(ans_list))

Fixed submission:
n = int(input())
h_list = list(map(int,input().split()))
max = 0
ans = 0
for t in range(0,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if ans >= max:
      max = ans
  else:
    ans = 0
print(max)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h_list = list(map(int,input().split()))
ans_list =[]
ans = 0
for t in range(a,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if t == n-2:
      ans_list.append(ans)
  else:
    ans_list.append(ans)
    ans = 0
print(max(ans_list))

Fixed submission:
n = int(input())
h_list = list(map(int,input().split()))
max = 0
ans = 0
for t in range(0,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if ans >= max:
      max = ans
  else:
    ans = 0
print(max)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h_list = list(map(int,input().split()))
ans_list =[]
ans = 0
t = 0
while t <= n-2:
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if t == n-2:
      ans_list.append(ans)
  else:
    ans_list.append(ans)
    ans = 0
  t += 1
print(max(ans_list))

Fixed submission:
n = int(input())
h_list = list(map(int,input().split()))
max = 0
ans = 0
for t in range(0,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if ans >= max:
      max = ans
  else:
    ans = 0
print(max)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s_list = [sorted(list(input())) for nesya in range(n)]
c = 0
for s in s_list:
  for a in s_list:
    if s == a:
      c += 1
print((c-n)//2)

Fixed submission:
n = int(input())
sl = [input() for nesya in range(n)]
sm = []
for s in sl:
  t = list(s)
  t.sort()
  sm.append(''.join(t))
d = dict()
for m in sm:
  if m in d:
    d[m] += 1
  else:
    d[m] = 1
c = 0
for v in d.values():
  c += v*(v-1)//2
print(c)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split)
d = b+c-a
if d<=0:
  print(0)
else:
  print(d)

Fixed submission:
a,b,c = map(int, input().split())
d = b+c-a
if d<=0:
  print(0)
else:
  print(d)
Buggy python submission (verdict: Runtime Error):
n = int(input())
hoge_list = list(map(int,input().split()))
h_list = hoge_list[::-1]
mae = h_list[-1]
s = 0
for h in h_list:
  if h <= mae:
    mae = h
  elif h-1 = mae:
    mae = h-1
  else:
    print('No')
    s += 1
    break
if s == 0:
  print('Yes')

Fixed submission:
n = int(input())
hoge_list = list(map(int,input().split()))
h_list = hoge_list[::-1]
mae = h_list[0]
s = 0
for h in h_list:
  if h <= mae:
    mae = h
  elif h-1 == mae:
    mae = h-1
  else:
    print('No')
    s += 1
    break
if s == 0:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
s = input()
sa = s.replace('LR','L,R')
sb = sa.split(',')
ans = ''
for hoge in sb:
  poge = len(sb)
  g = hoge.find('RL')
  if poge%2 == 0:
    r = poge//2
    l = poge//2
  else:
    if g%2 == 0:
      r = poge//2
      l = r + 1
    else:
      l = poge//2
      r = l + 1
  an = '0 '*(g-1)+str(r)+' '+str(l)+' 0'*(poge-g-1)+ ' '
  ans += an
print(ans)

Fixed submission:
s = input()
sa = s.replace('LR','L,R')
sb = sa.split(',')
ans = ''
for hoge in sb:
  poge = len(hoge)
  g = hoge.find('RL')
  if poge%2 == 0:
    r = poge//2
    l = poge//2
  else:
    if g%2 == 1:
      r = poge//2
      l = r + 1
    else:
      l = poge//2
      r = l + 1
  an = '0 '*(g)+str(r)+' '+str(l)+' 0'*(poge-g-2)+ ' '
  ans += an
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a_dic = dict()
a_set = set()
for num in a:
  if num in a_dic:
    a_dic[num] += 1
  else:
    a_dic[num] = 1
  a_set.add(num)
k = len(a_dic)
a_set = list(a_set)
if k == 1:
  if 0 in a_dic:
    if a_dic[0] == n:
      print('Yes')
      exit()
elif k == 2:
  if a_dic[0] == n/3 and a_dic(a_set[1]) == 2*n/3:
    print('Yes')
    exit()
elif k == 3:
  if a_set[0] ^ a_set[1] ^ a_set[2] == 0:
    if a_dic[a_set[0]] == a_dic[a_set[1]] == a_dic[a_set[2]] == n/3:
      print('Yes')
      exit()
print('No')

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a_dic = dict()
a_set = set()
for num in a:
  if num in a_dic:
    a_dic[num] += 1
  else:
    a_dic[num] = 1
  a_set.add(num)
k = len(a_dic)
a_set = list(a_set)
if k == 1:
  if 0 in a_dic:
    if a_dic[0] == n:
      print('Yes')
      exit()
elif k == 2:
  if a_dic[0] == n/3 and a_dic[a_set[1]] == 2*n/3:
    print('Yes')
    exit()
elif k == 3:
  if a_set[0] ^ a_set[1] ^ a_set[2] == 0:
    if a_dic[a_set[0]] == a_dic[a_set[1]] == a_dic[a_set[2]] == n/3:
      print('Yes')
      exit()
print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a_dic = dict()
a_set = set()
for num in a:
  if num in a_dic:
    a_dic[num] += 1
  else:
    a_dic[num] = 1
  a_set.add(num)
k = len(a_dic)
a_set = list(a_set)
if k == 1:
  if a_dic[0] == n:
    print('Yes')
    exit()
elif k == 2:
  if a_dic[0] == n/3 and a_dic(a_set[1]) == 2*n/3:
    print('Yes')
    exit()
elif k == 3:
  if a_set[0] ^ a_set[1] ^ a_set[2] == 0:
    if a_dic[a_set[0]] == a_dic[a_set[1]] == a_dic[a_set[2]] == n/3:
      print('Yes')
      exit()
print('No')

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a_dic = dict()
a_set = set()
for num in a:
  if num in a_dic:
    a_dic[num] += 1
  else:
    a_dic[num] = 1
  a_set.add(num)
k = len(a_dic)
a_set = list(a_set)
if k == 1:
  if 0 in a_dic:
    if a_dic[0] == n:
      print('Yes')
      exit()
elif k == 2:
  if a_dic[0] == n/3 and a_dic[a_set[1]] == 2*n/3:
    print('Yes')
    exit()
elif k == 3:
  if a_set[0] ^ a_set[1] ^ a_set[2] == 0:
    if a_dic[a_set[0]] == a_dic[a_set[1]] == a_dic[a_set[2]] == n/3:
      print('Yes')
      exit()
print('No')
Buggy python submission (verdict: Runtime Error):
s = input()
a = ''.join(sorted(s))
if a[1] == a[2] and a[3] == a[4] and a[1] != a[3]:
  print('Yes')
else:
  print('No')

Fixed submission:
s = input()
a = ''.join(sorted(s))
if a[0] == a[1] and a[2] == a[3] and a[0] != a[3]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
d_list = list(map(int,input().split()))
d = sorted(d_list)
g = n//2
f = d[g]
j = d[g+1]
print(j-f)

Fixed submission:
n = int(input())
d_list = list(map(int,input().split()))
d = sorted(d_list)
g = n//2
f = d[g-1]
j = d[g]
print(j-f)
Buggy python submission (verdict: Runtime Error):
w,h,x,y = map(int,input().split())
if w/x == 2 and h/y == 2:
  print(w*h/2,1)
else:
  print(w*h/2,0)

Fixed submission:
w,h,x,y = map(int,input().split())
if w == 2*x and h == 2*y:
  print(w*h/2,1)
else:
  print(w*h/2,0)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [int(input()) for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a[i]] = 0
for j in range(2,n+1):
  if hoge[j] == 0:
    continue
  else:
    hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j]%(10**9+7))

Fixed submission:
n,m = map(int,input().split())
a = [int(input()) for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a[i]] = 0
for j in range(1,n+1):
  if hoge[j] == 0:
    continue
  else:
    if j == 1:
      hoge[j] = hoge[j-1]
    else:
      hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a_list = [int(input()) 
          for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a_list[i]] = 0
for j in range(2,n+1):
  if hoge[j] == 0:
    continue
  else:
    hoge[j] = hoge[j-1] + hoge[j-2]
print(hoge[j]%(10**9+7))

Fixed submission:
n,m = map(int,input().split())
a = [int(input()) for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a[i]] = 0
for j in range(1,n+1):
  if hoge[j] == 0:
    continue
  else:
    if j == 1:
      hoge[j] = hoge[j-1]
    else:
      hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a_list = [int(input()) 
          for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a_list[i]] = 0
for j in range(2,n+1):
  if hoge[j] == 0:
    continue
  else:
    hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j])

Fixed submission:
n,m = map(int,input().split())
a = [int(input()) for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a[i]] = 0
for j in range(1,n+1):
  if hoge[j] == 0:
    continue
  else:
    if j == 1:
      hoge[j] = hoge[j-1]
    else:
      hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
import math

def fib(n):
    return round((((1+5**0.5)/2)**n-((1-5**0.5)/2)**n)/5**0.5)

n,m = map(int,input().split())
a_list = [int(input()) 
          for nesya in range(m)]
a_list.append(n+1)
ans = 1
mae = -1
for a in a_list:
  k = a-mae-1
  mae = a
  ans = (ans*int(fib(k)))%(10**9+7)
print(ans)
  

Fixed submission:
n,m = map(int,input().split())
a = [int(input()) for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a[i]] = 0
for j in range(1,n+1):
  if hoge[j] == 0:
    continue
  else:
    if j == 1:
      hoge[j] = hoge[j-1]
    else:
      hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j]%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = list(map(int,input().split()))
bcl = [list(map(int,input().split())) for nesya in range(m)]
for bc in bcl:
  a += [bc[1]]*bc[0]
a.sort(reverse=True)
print(sum(a[:n]))

Fixed submission:
n,m = map(int,input().split())
a = list(map(int,input().split()))
bcl = [list(map(int,input().split())) for nesya in range(m)]
bcl.sort(reverse=True,key=lambda x:x[1])
t = 0
for bc in bcl:
  t += bc[0]
  a += [bc[1]]*bc[0]
  if t > n:
    break
a.sort(reverse=True)
print(sum(a[:n]))
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n = map(int,input().split())
c = 0
for i in range(n//r+1):
  for j in range(n//g+1):
    k = (n-i*r-j*g)
    if k%b == 0 and k >= 0:
      c += 1
print(c)

Fixed submission:
r,g,b,n = map(int,input().split())
c = 0
for i in range(n//r+1):
  for j in range((n-i*r)//g+1):
    k = (n-i*r-j*g)
    if k%b == 0 and k >= 0:
      c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n = map(int,input().split())
c = 0
for i in range(n//r+1):
  for j in range(n//g+1):
    for k in range(n//b+1):
      if i*r + j*g + k*b == n:
        c += 1
print(c)

Fixed submission:
r,g,b,n = map(int,input().split())
c = 0
for i in range(n//r+1):
  for j in range((n-i*r)//g+1):
    k = (n-i*r-j*g)
    if k%b == 0 and k >= 0:
      c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n = map(int,input().split())
c = 0
for i in range(3001):
  for j in range(3001):
    for k in range(3001):
      if i*r + j*g + k*b == n:
        c += 1
print(c)

Fixed submission:
r,g,b,n = map(int,input().split())
c = 0
for i in range(n//r+1):
  for j in range((n-i*r)//g+1):
    k = (n-i*r-j*g)
    if k%b == 0 and k >= 0:
      c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
n = [int(input()) for hoge in range(5)]
c = 0
t = 0
a = []
while t < 5:
  if n[t]%10 == 0:
    c += n[t]
  else:
    c += (n[t]//10 + 1)*10
    a.append(n[t]%10)
  t += 1
c -= (10-min(a))
print(c)

Fixed submission:
n = [int(input()) for hoge in range(5)]
c = 0
t = 0
a = [10]
while t < 5:
  if n[t]%10 == 0:
    c += n[t]
  else:
    c += (n[t]//10 + 1)*10
    a.append(n[t]%10)
  t += 1
c -= (10-min(a))
print(c)
Buggy python submission (verdict: Runtime Error):
s = input()
if s = 'A':
  print('T')
elif s = 'T':
  print('A')
elif s = 'G':
  print('C')
else:
  print('G')

Fixed submission:
s = input()
if s == 'A':
  print('T')
elif s == 'T':
  print('A')
elif s == 'G':
  print('C')
else:
  print('G')
Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = input()
lr_list = [list(map(int,input().split())) for nesya in range(q)]
ac_set = set()
t = s.replace('AC',' AC')
s_list = list(t.split(' '))
c = len(s_list.pop(0))+1
ac_set.add(c)
for hoge in s_list:
  c += len(hoge)
  ac_set.add(c)
for lr in lr_list:
  ans = 0
  for i in range(lr[0],lr[1]):
    if i in ac_set:
      ans += 1
  print(ans)

Fixed submission:
n,q = map(int,input().split())
s = input()
lr_list = [list(map(int,input().split())) for nesya in range(q)]
hoge = [0]*(n+1)
for i in range(n):
  hoge[i+1] = hoge[i] + (1 if s[i:i+2] == 'AC' else 0)
for lr in lr_list:
  l = lr[0]
  r = lr[1]
  print(hoge[r-1] - hoge[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = input()
lr_list = [list(map(int,input().split())) for nesya in range(q)]
for lr in lr_list:
  hoge = s[lr[0]-1:lr[1]]
  print(hoge.count('AC'))

Fixed submission:
n,q = map(int,input().split())
s = input()
lr_list = [list(map(int,input().split())) for nesya in range(q)]
hoge = [0]*(n+1)
for i in range(n):
  hoge[i+1] = hoge[i] + (1 if s[i:i+2] == 'AC' else 0)
for lr in lr_list:
  l = lr[0]
  r = lr[1]
  print(hoge[r-1] - hoge[l-1])
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input())
if b%a == 0:
  print(a+b)
else:
  print(b-a)

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