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

Fixed submission:
import heapq

n=int(input())
a=[-int(x) for x in input().split()]

heapq.heapify(a)
ans=heapq.heappop(a)
n-=1

while True:
    n-=1
    if n==0:
        break
    temp=heapq.heappop(a)
    ans+=temp
    n-=1
    if n==0:
        break
    ans+=temp



print(-ans)

Buggy submission (verdict: Runtime Error):
import heapq

n=int(input())
a=[-int(x) for x in input().split()]

heapq.heapify(a)
ans=heapq.heappop(a)
n-=2

while True:
    temp=heapq.heappop(a)
    ans+=temp
    n-=1
    if n==0:
        break
    ans+=temp
    n-=1
    if n==0:
        break


print(-ans)
Problem p02644 (python)

Fixed submission:
#G
import pprint
H,W,K=map(int,input().split())
import copy
x1,y1,x2,y2=map(int,input().split())
#raw=["#"]+["."]*(601)+["#"]
lastraw=["@"]*(W+2)
field=[["@"]*(W+2)]
for i in range(H):
  field.append(["@"]+list(input())+["@"])

field.append(lastraw)

#print(field)

goal_point=(y2,x2)

[sy,sx]=[y1,x1]
[gy,gx]=[y2,x2]

field[x1][y1]=0
queue=[[sy,sx]]
tests = ((-1,0),(0, 1),(1, 0),(0, -1))
moves=0

while True:
  if len(queue)==0:
    moves=-1
    break
  queue_next = []
  moves += 1
  #pprint.pprint(field)
  for y, x in queue:
    for ny, nx in tests:
      ty, tx = y + ny, x + nx
      if field[tx][ty] == '.':
        field[tx][ty] = moves
        queue_next.append((ty, tx))
        #print(ty,tx)
        for i in range(K-1):
          ty, tx = ty + ny, tx + nx
          if field[tx][ty] == '.':
            field[tx][ty] = moves
            queue_next.append((ty, tx))
            #print(ty,tx)
          elif field[tx][ty] ==moves:
            pass
          else:
            break
      elif field[tx][ty] ==moves:
        #field[tx][ty] = moves
        #queue_next.append((ty, tx))
        #print(ty,tx)
        for i in range(K-1):
          ty, tx = ty + ny, tx + nx
          if field[tx][ty] == '.':
            field[tx][ty] = moves
            queue_next.append((ty, tx))
            #print(ty,tx)
          elif field[tx][ty] ==moves:
            pass
          else:
            break
  queue = queue_next
  if goal_point in queue:
    break
#pprint.pprint(field)
print(moves)

Buggy submission (verdict: Runtime Error):
#G
import pprint
H,W,K=map(int,input().split())
import copy
x1,y1,x2,y2=map(int,input().split())
#raw=["#"]+["."]*(601)+["#"]
lastraw=["@"]*(W+2)
field=[["@"]*(W+2)]
for i in range(H):
  field.append(["@"]+list(input())+["@"])

field.append(lastraw)

#print(field)

goal_point=(y2,x2)

[sy,sx]=[y1,x1]
[gy,gx]=[y2,x2]

field[x1][y1]=0
queue=[[sy,sx]]
tests = ((-1,0),(0, 1),(1, 0),(0, -1))
moves=0

while True:
  if len(queue)==0:
    moves=-1
    break
  queue_next = []
  moves += 1
  #pprint.pprint(field)
  for y, x in queue:
    for ny, nx in tests:
      ty, tx = y + ny, x + nx
      if field[tx][ty] == '.' or field[tx][ty] ==moves:
        field[tx][ty] = moves
        queue_next.append((ty, tx))
        #print(ty,tx)
        for i in range(K-1):
          ty, tx = ty + ny, tx + nx
          if field[tx][ty] == '.':
            field[tx][ty] = moves
            queue_next.append((ty, tx))
            #print(ty,tx)
          elif field[tx][ty] ==moves:
            pass
          else:
            break
      elif field[tx][ty] ==moves:
        #field[tx][ty] = moves
        #queue_next.append((ty, tx))
        #print(ty,tx)
        for i in range(K-1):
          ty, tx = ty + ny, tx + nx
          if field[tx][ty] == '.':
            #field[tx][ty] = moves
            #queue_next.append((ty, tx))
            #print(ty,tx)
          elif field[tx][ty] ==moves:
            pass
          else:
            break
  queue = queue_next
  if goal_point in queue:
    break
#pprint.pprint(field)
print(moves)
Problem p02683 (python)

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

