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

Fixed submission:
n,a,b = map(int,input().split())
m = 10**9+7

def nCr(n_, r_, m_):
  c = min(r_ , n_ - r_)
  bunshi = 1
  bunbo = 1
  for i in range(1,c+1):
    bunshi = bunshi * (n_+1-i) % m_
    bunbo = bunbo * i % m_
  return bunshi * pow(bunbo, m_-2, m_) % m_


ans = pow(2,n,m)-1
ans -= nCr(n,a,m)
ans %= m
ans -= nCr(n,b,m)
ans %= m
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
m = 10**9+7

def nCr(n_, r_, m_):
  c = min(r_ , n_ - r_)
  bunshi = 1
  bunbo = 1
  for i in range(1,c+1):
    bunshi = bunchi * (n_+1-i) % m_
    bunbo = bunbo * i % m_
  return bunshi * pow(bunbo, m_-2, m_) % m_


ans = pow(2,n,m)-1
ans -= nCr(n,a,m)
ans %= m
ans -= nCr(n,b,m)
ans %= m
print(ans)
Problem p02784 (python)

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 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')
Problem p02789 (python)

Fixed submission:
a,b = map(int, input().split())
if a == b:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a == b:
  print('Yes')
else:
  print('No)
Problem p02801 (python)

Fixed submission:
a = input()
b = chr(ord(a) + 1)
print(b)

Buggy submission (verdict: Runtime Error):
a = input()
print chr(ord(a) + 1)
Problem p02802 (python)

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 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)
Problem p02803 (python)

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 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)
Problem p02806 (python)

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 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)
Problem p02866 (python)

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 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)
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if 2b >= a:
  print(0)
else:
  print(a - 2*b)
Problem p02923 (python)

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 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)

Buggy 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))

Buggy 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))

Buggy 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))
Problem p02953 (python)

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 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')
Problem p02975 (python)

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 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')

Buggy 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')
Problem p03001 (python)

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 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)
Problem p03076 (python)

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 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)
Problem p03085 (python)

Fixed submission:
s = input()
if s == 'A':
  print('T')
elif s == 'T':
  print('A')
elif s == 'G':
  print('C')
else:
  print('G')

Buggy submission (verdict: Runtime Error):
s = input()
if s = 'A':
  print('T')
elif s = 'T':
  print('A')
elif s = 'G':
  print('C')
else:
  print('G')
Problem p03125 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int, input())
if b%a == 0:
  print(a+b)
else:
  print(b-a)
Problem p03140 (python)

Fixed submission:
n = int(input())
ans = 0
a = input()
b = input()
c = input()
for i in range(n):
  if a[i] == b[i] == c[i]:
    pass
  elif a[i] == b[i] or a[i] == c[i] or b[i] == c[i]:
    ans += 1
  else:
    ans += 2
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
a = input()
b = input()
c = input()
for i in n:
  if a[i] == b[i] == c[i]:
    pass
  elif a[i] == b[i] or a[i] == c[i] or a[i] == c[i]:
    ans += 1
  else:
    ans += 2
print(ans)
Problem p03238 (python)

Fixed submission:
n = int(input())
if n==1:
  print('Hello World')
