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

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

def CheckColor(a, count):
    if 1 <= a and a <= 399:
        count[0] += 1
    elif 400 <= a and a <= 799:
        count[1] += 1
    elif 800 <= a and a <= 1199:
        count[2] += 1
    elif 1200 <= a and a <= 1599:
        count[3] += 1
    elif 1600 <= a and a <= 1999:
        count[4] += 1
    elif 2000 <= a and a <= 2399:
        count[5] += 1
    elif 2400 <= a and a <= 2799:
        count[6] += 1
    elif 2800 <= a and a <= 3199:
        count[7] += 1
    else:
        count[8] += 1

ans = 0
count = [0 for _ in range(9)]

for a in A:
    CheckColor(a, count)

for c in count[:8]:
    if c != 0:
        ans += 1

print(max(ans, 1), ans + count[8])

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

def CheckColor(a):
    global free_count
    if 1 <= 0 a and a <= 399:
        return 'gray'
    elif 400 <= a and a <= 799:
        return 'blown'
    elif 800 <= a and a <= 1199:
        return 'green'
    elif 1200 <= a and a <= 1599:
        return 'water'
    elif 1600 <= a and a <= 1999:
        return 'blue'
    elif 2000 <= a and a <= 2399:
        return 'yellow'
    elif 2400 <= a and a <= 2799:
        return 'orange'
    elif 2800 <= a and a <= 3199:
        return 'red'
    else:
        free_count += 1
        return 'free'

def Max(L):
    global gree_count
    max_num = min_num + free_count
    if max_num > 7:
        return 7        
    else:
        return max_num

def Min(L):
    global min_num
    if 'free' in ans_set:
        min_num = len(L) - 1
    else:
        min_num = len(L)
    return min_num


ans_list = []
count = 0
min_num = 0
free_count = 0

for a in A:
    ans_list.append(CheckColor(a))

ans_set = set(ans_list)

print(Min(ans_set), Max(ans_set))
Problem p03738 (python)

Fixed submission:
A = int(input())
B = int(input())

if A > B:
    print('GREATER')
elif A < B:
    print('LESS')
else:
    print('EQUAL')

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

if A > B:
    print('GREATER')
elif A < B:
    print('LESS')
else:
    print('EQUAL')
Problem p03844 (python)

Fixed submission:
A, op, B = map(str, input().split())

if op == '+':
    print(int(A) + int(B))
if op == '-':
    print(int(A) - int(B))

Buggy submission (verdict: Runtime Error):
A, op, B = map(str, input().split())

if op == '+':
    print(int(A) + int(B))
if op == '-':
    print(int(A)) - int(B)
Problem p03846 (python)