import numpy as np

A=[]
B=[]

for i in range(N):
  A.append(list(map(int,input().split())))


C=[]
temp=[0 for i in range(N)]

for i in range(2**N):
  for j in range(N):
    if (i >> j) & 1:
      temp[j]=1
    else:
      temp[j]=0
  tempE=[0 for i in range(M+1)]
  for k in range(N):
    x = np.array(tempE)
    y = np.array([A[k][j]*temp[k] for j in range(M+1)])
    tempE=x+y
  C.append(tempE)


tempC=float('inf')
for i in range(2**N):
  tempD=min(C[i][1:M+1])
  if tempD>=X:
    tempC=min([tempC,C[i][0]])

if tempC==float('inf'):
  tempC=-1

print(tempC)

Buggy submission (verdict: Runtime Error):
N,M,X=map(int, input().split())

import numpy as np

A=[]
B=[]

for i in range(N):
  A.append(list(map(int,input().split())))

#for i in range(M):
#  B.append([A[j][i] for j in range(N)])

C=[]
temp=[0 for i in range(N)]

for i in range(2**N):
  for j in range(N):
    if (i >> j) & 1:
      temp[j]=1
    else:
      temp[j]=0
  tempE=[0 for i in range(M+1)]
  for k in range(N):
    x = np.array(tempE)
    y = np.array([A[k][j]*temp[k] for j in range(M+1)])
    tempE=x+y
  C.append(tempE)


tempC=float('inf')
for i in range(2**N):
  tempD=min(C[i][1:M+1])
  if tempD>=X:
    tempC=min([tempC,C[i][0]])

if tempC==float('inf'):
  tempC=-1

print(tempC)
Problem p02684 (python)

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

A0=list(range(N))

def calc_zero(n):
    return n * 0

A0 = list(map(calc_zero, A0))

temp=0
tempv=[]

for i in range(K):
  if A0[temp]>=1:
    loop=i-A0[temp]
    t=(K-A0[temp])%loop
    temp=tempv[A0[temp]+t-1]
    break
  else:
    A0[temp]=i
    temp=A[temp]-1
    tempv.append(temp)

print(temp+1)

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

A0=list(range(N))
temp=0

for i in range(N):
  temp=A[temp]
#  print(temp)

print(temp)
Problem p02778 (python)

Fixed submission:
S=input()
l=len(S)

X='x'*l
X=str(X)

print(X)

Buggy submission (verdict: Runtime Error):
S,T=map(str, input().split())
A,B=map(int,input().split())
U=input()

if S==U:
  a=1
  b=0
else:
  a=0
  b=1

print(A-a,B-b)
Problem p03136 (python)

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

a=max(L)
b=sum(L)-a

if a>=b:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int, input().split()))

a=max(L)
b=sum(L)-a

if a>=B:
  print('No')
else:
  print('Yes')
Problem p03160 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
 
dp=list(range(0,n))
dp[0]=0
dp[1]=abs(A[1]-A[0])
for i in range(n-2):
  temp1=dp[i]+abs(A[i+2]-A[i])
  temp2=dp[i+1]+abs(A[i+2]-A[i+1])
  dp[i+2]=min(temp1,temp2)
 
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(input(int,input().split()))
 
dp=list(range(0,n))
dp[0]=0
dp[1]=abs(A[1]-A[0])
for i in range(n-2):
  temp1=dp[i]+abs(A[i+2]-A[i])
  temp2=dp[i+1]+abs(A[i+2]-A[i+1])
  dp[i+2]=min(temp1,temp2)
 
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
A=[int,input().split()]

dp=list(range(0,n))
dp[0]=0
dp[1]=abs(A[1]-A[0])
for i in range(n-2):
  temp1=dp[i]+abs(A[i+2]-A[i])
  temp2=dp[i+1]+abs(A[i+2]-A[i+1])
  dp[i+2]=min(temp1,temp2)

print(dp[n-1])
Problem p03161 (python)

Fixed submission:
n,k=map(int,input().split())
A=list(map(int,input().split()))

if k>=n:
  print(abs(A[n-1]-A[0]))
else:
  dp=list(range(n))
  for i in range(k):
    dp[i]=abs(A[i]-A[0])
  for i in range(n-k):
    temp=list(range(k))
    for j in range(k):
      temp[j]=dp[i+j]+abs(A[i+k]-A[i+j])
    dp[i+k]=min(temp)
  print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=list(map(int,input().split()))


if k>=n:
  print(abs(A[k-1]-A[0]))