else:
  a = int(input())
  b = int(input())
  print(a+b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
if n==1:
  print('Hello World')
else:
  print(a+b)
Problem p03273 (python)

Fixed submission:
h,w = map(int,input().split())
a_list = [input() for nesya in range(h)]

gyo = [False]*h
retsu = [False]*w
for i in range(h):
  for j in range(w):
    if a_list[i][j] == '#':
      gyo[i] = True
      retsu[j] = True
for k in range(h):
  if gyo[k]:
    for l in range(w):
      if retsu[l]:
        print(a_list[k][l], end='')
    print()

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
a_list = [input() for nesya in range(h)]

gyo = [False]*h
retsu = [False]*w
for i in range(h):
  for j in range(w):
    if a_list[i][j] == '#':
      gyo[i] = True
      retsu[j] = True
for k range(h):
  if gyo[k]:
    for l in range(w):
      if retsu[l]:
        print(a_list[k][l], end='')
    print()
Problem p03293 (python)

Fixed submission:
s = input()
t = input()
c = 0
a_list =[]
while c < len(t):
  a_list.append(t)
  a = t[1:]+t[0:1]
  t = a
  c += 1
if s in a_list:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
c = 0
a_list =[]
while c < len(t):
  a_list.append(t)
  a = t.pop(0)
  t.append(a)
  c += 1
if s in a_list:
  print('Yes')
else:
  print('No')
Problem p03303 (python)

Fixed submission:
s = input()
w = int(input())
a = ''
if len(s)%w == 0:
  b = len(s)//w
else:
  b = len(s)//w+1

for i in range(b):
  a += s[i*w]
print(a)

Buggy submission (verdict: Runtime Error):
s = input()
w = int(input())
a = ''
for i in range(int(len(s)/w)+1):
  a += s[i*w]
print(a)

Buggy submission (verdict: Runtime Error):
s = input()
w = int(input())
a = ''
for i in range(int(len(s)/w)+1):
  a += s[i*3]
print(a)
Problem p03316 (python)

Fixed submission:
n = int(input())
sum = 0
t = n

while t > 0:
  sum += t%10
  t //= 10
if n%sum == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
sum = 0
tmp = n

while tmp > 0:
    sum += tmp % 10
    tmp /= 10

if n % sum == 0:
    print "Yes"
else:
    print "No"
Problem p03386 (python)

Fixed submission:
a,b,k = map(int,input().split())
if b+2 <= a+2*k:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,a+k):
    print(i)
  for i in range(b+1-k,b+1):
    print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a>b or k == 0:
  print('')
elif a+k-1 < b-k+1:
  s = c+d
  ans_list = sorted(set(s))
else:
  ans_list = e
for num in ans_list:
  print(num)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a>b:
  print('')
elif a == b:
  print(a)
elif a+k-1 < b-k+1:
  s = c+d
  ans_list = sorted(set(s))
else:
  ans_list = e
for num in ans_list:
  print(num)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
s = c+d
ans_list = sorted(set(s))
for num in ans_list:
  print(num)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a+k-1 < b-k+1:
  s = c+d
  ans_list = sorted(set(s))
else:
  ans_list = e
for num in ans_list:
  print(num)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a+k-1 < b-k+1:
  s = c+d
  ans_list = set(s)
else:
  ans_list = e
for num in ans_list:
  print(num)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a+k-1 < b-k+1:
  ans_list = c+d
else:
  ans_list = e
for num in ans_list:
  print(num)
Problem p03393 (python)

Fixed submission:
s = input()
k = 'abcdefghijklmnopqrstuvwxyz'
if len(s) < 26:
  for v in k:
    if not v in s:
      print(s+v)
      exit()
if s == k[::-1]:
  print(-1)
  exit()
for i in range(1,len(s)+1):
  t = s[-i:]
  if t != ''.join(sorted(t, reverse=True)):
    t = t[1:]
    break
for p in t[::-1]:
  if p > s[-i]:
    print(s[:-i]+p)
    exit()

Buggy submission (verdict: Runtime Error):
s = input()
wl = [chr(i) for i in range(97,123)]
hoge = 'zyxwvutsrqponmlkjihgfedcba'
if s == hoge:
  print(-1)
  exit()
if len(s) < 26:
  for w in wl:
    if not w in s:
      s += w
      print(s)
      exit()
else:
  for i in range(26):
    for j in range(ord(s[-i-1])+1, 97+26):
      if chr(j) not in s[:-i-1]:
        print(S[:-i-1] + chr(j))

Buggy submission (verdict: Runtime Error):
s = input()
wl = [chr(i) for i in range(97,123)]
if len(s) < 26:
  for w in wl:
    if not w in s:
      s += w
      print(s)
      exit()