Fixed submission:
def even_case(input_list) -> int:
    input_list.sort()

    if input_list[0] == 0: return 0


    for i in range(1, len(input_list), 2):
        if input_list[i] % 2 == 0 or input_list[i] != input_list[i-1]:
            return 0

    ans = 2 ** (n//2)

    return ans


def odd_case(input_list) -> int:
    input_list.sort()

    if input_list[0] != 0: return 0

    if len(input_list) == 1: return 1

    if input_list[1] == 0: return 0

    for i in range(2, len(input_list), 2):
        if input_list[i] % 2 == 1 or input_list[i] != input_list[i-1]:
            return 0

    ans = 2 ** ((n-1) // 2)

    return ans

n = int(input())
input_list = list(map(int, input().split()))
math = 10 ** 9 + 7

if n % 2 == 0:
    result = even_case(input_list)
else:
    result = odd_case(input_list)

print(result % math)

Buggy submission (verdict: Runtime Error):
def even_case(input_list) -> int:
    input_list.sort()

    for i in range(1, len(input_list), 2):
        if input_list[i] // 2 == 1 and input_list[i] != input_list[i-1]:
            return 0

    ans = 2 ** (n//2)

    return ans


def odd_case(input_list) -> int:
    input_list.sort()

    if input_list[1] == 0:
        return 0

    for i in range(2, len(input_list), 2):
        if input_list[i] // 2 == 0 and input_list[i] != input_list[i-1]:
            return 0

    ans = 2 ** ((n-1) // 2)

    return ans

n = int(input())
input_list = list(map(int, input().split()))
math = 10 ** 9 + 7

if n % 2 == 0:
    result = even_case(input_list)
else:
    result = odd_case(input_list)

print(result % math)

Buggy submission (verdict: Runtime Error):
def even_case(input_list) -> int:
    input_list.sort()

    for i in range(1, len(input_list), 2):
        if input_list[i] // 2 == 1 and input_list[i] != input_list[i-1]:
            return 0

    ans = 2 ** (n//2)

    return ans


def odd_case(input_list) -> int:
    input_list.sort()

    if input_list[1] == 0:
        return 0

    for i in range(2, len(input_list), 2):
        if input_list[i] // 2 == 0 and input_list[i] != input_list[i-1]:
            return 0

    ans = 2 ** ((n-1) // 2)

    return ans

n = int(input())
input_list = list(map(int, input().split()))

if n % 2 == 0:
    print(even_case(input_list))
else:
    print(odd_case(input_list))
Problem p03998 (python)

Fixed submission:

def my_turn(card_list):
    global cont_game
    global your_turn
    if card_list:
        your_turn = card_list[0]
        card_list.pop(0)
    else:
        cont_game = False

card_a = [ _ for _ in input()]
card_b = [ _ for _ in input()]
card_c = [ _ for _ in input()]

your_turn = 'a'
cont_game = True

while cont_game:
    if your_turn == 'a':
        my_turn(card_a)
    if your_turn == 'b':
        my_turn(card_b)
    if your_turn == 'c':
        my_turn(card_c)

print(your_turn.upper())

Buggy submission (verdict: Runtime Error):

def my_turn(card_list):
    card_list.popleft
    if not card_list:
        cont_game = False
    else:
        your_turn = card_list[0]

card_a = [ _ for _ in input()]
card_b = [ _ for _ in input()]
card_c = [ _ for _ in input()]

your_turn = 'a'
cont_game = True

while cont_game:
    if your_turn == 'a':
        my_turn(card_a)
    if your_turn == 'b':
        my_turn(card_a)
    if your_turn == 'c':
        my_turn(card_a)

print(your_turn)
Problem p04030 (python)

Fixed submission:
keys = input()
outputs = []

for key in keys:
    if key == 'B':
        if not outputs:
            pass
        else:
            outputs.pop()
    else:
        outputs.append(key)

for output in outputs:
    print(output, end='')

Buggy submission (verdict: Runtime Error):
keys = input()
outputs = []

for key in keys:
    if key == 'B':
        if outputs is None:
            pass
        else:
            outputs.pop()
    else:
        outputs.append(key)

for output in outputs:
    print(output, end='')

Buggy submission (verdict: Runtime Error):
keys = input()
outputs = []

for key in keys:
    if key == 'B':
        if outputs == None:
            pass
        else:
            outputs.pop()
    else:
        outputs.append(key)

for output in outputs:
    print(output, end='')

Buggy submission (verdict: Runtime Error):
keys = input()
outputs = []

for key in keys:
    if key == 'B':
        outputs.pop()
    else:
        outputs.append(key)

for output in outputs:
    print(output, end='')
Problem p04043 (python)

Fixed submission:
args = []
args = input()

count_5 = 0
count_7 = 0

for i in args:
    if i == '5':
        count_5+=1
    if i == '7':
        count_7+=1

if count_5 == 2 and count_7 == 1:
    print('YES')
else:
    print('NO')

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

l = [5, 5, 7]
if A in l:
    l.remove(A)
    if B in l:
        if C in l:
            print('YES')
            break
    print('NO')
Problem p02582 (python)

Fixed submission:
Word=input()
Word_list=list(Word)
 
number=0
renzoku=0
Enter=0
 
for num in range(3):
  if Word_list[num]=="R":
    number=number+1
  if (number>renzoku):
      renzoku=number
  else:
    number=0

print(renzoku)

Buggy submission (verdict: Runtime Error):
Word=input()
Word_list=list(Word)

number=0
renzoku=0

for num in range(3):
  if Word_list[num]="R":
    number=number+1
  else:
    if(number>renzoku):
      renzoku=number
    number=0
Problem p02582 (python)

Fixed submission:
s = input()
cnt = 0
l =[]
for i in range(3):
    if s[i] == "R":
        cnt += 1
    else:
        l.append(cnt)
        cnt = 0

l.append(cnt)

print(max(l))

Buggy submission (verdict: Runtime Error):
s = input()
cnt = 0
l =[]
for i in range(3):
    if s[i] == "R":
        cnt += 1
    else:
        l.append(cnt)
        cnt = 0

print(max(l))
Problem p02657 (python)

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

print(a*b)

Buggy submission (verdict: Runtime Error):
def main
a, b = map(int,input().split())

print( a* b)
return

main()
Problem p02658 (python)

Fixed submission:
def main():
    n = int(input())
    a = list(map(int,input().split()))
    
    if 0 in a:
        print(0)
        return
    
    prod = 1
    for i in a:
        prod *= i
        if prod > 10 ** 18:
            print(-1)
            return
    
    print(prod)
    
    return

main()

Buggy submission (verdict: Runtime Error):
import numpy as np

n =int(input())
l = list(map(int,input().split()))

if 0 in l:
    result = 0
else:
    arr = np.asarray(l)
    p = np.prod(arr)

    if p > 10 **18:
        p = -1

print(p)
Problem p02783 (python)

Fixed submission:
import math 
a,b = map(int,input().split())
print(math.ceil(a/b))

Buggy submission (verdict: Runtime Error):
import math 
a,b = map(int,input().split())
print(math.ceil(a/x))
Problem p02784 (python)

Fixed submission:
h,n = map(int,input().split())
moves = list(map(int,input().split()))

s = sum(moves)
if s < h:
    resutl = "No"
else:
    resutl = "Yes"

print(resutl)

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

s = sum(moves)
if s < h:
    resutl = "No"
else:
    result = "Yes"

print(result)
Problem p02811 (python)

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

if n * 500 >= k :
    print("Yes")
else:
    print("No")

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

if n * 500 >= k :
    print("Yes")
else:
    print("No")
Problem p02817 (python)

Fixed submission:
s,t = map(str,input().split())
print(t+s)

Buggy submission (verdict: Runtime Error):
s,t = map(str,input().split)
print(s + t)
Problem p02885 (python)

Fixed submission:
a, b = map(int,input().split())
result = max(a - 2* b, 0)
print(result)

Buggy submission (verdict: Runtime Error):
n =int(input())
nl = list(map(int,input().split()))
result = 0
for i in range(n):
    for k in range(i+1,n):
        result += nl[i] * nl[k]
        
print(result)
Problem p03037 (python)

Fixed submission:
n, m = map(int,input().split())

lefts = [0] * m
rights = [0] * m

for i in range(m):
	l, r = map(int,input().split())
	lefts[i] = l
	rights[i] = r

lefts_max = max(lefts)
rights_min = min(rights)

result = rights_min - lefts_max + 1

print(max(result,0))

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

lefts = [0] * m
rights = [0] * m

for i in range(m):
	l, m = map(int,input().split())
	lefts[i] = l
	rights[i] = r

lefts_max = max(lefts)
rithts_min = min(rights)

result = rights_min - lefts_max + 1

print(max(result,0))

Buggy submission (verdict: Runtime Error):
10 3
3 6
5 7
6 9
Problem p03068 (python)

Fixed submission:
n = int(input())
s = input()
k = int(input())

key = s[k-1]
result =""

for letter in s:
    if letter == key:
        result = result + key
    else:
        result =result +  "*"

print(result)

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

key = s[k]
result =""
for letter in s:
    if letter == key:
        result = result + key
    else:
        result =result +  "*"

print(result)
Problem p03361 (python)

Fixed submission:
h,w = map(int, input().split())
#get hight and weidth 
glid = [0] * ( h+ 2)

h_index = [-1, 0, 0,  1]
w_index = [ 0, -1, 1, 0]



glid[0]=["."] * ( w + 2 )
glid[h + 1 ] = ["."] * ( w + 2 )

for i in range(h):
	temp1 = ["."]
	temp2 = list(input())
	temp1.extend(temp2)
	temp1.append(".")
	glid[ i + 1 ] = temp1

# get glids 

cnt = 0

for j in range(h):
	for k in range(w):
		if glid[ j + 1 ][ k + 1 ] == "#" and glid[ j ][ k + 1 ] == "." and glid[ j + 2 ][ k + 1 ] == "." and glid[ j + 1][ k  ] == "." and glid[ j + 1][ k +2 ] == "." :
			cnt += 1

if cnt > 0 :
	print("No")
else:
	print("Yes")

Buggy submission (verdict: Runtime Error):
h,w = map(int, input().split())
#get hight and weidth 
glid = [0] * ( h+ 2)

h_index = [-1, 0, 0,  1]
w_index = [ 0, -1, 1, 0]



glid[0]=["."] * ( w + 2 )
glid[h + 1 ] = ["."] * ( w + 2 )

for i in range(h):
	temp1 = ["."]
	temp2 = list(input())
	temp1.extend(temp2)
	temp1.append(".")
	glid[ i + 1 ] = temp1

# get glids 

cnt = 0

for j in range(h):
	for k in range(w):
		if glid[ j + 1 ][ k + 1 ] == ".":
			continue
		else:
			flg = False
			for n in range(4):
				if glid[ j  + 1 + h_index[ n ] ][ k + 1 + w_index[ n ]] == "#" :
					flg = True
					break
				cnt += 1
			if flg == False :
				break
	if flg == False :
		break

if cnt<0:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
h,w = map(int, input().split())
#get hight and weidth 
glid = [0] * ( h+ 2)

h_index = [-1, 0, 0,  1]
w_index = [ 0, -1, 1, 0]



glid[0]=["."] * ( w + 2 )
glid[h + 1 ] = ["."] * ( w + 2 )

for i in range(h):
	temp1 = ["."]
	temp2 = list(input())
	temp1.extend(temp2)
	temp1.append(".")
	glid[ i + 1 ] = temp1

# get glids 

cnt = 0

for j in range(h):
	for k in range(w):
		if glid[ j + 1 ][ k + 1 ] == ".":
			continue
		else:
			flg = False
			for n in range(4):
				if glid[ j  + 1 + h_index[ n ] ][ k + 1 + w_index[ n ]] == "#" :
					flg = True
					break
				cnt += 0
			if flg == False :
				break
	if flg == False :
		break

if cnt < 1:
	print("Yes")
else:
	print("No")
Problem p03485 (python)

Fixed submission:
a,b = map (int,input().split())
print(-((-a - b)//2))

Buggy submission (verdict: Runtime Error):
a,b = map (int,input().sp;it())
print((a + b)//2)
Problem p02741 (python)

Fixed submission:
l=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
]
n=int(input())
print(l[n-1])

Buggy submission (verdict: Runtime Error):
l=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
]
print(l[int(input())])

Buggy submission (verdict: Runtime Error):
l=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
]
print(l[int(input())+1])
Problem p02719 (python)

Fixed submission:
N, K = map(int, open(0).read().split())
a = N % K
print(min(K - a, a))

Buggy submission (verdict: Runtime Error):
N, K = map(int, open(0).read().split())
a = N % K
print(min(K - b, b))
Problem p02801 (python)

Fixed submission:
print(chr(ord(input())+1))

Buggy submission (verdict: Runtime Error):
print(int("a"))
Problem p02911 (python)

Fixed submission:
import numpy as np

N, K, Q, *A, = map(int, open(0).read().split())
P = np.zeros(N)
for i in A:
    P[i - 1] += 1
for j in P:
    if K <= Q - j:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
import numpy as np

N, K, Q, *A, = map(int,map(lambda x: ''.join(sorted(x)), open(0).read().split()))
P = np.zeros(N)
for i in A:
    P[i - 1] += 1
for j in P:
    if K <= Q - j:
        print("No")
    else:
        print("Yes")
Problem p02927 (python)

Fixed submission:
import numpy as np
M,D = map(int,input().split())
a = 0
for i in np.arange(22,D+1):
  d10 = int(i/10)
  d01 = i-d10*10
  if d01 <= 1:
    continue
  if 0 < d10*d01 and d10*d01 <= M:
    a += 1
print(a)

Buggy submission (verdict: Runtime Error):
import numpy as np
M,D = map(int,input().split())
a = 0
for i in np.arange(1,D+1):
	d10 = int(i/10)
	d01 = i-d10*10
    if 0 < d10*d01 and d10*d01 <= M:
    	a += 1
print(a)
Problem p02946 (python)

Fixed submission:
k,x = map(int,input().split())
L=[x-(k-1)+i for i in range(2*k-1)]
print(' '.join(map(str, L)))

Buggy submission (verdict: Runtime Error):
k,x = map(int,input().split())
list=[x-(k-1)+i for i in range(2*k-1)]
print(' '.join(list))
Problem p02971 (python)

Fixed submission:
N=int(input())
list=[]
for i in range(N):
  list.append(int(input()))
M=max(list)
L=[i for i, v in enumerate(list) if v == M]
n=len(L)
if n>1:
  for i in range(N):
    print(M)
else:
  del list[L[0]]
  M2=max(list)
  for i in range(N):
    if i == L[0]:
      print(M2)
    else:
      print(M)

Buggy submission (verdict: Runtime Error):
N=int(input())
list=[]
for i in range(N):
  list.append(int(input()))
M=max(list)
L=[i for i, v in enumerate(list) if v == M]
n=len(L)
if n>1:
  for i in range(N):
    print(M)
elif:
  del list[L[0]]
  M2=max(list)
  for i in range(N):
    if i == L[0]:
      print(M2)
    elif:
      print(M)
Problem p02630 (python)

Fixed submission:
def sumdic(dic):
  s=0
  for k, v in dic.items():
    s+=int(k)*v
  return s

a=int(input())
dic={}
for x in input().split():
  if x in dic:
    dic[x]+=1
  else:
    dic[x]=1
s=sumdic(dic)
d=int(input())
for i in range(d):
  (b,c)=[x for x in input().split()]
  if c in dic and b in dic:
    dic[c]+=dic[b]
    s+=(int(c)-int(b))*dic[b]
    dic.pop(b)
  elif b in dic:
    dic[c]=dic[b]
    s+=(int(c)-int(b))*dic[b]
    dic.pop(b)
  print(s)

Buggy submission (verdict: Runtime Error):
def sumdic(dic):
  s=0
  for k, v in dic.items():
    s+=int(k)*v
  return s

a=int(input())
dic={}
for x in input().split():
  if x in dic:
    dic[x]+=1
  else:
    dic[x]=1
s=sumdic(dic)
d=int(input())
for i in range(d):
  (b,c)=[x for x in input().split()]
  if c in dic:
    dic[c]+=dic[b]
    s+=(int(c)-int(b))*dic[b]
    dic.pop(b)
  elif b in dic:
    dic[c]=dic[b]
    s+=(int(c)-int(b))*dic[b]
    dic.pop(b)
  print(s)
Problem p02642 (python)

Fixed submission:
from collections import Counter

def board(dp, i):
  m = 1
  while i*m <= len(dp)-1:
    dp[i*m]=False
    m+=1

a=int(input())
b=[int(x) for x in input().split()]
b=sorted(b)
d=Counter(b)
dp=[True]*(b[-1]+1)
c=0
for i in b:
  if dp[i] and d[i] < 2:
    c+=1
  board(dp, i)
print(c)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=[int(x) for x in input().split()]
b=sorted(b)
c=0
if b[0] == b[1]:
  c+=1
for i in range(0, a):
  for j in range(0, i):
    if b[i] % b[j] == 0:
      c+=1
      break
print(a-c)
Problem p02657 (python)

Fixed submission:
(a,b)=[int(x) for x in input().split()]
print(a*b)

Buggy submission (verdict: Runtime Error):
(a,b)=[int(x) for x input().split()]
print(a*b)
Problem p02687 (python)

Fixed submission:
s=input()
print('ARC' if s=='ABC' else 'ABC')

Buggy submission (verdict: Runtime Error):
if gets()=="ABC"
  puts "ARC"
else
  puts "ABC"
end
Problem p02690 (python)

Fixed submission:
import sys
x=int(input())
for i in range(-118, 120):
  for j in range(-119, 118):
    if pow(i, 5)-pow(j, 5)==x:
      print(i, j)
      sys.exit()

Buggy submission (verdict: Runtime Error):
x=int(input())
for i in range(-118, 120):
  if x-pow(i, 5)>=0:
    if pow((x-pow(i, 5)), 0.2).is_integer():
      b=pow((x-pow(i, 5)), 0.2)
      print(a, b)
      break
  else:
    if pow(-(x-pow(i, 5)), 0.2).is_integre():
      b=pow(-(x-pow(i, 5)), 0.2)
      print(a, b)
      break
Problem p02887 (python)

Fixed submission:
a = int(input())
s = list(input())
i = 0
while(i<len(s)-1):
  if s[i] == s[i+1]:
    s.pop(i)
  else:
    i+=1
print(len(s))

Buggy submission (verdict: Runtime Error):
a = int(input())
s = input()
i = 0
while(i<len(s)-1):
  if s[i] == s[i+1]:
    s.pop(i)
  else:
    i+=1
print(len(s))
Problem p02952 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n+1):
  if len(str(i))%2==1:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1,n+1):
  if len(i)%2==1:
    ans += 1
print(ans)
Problem p02982 (python)

Fixed submission:
n,d=[int(x) for x in input().split()]
x=[list(map(int,input().split())) for i in range(n)]
answer = 0
for i in range(n):
  for j in range(i+1,n):
    v = 0
    for k in range(d):
    	v += (x[i][k]-x[j][k])**2
    	t = 1
    while t**2<=v:
      	if t**2 == v:
        	answer += 1
        	break
      	t += 1
print(answer)

Buggy submission (verdict: Runtime Error):
n,d=[int(x) for x in input().split()]
x=[list(map(int,input().split())) for i in range(n)]
answer = 0
for i in range(n):
  for j in range(i+1,n):
    v = (x[i][0]-x[j][0])**2+(x[i][1]-x[j][1])**2
    k = 1
    while k**2<=v:
      if k**2 == v:
        answer += 1
        break
      k += 1
print(answer)
Problem p02582 (python)

Fixed submission:
print({
    "SSS": 0,
    "SSR": 1,
    "SRS": 1,
    "SRR": 2,
    "RSS": 1,
    "RSR": 1,
    "RRS": 2,
    "RRR": 3,
}[input()])

Buggy submission (verdict: Runtime Error):
x, k, d = map(int, input().split(" "))

def y(l): return abs(x + l * d - (k - l) * d)

lf = max(0, (k - x / d) / 2)
l = int(lf)
if lf - l > 0 and l + 1 <= k:
    print(min(y(l), y(l + 1)))
else:
    print(y(l))
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
b=[]
L=[]
b=input().split()
M=[]
for i in range(N):
    L.append(int(b[i]))
L.sort()
L.reverse()
#print(L)
x=0
y=0
p=0
index=0
for i in range(N-2):
    x=L.pop(0)
    for j in range(N-2-i):
        y=L.pop(0)
        for k in range(N-2-i-j):
#            print('i,j,k :'+str(i)+str(j)+str(k)+':'+str(x)+str(y)+str(L[k]))
            if x<y+L[k]:
                index+=1
            else:
                break
        M.append(y)
    L=M+L
    M.clear()
print(index)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=list(input())

t=0
for i in range(N-1):
    if S[i+1] == S[i]:
        t+=1
print(N-t)
Problem p02583 (python)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
cnt = 0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if L[i] == L[j] or L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i] + L[j] <= L[k] or L[i] + L[k] <= L[j] or L[j] + L[k] <= L[i]:
                continue
            cnt += 1
print(cnt)

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

for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if (L[i] != L[j] and L[i] != L[k] and L[j] != L[k]) and (L[i] + L[j] > L[k] and L[i] + L[k] > L[j] and L[j] + L[k] > L[i]):
                cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = map(int, input().split())
cnt = 0
for i in range(N-2):
        # L[i]
    for j in range(i+1,N-1):
        # L[j]
        for k in range(j+1,N):
            print(i,j,k)
            if L[i] == L[j] or L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i] + L[j] <= L[k] or L[i] + L[k] <= L[j] or L[j] + L[k] <= L[i]:
                continue
            cnt += 1
print(cnt)
Problem p02789 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = input().split("")
if a == b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b = input().split("")
if a == b:
  print(yes)
else:
  print(no)
Problem p02582 (python)

Fixed submission:
inp =input()
count=0 
res=0 
for ch in inp: 
  if ch=="R": 
    count+=1 
    res = max(res,count) 
  else: 
    res=max(res,count) 
    count=0 
print(res)

Buggy submission (verdict: Runtime Error):
count=0 
res=0 
for ch in inp: 
  if ch=="R": 
    count+=1 
    res = max(res,count) 
  else: 
    res=max(res,count) 
    count=0 
print(res)
Problem p02582 (python)

Fixed submission:
def main():
  s = list(input())
  ans = 0
  ansma = 0
  for i in s:
    if i == "R":
      ans += 1
    else:
      ans = 0
    if ans >= ansma:
      ansma = ans
  print(ansma)
  
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
def main():
  s = list(input())
  ans = 0
  ansli =list()
  for i in range(len(s)):
    if s[i] == "R":
      ans += 1
      ansli.append(ans)
    else:
      ans = 0
  print(max(ansli))
  
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
def main():
  s = list(input())
  ans = 0
  ansli =list()
  for i in range(len(s)):
    if s[i] == "R":
      ans += 1
      ansli.append(ans)
    else:
      ans = 0
  print(max(ansli))
  
if __name__ == "__main__":
  main()