else:
  dp=list(range(n))
  for i in range(k):
    dp[i]=abs(A[i]-A[0])
  for i in range(n-k):
    temp=list(range(k))
    for j in range(k):
      temp[j-1]=dp[i]+abs(A[i+k]-A[i])
      dp[i+k]=min(temp)
  print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k=map(int(input()).split())
A=list(map(int,input().split()))


if k>=n:
  print(abs(A[k-1]-A[0]))
else:
  dp=list(range(n))
  for i in range(k):
    dp[i]=abs(A[i]-A[0])
  for i in range(n-k):
    temp=list(range(k))
    for j in range(k):
      temp[j-1]=dp[i]+abs(A[i+k]-A[i])
      dp[i+k]=min(temp)
  print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=list(map(int,input().split()))


if k>=n:
  print(abs(A[k-1]-A[0]))
else:
  dp=list(range(n))
  for i in range(k):
    dp[i]=abs(A[i]-A[0])
  for i in range(n-k):
    temp=list(range(k))
    for j in range(k):
      temp[j-1]=dp[i]+abs(A[i+k]-A[i])
      dp[i+k]=min(temp)
  print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=list(map(int,input().split()))


if k>=n:
  print(abs(A[k-1]-A[0]))
else:
  dp=list(range(n))
  for i in range(k):
    dp[i]=abs(A[i]-A[0])
  for i in range(n-k):
    temp=list(range(k))
    for j in range(k):
      temp[j-1]=dp[i]+abs(A[i+k]-A[i])
      dp[i+k]=min(temp1,temp2)
  print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k=map(int(input()).split())
A=list(map(int,input().split()))


if k>=n:
  print(abs(A[k-1]-A[0]))
else:
  dp=list(range(n))
  for i in range(k):
    dp[i]=abs(A[i]-A[0])
  for i in range(n-k):
    temp=list(range(k))
    for j in range(k):
      temp[j-1]=dp[i]+abs(A[i+k]-A[i])
      dp[i+k]=min(temp1,temp2)
  print(dp[n-1])