else:
  for i in range(26):
    if s[i] != wl[26-i]:
      s = s[:i] + chr(ord(s[i])+1)
      print(s)
      exit()
print(-1)
Problem p03424 (python)

Fixed submission:
n = int(input())
s_list = list(input().split())
if 'Y' in s_list:
  print('Four')
else:
  print('Three')

Buggy submission (verdict: Runtime Error):
n = int(input())
s_list = list(map(int,input().split()))
if 'Y' in s_list:
  print('Four')
else:
  print('Three')
Problem p03434 (python)

Fixed submission:
n = int(input())
a_list = list(map(int,input().split()))
s_a_list = sorted(a_list)
alice = 0
bob = 0
while len(s_a_list)>1:
  alice += s_a_list.pop(-1)
  bob += s_a_list.pop(-1)
if len(s_a_list) != 0:
  alice += s_a_list.pop(-1)
print(alice-bob)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int,input().split()))
s_a_list = sorted(a_list)
alice = 0
bob = 0
while len(s_a_list)>0:
  alice += s_a_list.pop(-1)
  bob += s_a_list.pop(-1)
print(alice-bob)
Problem p03437 (python)

Fixed submission:
x,y = map(int,input().split())
if x%y == 0:
  print(-1)
else:
  print(x)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input())
if x%y == 0:
  print(-1)
else:
  print(x)
Problem p03469 (python)

Fixed submission:
s = input()
print(s[:3]+str(8)+s[4:])

Buggy submission (verdict: Runtime Error):
s = input()
print(s[:3]+8+s[4:])
Problem p03474 (python)

Fixed submission:
a,b = map(int,input().split())
s = input()
hoge = s[a]
s =s[:a]+s[a+1:]
if s.isdigit() == True and hoge == '-':
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a b = map(int,input().split())
s = input()
hoge = s.pop(a)
if s.isdigit() == True and hoge == '-':
  print('Yes')
else:
  print('No')
Problem p03478 (python)

Fixed submission:
n,a,b = map(int,input().split())
t = 1
ans = 0
while t <=n:
  s = sum(list(map(int, str(t))))
  if a <= s <= b:
    ans += t
  t += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
t = 1
ans = 0
while t <=n:
  a = str(t)
  b = list(map(int,a))
  s = sum(b)
  if a <= s <= b:
    ans += s
print(ans)
Problem p03547 (python)

Fixed submission:
x,y = input().split()
if ord(x) < ord(y):
  print('<')
elif ord(x) > ord(y):
  print('>')
else:
  print('=')

Buggy submission (verdict: Runtime Error):
x,y = map(input().split())
if ord(x) < ord(y):
  print('<')
elif ord(x) > ord(y):
  print('>')
else:
  print('=')
Problem p03563 (python)

Fixed submission:
r = int(input())
g = int(input())
print(2*g-r)

Buggy submission (verdict: Runtime Error):
r = int(input())
g = int(input())
print(2g-r)
Problem p03578 (python)

Fixed submission:
n = int(input())
dl = list(map(int,input().split()))
m = int(input())
tl = list(map(int,input().split()))
d_dic = dict()
t_dic = dict()
for d in dl:
  if d in d_dic:
    d_dic[d] += 1
  else:
    d_dic[d] = 1
for t in tl:
  if t in t_dic:
    t_dic[t] += 1
  else:
    t_dic[t] = 1
for v in t_dic.keys():
  if not v in d_dic.keys():
    print('NO')
    exit()
  if t_dic[v] > d_dic[v]:
    print('NO')
    exit()
print('YES')

Buggy submission (verdict: Runtime Error):
n = int(input())
dl = list(map(int,input().split()))
m = int(input())
tl = list(map(int,input().split()))
d_dic = dict()
t_dic = dict()
for d in dl:
  if d in d_dic:
    d_dic[d] += 1
  else:
    d_dic[d] = 1
for t in tl:
  if t in t_dic:
    t_dic[t] += 1
  else:
    t_dic[t] = 1