Problem p03557 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=[]
a.sort()
b.sort()
c.sort()
def binary_search1(list,item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if low == high:
            if guess >= item:
                return mid
            else:
                return mid +1
        if guess >= item:
            high = mid
        else:
            low = mid + 1

def binary_search2(list,item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if low == high:
            if guess > item:
                return n-mid
            else:
                return n-1-mid
        if guess > item:
            high = mid
        else:
            low = mid + 1

ans=0
#print(a,b,c)
for i in range(n):
    #print(binary_search1(a,b[i]),binary_search2(c,b[i]),i)
    ans+=binary_search2(c,b[i])*binary_search1(a,b[i])

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=[]
a.sort()
b.sort()
c.sort()
def binary_search(list,item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return guess+1
        if guess > item:
            if high == low:
                return high
            high = mid
        else:
            if high == low:
                return high + 1
            low = mid+1

def binary_search2(list,item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            if guess!=n-1:
                return d[guess+1]
            else:
                return 0
        if guess > item:
            if high == low:
                return d[high]
            high = mid
        else:
            if high == low:
                if high!=n-1:
                    return d[high+1]
                else:
                    return 0
            low = mid+1

for i in range(n):
    print(binary_search(c,b[i]))
    d.append(n-binary_search(c,b[i]))
print(d)
d.reverse()
import numpy
d=numpy.cumsum(d)
d=list(d)
d.reverse()
print(d)
ans=0

for i in range(n):
    ans+=binary_search2(b,a[i])

print(ans)
Problem p02639 (python)

Fixed submission:
li = list(map(int, input().split()))
for i in range(len(li)):
    if li[i]==0:
        print(i+1)

Buggy submission (verdict: Runtime Error):
X,N = map(int,input().split())
p = list(map(int, input().split())) 


for i in range(1,N+1):
    a = X+i
    b = X-i
    if b not in p:
        print(b)
        break
    elif a not in p:
        print(a)
        break

if N==0:
    print(X)
Problem p02608 (python)

Fixed submission:
import math

n = int(input())
a = [0]*100001
b = math.ceil(math.sqrt(n)) + 1
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            ans = ((i + j) ** 2 + (j + k) ** 2 + (k + i) ** 2) //2
            a[ans] += 1

for i in range(1,n+1):
    print(a[i])

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
a = [0]*10001
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            ans = ((i + j) ** 2 + (j + k) ** 2 + (k + i) ** 2) //2
            a[ans] += 1

for i in range(1,n+1):
    print(a[i])

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
a = [0]*10001
b = math.ceil(math.sqrt(n)) + 1
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            ans = ((i + j) ** 2 + (j + k) ** 2 + (k + i) ** 2) //2
            a[ans] += 1

for i in range(1,n+1):
    print(a[i])

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
a = [0]*10001
b = int(math.sqrt(n)) + 2
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            ans = ((i + j) ** 2 + (j + k) ** 2 + (k + i) ** 2) //2
            a[ans] += 1

for i in range(1,n+1):
    print(a[i])
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
m = 1
for i in range(n):
    if a[i] == 0:
        m = 0
        print("0")

if m == 1:
    for j in range(n):
        m = m * a[j]
        if m > 10**18:
            break
    if m > 10**18:
        print("-1")
    else:
        print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
m = 1
k = a.index(“B”)
if k == 0:
    print("0")
else:
    for i in range(n):
        m = m * int(a[i])
        if m > 10**18:
        break
    if m > 10**18:
        print("-1")
    else:
        print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
m = 1
for i in range(n):
    m = m * a[i]
    if m = 0:
        break
    

if m > 10**18:
    print("-1")
else:
    print(m)
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m = map(float, input().split())
rot = 5.5 * (60.0*h + m)
ang = rot%360
rad = ang * math.pi / 180
cal = a ** 2 + b ** 2 - 2 * a * b * math.cos(rad)
ans = math.sqrt(cal)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,h,m = map(float, input().split())
rot = 5.5 * (60.0*h + m)
rad = ang * math.pi / 180
cal = a ** 2 + b ** 2 - 2 * a * b * math.cos(rad)
ans = math.sqrt(cal)
print(ans)
Problem p02945 (python)

Fixed submission:
s = list(map(int,input().split()))
t = max(s[0]+s[1],s[0]-s[1],s[0]*s[1])
print(t)
'''
print('A+B={0},A-B={1},A*B={2},A/B={3}の中で最大の数{4}はです'.format(s[0]+s[1],s[0]-s[1],s[0]*s[1],s[0]/s[1],t))
'''

Buggy submission (verdict: Runtime Error):
s = list(map(int,input().split()))
t = max(s[0]+s[1],s[0]-s[1],s[0]*s[1],s[0]/s[1])
print(t)

Buggy submission (verdict: Runtime Error):
s = list(map(int,input().split()))
t = max(s[0]+s[1],s[0]-s[1],s[0]*s[1],s[0]/s[1])
print(t)
print('A+B={0},A-B={1},A*B={2},A/B={3}の中で最大の数{4}はです'.format(s[0]+s[1],s[0]-s[1],s[0]*s[1],s[0]/s[1],t))

Buggy submission (verdict: Runtime Error):
s = list(map(int,input().split()))
t = max(s[0]+s[1],s[0]-s[1],s[0]*s[1],s[0]/s[1])
print(t)
print('A+B={0},A-B={1},A*B={2},A/B={3}の中で最大の数{4}はです'.format(s[0]+s[1],s[0]-s[1],s[0]*s[1],s[0]/s[1],t))
Problem p03436 (python)

Fixed submission:
from collections import deque
import itertools
def bfs(G,visited,sy,sx):
    queue=deque([[sy,sx]])
    visited[sy][sx]=0
    while queue:
        y,x=queue.popleft()
        if (y,x)== (H-1,W-1):
            return visited[y][x]
        for j,k in ([1,0],[0,1],[-1,0],[0,-1]):
            tmp_y,tmp_x = y+j,x+k
            if 0<=tmp_y<=H-1 and 0<=tmp_x<=W-1 and  G[tmp_y][tmp_x]!='#':
                if visited[tmp_y][tmp_x]==-1:
                    visited[tmp_y][tmp_x]=visited[y][x]+1
                    queue.append([tmp_y,tmp_x])
    return -1
if __name__  =="__main__":
    H,W =map(int,input().split())
    G=[list(input()) for _ in range(H)]
    sy,sx =0,0
    dist=0
    visited=[[-1]*W for _ in range(H)]
    dist=bfs(G,visited,sy,sx)
    if dist==-1:
        print(-1)
    else:
        print(list(itertools.chain.from_iterable(G)).count('.')-dist-1)

Buggy submission (verdict: Runtime Error):
from collections import deque
import itertools
def bfs(G,visited,sy,sx):
    queue=deque([[sy,sx]])
    visited[sy][sx]=0
    while queue:
        y,x=queue.popleft()
        if (y,x)== (H-1,W-1):
            return visited[y][x]
        for j,k in ([1,0],[0,1],[-1,0],[0,-1]):
            tmp_y,tmp_x = y+j,x+k
            if 0<=tmp_y<=H-1 and 0<=tmp_x<=W-1 and  G[tmp_y][tmp_x]!='#':
                if visited[tmp_y][tmp_x]==-1:
                    visited[tmp_y][tmp_x]=visited[y][x]+1
                    queue.append([tmp_y,tmp_x])
if __name__  =="__main__":
    H,W =map(int,input().split())
    G=[list(input()) for _ in range(H)]
    sy,sx =0,0
    dist=0
    tmp=0
    visited=[[-1]*W for _ in range(H)]
    dist=bfs(G,visited,sy,sx)
    print(list(itertools.chain.from_iterable(G)).count('.')-dist-1)
Problem p03624 (python)

Fixed submission:
S=list(input())
l=sorted(list(set(S)))
for (i,j) in zip(range(len(l)),range(97,97+26)):
    if chr(j) !=l[i]:
        print(chr(j))
        exit()
    elif chr(j) == 'z':
        print('None')
        exit()
print(chr(j+1))

Buggy submission (verdict: Runtime Error):
S=list(input())
l=sorted(list(set(S)))
for i in range(97,97+26):
    if chr(i) !=l.pop(0):
        print(chr(i))
        break
    elif chr(i) == 'z':
        print('None')

Buggy submission (verdict: Runtime Error):
S=list(input())
l=sorted(list(set(S)))
for i in range(97,97+26):
    if chr(i) !=l.pop(0):
        print(chr(i))
        break
Problem p03712 (python)

Fixed submission:
H,W = map(int,input().split())
l=[]
for i in range(H):
    l.append(input())
print('#'*(W+2))
for i in range(H):
    print('#'+l[i]+'#')
print('#'*(W+2))

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
l=[]
for i in range(2):
    l.append(input())
print('#'*(W+2))
for i in range(H):
    print('#'+l[i]+'#')
print('#'*(W+2))
Problem p03760 (python)

Fixed submission:
O=input()
E=input()
s=''
if len(O)==len(E):
    for i in range (len(O)):
        s+=O[i]+E[i]
else:
    for i in range (len(O)-1):
        s+=O[i]+E[i]
    s+=O[-1]
print(s)

Buggy submission (verdict: Runtime Error):
O=input()
E=input()
s=''
for i in range (len(O)):
    s+=O[i]+E[i]
print(s)

Buggy submission (verdict: Runtime Error):
O=input()
E=input()
for i in range (len(O)):
    s+=O[i]+E[i]
print(s)
Problem p03861 (python)

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


#切り捨て除算！！！！！！！

Buggy submission (verdict: Runtime Error):
a,b,x = map(int,input().split())
    if a%x==0 or a==0:
        print(int(b//x)-int(a//x)+1)
    else:
        print(int(b//x)-int(a//x))


#切り捨て除算！！！！！！！
Problem p03998 (python)

Fixed submission:
s_a=list(input())
s_b=list(input())
s_c=list(input())

tmp =''
tmp=s_a.pop(0)
while 1:
    if tmp=='a':
        if s_a:
            tmp=s_a.pop(0)
        else:
            print('A')
            break
    elif tmp=='b':
        if s_b:
            tmp=s_b.pop(0)
        else:
            print('B')
            break
    elif tmp=='c':
        if s_c:
            tmp=s_c.pop(0)
        else:
            print('C')
            break

Buggy submission (verdict: Runtime Error):
s_a=list(input())
s_b=list(input())
s_c=list(input())

tmp =''
tmp=s_a.pop(0)
while 1:
    if tmp=='a':
        if s_a:
            tmp=s_a.pop(0)
        else:
            print('A')
            break
    elif tmp=='b':
        if s_b:
            tmp=s_b.pop(0)
        else:
            print('B')
            break
    else tmp=='c':
        if s_c:
            tmp=s_c.pop(0)
        else:
            print('C')
            break

Buggy submission (verdict: Runtime Error):
s_a=list(input())
s_b=list(input())
s_c=list(input())

temp =''
temp=s_a.pop(0)
while 1:
    if temp=='a':
        if s_a:
            temp=s_a.pop(0)
        else:
            print('A')
            break
    elif temp=='b':
        if s_b:
            temp=s_b.pop(0)
        else:
            print('B')
            break
    elif temp=='c':
        if s_b:
            temp=s_c.pop(0)
        else:
            print('C')
            break
Problem p02690 (python)

Fixed submission:
x = int(input())
l = []
for i in range(-400,400):
    l.append(i**5)
ans =[]
for i in l:
    for j in l:
        if i - j == x:
            ans.append([i,j])
i,j = ans[0][0],ans[0][1]
print(l.index(i)-400,l.index(j)-400)

Buggy submission (verdict: Runtime Error):
x = int(input())
l = []
for i in range(-100,100):
    l.append(i**5)
ans =[]
for i in l:
    for j in l:
        if i - j == x:
            ans.append([i,j])
i,j = ans[0][0],ans[0][1]
print(l.index(i)-100,l.index(j)-100)
Problem p02975 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
j = 0
u = []
v = [0]*4
for i in l:
    if not i in u :
        u.append(i)
    v[u.index(i)] += 1
    if len(u) > 3:
        break
#print(u,v)
if len(u) == 3:
    if ((n%3 == 0) and (u[0] ^ u[2] == u[1]) and (v[0] == v[1] and v[1] == v[2]) and not len(u) > 3 and not 0 in u):
        j = 1
elif len(u) == 2:
    if 0 in u:
        if u[0] == 0 :
            b = u[1]
        else :
            b = u[0]
        if v[u.index(0)] * 2 == v[u.index(b)]:
            j = 1
if len(u) == 1:
    if u[0] == 0:
        j = 1

if j == 1 :
    print("Yes")
else :
    print("No")

#print(l[0] ^ l[2] == l[1],n == 3)
"""01
10
11
01
10
11

01
00
01
01
00
01
"""

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
j = 0
u = []
v = [0]*3
for i in l:
    if not i in u :
        u.append(i)
    v[u.index(i)] += 1
    if len(u) > 3:
        break
#print(u,v)
if len(u) == 3:
    if ((n%3 == 0) and (u[0] ^ u[2] == u[1]) and (v[0] == v[1] and v[1] == v[2]) and not len(u) > 3 and not 0 in u):
        j = 1
elif len(u) == 2:
    if 0 in u:
        if u[0] == 0 :
            b = u[1]
        else :
            b = u[0]
        if v[u.index(0)] * 2 == v[u.index(b)]:
            j = 1
if j == 1 :
    print("Yes")
else :
    print("No")

#print(l[0] ^ l[2] == l[1],n == 3)
"""01
10
11
01
10
11

01
00
01
01
00
01
"""

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
j = 0
u = []
v = [0]*3
for i in l:
    if not i in u :
        u.append(i)
    v[u.index(i)] += 1
    if len(u) > 3:
        break
#print(u,v)
if len(u) == 3:
    if ((n%3 == 0) and (u[0] ^ u[2] == u[1]) and (v[0] == v[1] and v[1] == v[2]) and not len(u) > 3):
        j = 1
elif len(u) == 2:
    if 0 in u:
        if v[0] == v[1] * 2 or v[0] * 2 == v[1]:
            j = 1
if j == 1 :
    print("Yes")
else :
    print("No")

#print(l[0] ^ l[2] == l[1],n == 3)
"""01
10
11
01
10
11

01
00
01
01
00
01
"""

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
j = 0
u = []
v = [0]*3
for i in l:
    if not i in u :
        u.append(i)
    else:
        v[u.index(i)] += 1
    if len(u) > 3:
        break
#print(u,v)
if ((n%3 == 0) and (u[0] ^ u[2] == u[1]) and (v[0] == v[1] and v[1] == v[2]) and not len(u) > 3):
    j = 1
if j == 1 :
    print("Yes")
else :
    print("No")
#print(l[0] ^ l[2] == l[1],n == 3)
"""01
10
11
01
10
11

01
00
01
01
00
01
"""
Problem p02993 (python)

Fixed submission:
#n,q= map(int,input().split())
s = input()
a = 0
for i in range(len(s)-1):
    if s[i] == s[i+1] :
        print("Bad")
        break
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
n, k= map(int,input().split())
if k > (n-1)+(n-2):
    print(-1)
elif n == 2:
    if k == 0:
        print(1,2)
    else:
        print(-1)
else:
    for i in range(2,n+1):
        print(1,i)
    ima = (n-1)*(n-2) / 2
    #print(ima)
    hajime = 2
    owari = 3
    while(ima > k):
        print(hajime ,owari)
        ima -= 1
        if(owari < n):
            owari += 1
        else:
            hajime += 1
            owari = hajime + 1