for v in t_dic.keys():
  if t_dic[v] > d_dic[v]:
    print('NO')
    exit()
print('YES')
Problem p03592 (python)

Fixed submission:
n,m,k = map(int,input().split())
for a in range(n+1):
  for b in range(m+1):
    if k == a*m+b*n-2*a*b:
      print('Yes')
      exit()
print('No')

Buggy submission (verdict: Runtime Error):
n,m,k = map(int,input().split())
for a in range(n+1):
  for b in range(m+1):
    if k = a*m+b*n-2*a*b:
      print('Yes')
      exit()
print('No')
Problem p03610 (python)

Fixed submission:
s = input()
n = len(s)
ans =''
i = 0
while i < n:
  ans += s[i]
  i += 2
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = 0
ans =''
while t <= len(s):
  ans += s[t]
  t += 2
print(ans)
Problem p03611 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
h = [0]*(10**5+2)
for i in l:
  h[i+1] += 1
  h[i] += 1
  h[i+2] += 1
print(max(h))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
h = [0]*(10**5+1)
for i in l:
  h[i+1] += 1
  h[i] += 1
  h[i+2] += 1
print(max(h))
Problem p03623 (python)

Fixed submission:
x,a,b = map(int, input().split())
if abs(a-x) < abs(b-x):
  print('A')
else:
  print('B')

Buggy submission (verdict: Runtime Error):
x,a,b = map(int, input().split)
if abs(a-x) < abs(b-x):
  print('A')
else:
  print('B')
Problem p03637 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
odd = 0
even4 = 0
for num in a:
  if num%2 == 1:
    odd += 1
  elif num%4 == 0:
    even4 += 1
if odd + even4 == n and even4 >= odd-1:
  print('Yes')
elif even4 >= odd:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
odd = 0
even4 = 0
for num in a:
  if num%2 == 1:
    odd += 1
  elif num%4 == 0:
    even4 += 1
if odd + even4 == n and even >= odd-1:
  print('Yes')
elif even4 >= odd1:
  print('Yes')
else:
  print('No')
Problem p03658 (python)

Fixed submission:
n,k = map(int,input().split())
l_list = list(map(int,input().split()))
s_l_list = sorted(l_list,reverse = True)
ans_list = s_l_list[:k]
print(sum(ans_list))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
l_list = list(map(int,input().split()))
s_l_list = sorted(l_list,reverse = True)
ans_list = a_l_list[:k]
print(sum(ans_list))
Problem p03719 (python)

Fixed submission:
a,b,c = map(int, input().split())
if a <= c <= b:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if a <= b <= d:
  print('Yes')
else:
  print('No')
Problem p03729 (python)

Fixed submission:
a,b,c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c = input().split
if a[-1] == b[1] and b[-1] == c[1]:
  print('YES')
else:
  print('NO')
Problem p03760 (python)

Fixed submission:
o = input()
e = input()
ans = ''
n = len(o)
a = 0
while a < n:
  ans += o[a]
  if a+1 <= len(e):
    ans += e[a]
  a += 1
print(ans)

Buggy submission (verdict: Runtime Error):
o = input()
e = input()
ans = ''
n = len(o)
a = 0
while a < n:
  ans += o[a]
  if a <= len(e):
    ans += e[a]
  a += 1
print(ans)
Problem p03813 (python)

Fixed submission:
a = int(input())
if a<1200:
  print('ABC')
else:
  print('ARC')

Buggy submission (verdict: Runtime Error):
a = int(input())
if a<1200:
  pirnt('ABC')
else:
  print('ARC')
Problem p03838 (python)

Fixed submission:
x,y = map(int,input().split())
k = abs(abs(x)-abs(y))
if x < 0 and y <= 0 or x >= 0 and y > 0:
  if x > y:
    k += 2
else:
  k += 1
print(k)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
k = abs(abs(x)-abs(y))
if x < 0 and y <= 0 or x >= 0 and y > 0:
  if x > y:
    ans += 2
else:
  ans += 1
print(ans)