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

Fixed submission:
import re

s = input()

if re.match('A?KIHA?BA?RA?$', s):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
s = input()

if re.match('A?KIHA?BA?RA?$', s):
    print("YES")
else:
    print("NO")
Problem p03524 (python)

Fixed submission:
s = input()

a = s.count("a")
b = s.count("b")
c = s.count("c")

if max(a, b, c) - min(a, b, c) <= 1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
s = input()

d = dict()
for a in s:
    d[a] = d.get(a, 0) + 1

if len(d) == 2 and sum(d.values()) > 2:
    print("NO")
    exit()

t = sorted([i - (min(d.values())) for i in d.values()])

if t[-1] - t[-2] > 1:
    print("NO")
else:
    print("YES")
Problem p03568 (python)

Fixed submission:
n = int(input())
cnt = 1
for i in input().split():
    if int(i) % 2 == 0:
        cnt *= 2

print(3**n - cnt)

Buggy submission (verdict: Runtime Error):
for i in input().split():
    if int(i) % 2 == 0:
        cnt *= 2

print(3**n - cnt)
Problem p03578 (python)

Fixed submission:
n = int(input())

ht = {}

for i in input().split():
  ht[i] = ht.get(i, 0) + 1

m = int(input())

for i in input().split():
  if i not in ht or ht[i] == 0:
    print("NO")
    exit()
  else:
    ht[i] -= 1

print("YES")

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

x = dict()
for i in input().split():
    x[i] = x.get(i, 0) + 1

m = int(input())

for i in input().split():
    if x[i] == 0 or i not in x:
        print("NO")
        exit()
    else:
        x[i] -= 1
print("YES")

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

x = dict()
for i in input().split():
    x[i] = x.get(i, 0) + 1

m = int(input())

for i in input().split():
    if x[i] == 0 or i not in x:
        print("NO")
        exit()
    else:
        x[i] -= 1
print("YES")
Problem p03612 (python)

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

x = []

for i in range(n):
    if p[i] - 1 == i:
        x.append('x')
    else:
        x.append('o')

cnt = 0
for i in range(n-1):
    if x[i] == "x" and x[i+1] == 'o':
        cnt += 1
    elif x[i] == "x" and x[i+1] == 'x':
        cnt += 1
        x[i+1] = 'o'

if x[n-1] == "x":
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [int(i)-1 for i in input().split()]
ans = 0
for i in range(n):
    if p[i] == i:
        p[i], p[i+1] = p[i+1], p[i]
        ans += 1

print(ans)
Problem p03695 (python)

Fixed submission:
from bisect import bisect_right

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

r = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
c = [0] * 9

for score in a:
	i = bisect_right(r, score)
	c[i] += 1

ans = 8 - c[:-1].count(0)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

c = sum([1 for i in r[:-1] if i != 0])
t = r[-1]

if c == 0:
    print(1, t)
else:
    print(c, c+t)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

if sum([1 for i in r[:-1] if i != 0]) == 0:
    print(1, r[-1])

else:
    mi = sum([1 for i in r[:-1] if i != 0])
    ma = mi + r[-1]
    print(mi, ma)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

if sum([1 for i in r[:-1] if i != 0]) == 0:
    print(1, n)
else:
    mi = sum([1 for i in r[:-1] if i != 0])
    print(mi, mi+r[-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

if sum([1 for i in r[:-1] if i != 0]) == 0:
    print(1, min(8, n))
else:
    mi = sum([1 for i in r[:-1] if i != 0])
    res = 8 - mi
    if res == 0:
        print(mi, mi)
    else:
        if res > r[-1]:
            print(mi, mi+r[-1])
        else:
            print(mi, mi+res)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

if r[-1] == 0:
    cnt = sum([1 for i in r[:-1] if i != 0])
    print(cnt, cnt)
else:
    cnt = sum([1 for i in r[:-1] if i != 0])
    res = 8 - cnt
    print(max(cnt, 1), cnt+min(res, r[-1]))
Problem p03699 (python)

Fixed submission:
n = int(input())
s = sorted([int(input()) for i in range(n)])

ans = sum(s)

if ans % 10 != 0:
    print(ans)
    exit()
else:
    for i in range(n):
        if s[i] % 10 != 0:
            print(ans-s[i])
            exit()

    print(0)

Buggy submission (verdict: Runtime Error):
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] s = new int[n];
		int sum = 0;
		for (int i = 0; i<n; i++) {
			s[i] = sc.nextInt();
			sum += s[i];
			}
		Arrays.sort(s);

		if (sum%10 != 0) {System.out.println(sum);}
		else {
			for (int i=0; i<n;i++) {
				if (s[i]%10!=0) {
					System.out.println(sum-s[i]);
					return;
				}
			}
		}
		System.out.println(0);


	}
}
Problem p03720 (python)

Fixed submission:
n, m = map(int, input().split())
c  = [0] * n

for _ in range(m):
  a, b = map(int, input().split())
  c[a-1] += 1
  c[b-1] += 1

for r in c:
  print(r)

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

for _ in range(m):
  a, b = map(int,input().split())
  d[a] = d.get(a, 0) + 1
  d[b] = d.get(b, 0) + 1

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

Fixed submission:
n, k = map(int,input().split())
ab = []
for i in range(n):
  (a, b) = map(int, input().split())
  ab.append((a, b))

ab = sorted(ab, key=lambda k:k[0])

b = 0

for i in ab:
  b += i[1]
  if b >= k:
    print(i[0])
    exit()

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
ab = [input().split() for i in range(n)]

ans = ""

for i in ab:
  ans += i[0] * int(i[1])

print(ans[k])
Problem p03797 (python)

Fixed submission:
s, c = map(int, input().split())

if c < 2 * s:
  print(c // 2)
else:
  c -= 2 * s
  print(s + c // 4)

Buggy submission (verdict: Runtime Error):
if c < 2 * s:
  print(c // 2)
else:
  c -= 2 * s
  print(s + c // 4)
Problem p03814 (python)

Fixed submission:
s = input()

while True:
  for i, n in enumerate(s):
    if n == "A":
      inda = i
      break
  break

while True:
  for i, n in enumerate(s[::-1]):
    if n == "Z":
      indz = i
      break
  break

indz = len(s) - indz - 1
print(indz - inda + 1)

Buggy submission (verdict: Runtime Error):
for i in range(n):
    if s[i] == "A":
        ind_a = i
        break

for i in range(n):
    if s[i] == "Z":
        ind_z = i

print(ind_z - ind_a + 1)

Buggy submission (verdict: Runtime Error):
for i in range(n):
    if s[i] == "A":
        ind_a = i
        break

for i in range(n):
    if s[i] == "Z":
        ind_z = i

print(ind_z - ind_a + 1)

Buggy submission (verdict: Runtime Error):
for i in range(n):
    if s[i] == "A":
        ind_a = i
        break

for i in range(n):
    if s[i] == "Z":
        ind_z = i

print(ind_z - ind_a + 1)
Problem p03945 (python)

Fixed submission:
s = input()

if len(s) == 1:
  print(0)
  exit()

left = 0
right = 0

count = 0
while True:
  if s[right+1] != s[left]:
    count += 1
    right += 1
    left = right
    if right == len(s) - 1:
      break
  else:
    right += 1
    if right == len(s) - 1:
      break

print(count)

Buggy submission (verdict: Runtime Error):
s = input()

left = 0
right = 0

count = 0
while True:
  if s[right+1] != s[left]:
    count += 1
    right += 1
    left = right
    if right == len(s) - 1:
      break
  else:
    right += 1
    if right == len(s) - 1:
      break

print(count)
Problem p02899 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = [0]

for i in range(N-1):
    ans.append(0)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), end=' ')

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

N = int(input())
A = list(map(int,input().split()))

ans = np.zeros(N)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), end=' ')

Buggy submission (verdict: Runtime Error):

import numpy as np

N = int(input())
A = list(map(int,input().split()))

ans = np.zeros(N)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), sep=' ', end=' ')

Buggy submission (verdict: Runtime Error):

Created on Sun Sep 29 22:57:46 2019

@author: hiros
"""
import numpy as np

N = int(input())
A = list(map(int,input().split()))

ans = np.zeros(N)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), sep=' ', end=' ')
Problem p03246 (python)

Fixed submission:
import collections

arr_length = int(input().rstrip())
arr = list(map(int,input().rstrip().split()))

arr_odd = arr[0::2]
arr_even = arr[1::2]

def count_strange(arr):
    c = collections.Counter(arr)
    keys, vals = zip(*c.most_common())
    return keys, vals

def proc(arr1, arr2):
    keys1, vals1 = count_strange(arr1)
    keys2, vals2 = count_strange(arr2)
    
    if keys1[0] == keys2[0]:
        if len(keys1) == 1 and len(keys2) == 1:
            print(vals1[0])# n = even number
        elif len(keys1) == 1 and len(keys2) > 1:
            print(len(arr2)-vals2[1])
        elif len(keys1) > 1 and len(keys2) == 1:
            print(len(arr1)-vals1[1])
        else: #>1
            print(
                min(
                    len(arr1)-vals1[1] + len(arr2)-vals2[0],
                    len(arr1)-vals1[0] + len(arr2)-vals2[1]
                    )
                    )
    else:
        print(len(arr1)-vals1[0] + len(arr2)-vals2[0])
    
proc(arr_odd, arr_even)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

import numpy as np

def canbe_solved(positions):
    flg = np.dot(positions[0],np.ones(2,int))%2
    for p in positions:
        flg ^= (np.dot(p,np.ones(2,int)) %2 )
        if flg:
            return False
    return True

def solutions(p,vals):
    u = np.dot(p, np.array([1,1]))
    v = np.dot(p, np.array([1,-1]))
    for val in vals:
        if u >=0:
            if v >= 0:
                print('R',end="")
                u -= val
                v -= val
            else:
                print('U',end="")
                u -= val
                v += val
        else:
            if v >= 0:
                print('D',end="")
                u += val
                v -= val
            else:
                print('L',end="")
                u += val
                v += val
    print()
    
    
def main():
    #input
    n = int(input().rstrip())
    positions = [np.asarray(list(map(int,input().rstrip().split()))) for _ in range(n)]
    vals = [1<<i for i in range(30,-1,-1)]
    if np.dot(positions[0], np.ones(2,int)) % 2 == 0:
        vals.append(1)

    if canbe_solved(positions):
        print(len(vals))
        for i,p in enumerate(vals):
            print(p,end="")
            if i == len(vals)-1:
                print('')
        else:
            print(' ', end="")

        for p in positions:
            solutions(p,vals)
    else:
        print('-1')
        
main()
Problem p03633 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
n = int(input().rstrip())
seconds = [int(input().rstrip()) for _ in range(n)]
#seconds = list(set(seconds))

def gcd(a,b):
    if int(b) == 0:
        return int(a)
    return gcd((b),(a%b))
def lcm(a,b):
    g = gcd(a,b)
    if a<b:
        return int(a/g)*b
    else:
        return int(b/g)*a

ans = 1
for num in seconds:
    ans = int(lcm(ans,num))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input().rstrip())
seconds = [int(input().rstrip()) for _ in range(n)]
seconds = set(seconds)

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    g = gcd(a,b)
    if a > b:
        return int(a/g*b)
    else:
        return int(a*b/g)
ans = 1
for num in seconds:
    ans = lcm(ans,num)
print(ans)
Problem p02675 (python)

Fixed submission:
import sys
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
if a % 10 == 3:
   print('bon')
elif a % 10 == 0 or a % 10 == 1 or a % 10 == 6 or a % 10 == 8:
   print('pon')
else:
   print('hon')

Buggy submission (verdict: Runtime Error):
import sys
a = []
for l in sys.stdin:
    a.append(int(l))
if (a % 10 == 3):
   print('bon')
elif (a % 10 == 0) or (a % 10 == 1) or (a % 10 == 6) or (a % 10 == 8):
   print('pon')
else:
   print('hon')
Problem p02677 (python)

Fixed submission:
import sys
import math

a,b,h,m= map(int,input().split())

kak1 = float(h * 30 + m * 0.5)
kak2 = m * 6

kaku = kak1 -kak2 if kak1 < kak2 else kak2 - kak1
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.sqrt(result))

Buggy submission (verdict: Runtime Error):
import sys
import math
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
b = int(input())
h = int(input())
m = int(input())

kak1 = float(h * 30 + m * 0.5)
kak2 = m * 6

kaku = kak1 -kak2 if kak1 < kak2 else kak2 - kak1
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.sqrt(result))

Buggy submission (verdict: Runtime Error):
import sys
import math
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
b = int(input())
h = int(input())
m = int(input())

kak1 = float(h * 30 + m * 0.5)
kak2 = m * 6

kaku = kak1 -kak2 if kak1 < kak2 else kak2 - kak1
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.pow(result,0.5))

Buggy submission (verdict: Runtime Error):
import sys
import math
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
b = int(input())
h = int(input())
m = int(input())

kak1 = 0 if h == 0 else h * 30
kak2 = 0 if m == 0 else m * 6
#print(kak1,kak2)

kaku = kak1 -kak2
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.pow(result,0.5))

Buggy submission (verdict: Runtime Error):
import sys
import math
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
b = int(input())
h= int(input())
m = int(input())

kak1 = 0 if h == 0 else 360 / h
kak2 = 0 if m == 0 else 360/m

kaku = abs(kak1 -kak2)
result = a * a + b * b - 2 * a * b * math.cos(kaku)
Problem p02675 (python)

Fixed submission:
N = input()
num = int(N) % 10

if num in (2,4,5,7,9):
  print('hon')
elif num in (0,1,6,8):
  print('pon')
else:
  print('bon')

Buggy submission (verdict: Runtime Error):
N = input()
n1 = N % 10

if n1 in (2,4,5,7,9):
  print('hon')
elif n1 in (0,1,6,8):
  print('pon')
else:
  print('bon')

Buggy submission (verdict: Runtime Error):
N = input() % 10

if N in (2,4,5,7,9):
  print('hon')
elif N in (0,1,6,8):
  print('pon')
else:
  print('bon')
Problem p03243 (python)

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def ok(n):
    s = str(n)
    if len(set(s)) == 1:
        return True
    return False

def solve():
    n = f()[0]
    for i in range(n, 1000):
        if ok(i):
            print(i)
            return

solve()

Buggy submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def ok(n):
    s = str(n)
    if len(set(s)) == 1:
        return True
    return False

def solve():
    n = f()
    for i in range(n, 1000):
        if ok(i):
            print(i)
            return

solve()
Problem p03244 (python)

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    v = f()

    a = [ v[i] for i in range(n) if i%2 == 0]
    b = [ v[i] for i in range(n) if i%2 == 1]

    cnt_a = {}
    cnt_b = {}
    for i in a:
        if i in cnt_a:
            cnt_a[i] += 1
        else:
            cnt_a[i] = 1
    
    for i in b:
        if i in cnt_b:
            cnt_b[i] += 1
        else:
            cnt_b[i] = 1

    ncnt_a = sorted(cnt_a.items(), key = lambda x:-x[1])
    ncnt_b = sorted(cnt_b.items(), key = lambda x:-x[1])

    

    if ncnt_a[0][0]!=ncnt_b[0][0]:
        print(n -ncnt_a[0][1]- ncnt_b[0][1])
    else:
        ans1 = n - ncnt_b[0][1] - (ncnt_a[1][1] if len(ncnt_a)>1 else 0)
        ans2 = n -ncnt_a[0][1]- (ncnt_b[1][1] if len(ncnt_b)>1 else 0)
        print(min(ans1, ans2))



solve()

Buggy submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    v = f()

    a = [ v[i] for i in range(n) if i%2 == 0]
    b = [ v[i] for i in range(n) if i%2 == 1]

    cnt_a = {}
    cnt_b = {}
    for i in a:
        if i in cnt_a:
            cnt_a[i] += 1
        else:
            cnt_a[i] = 1
    
    for i in b:
        if i in cnt_b:
            cnt_b[i] += 1
        else:
            cnt_b[i] = 1

    ncnt_a = sorted(cnt_a.items(), key = lambda x:x[1])
    ncnt_b = sorted(cnt_b.items(), key = lambda x:x[1])

    

    if ncnt_a[0][0]!=ncnt_b[0][0]:
        print(n -ncnt_a[0][1]- ncnt_b[0][1])
    else:
        ans1 = n -ncnt_a[1][1]- ncnt_b[0][1]
        ans2 = n -ncnt_a[0][1]- ncnt_b[1][1]
        print(min(ans1, ans2))



solve()
Problem p03260 (python)

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b = f()
    for i in range(1,4):
        if a*b*i%2 == 1:
            print("Yes")
            return
    
    print('No')
    

solve()

Buggy submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b = f()
    for i in range(1,4):
        if a*b*c%2 == 1:
            print("Yes")
            return
    
    print('No')
    

solve()
Problem p03263 (python)

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    h,w = f()
    g = [ f() for i in range(h)]

    cnt = 0
    ans = []
    for i in range(h):
        for j in range(w):
            if g[i][j]%2 == 0:
                continue
            else:
                if j+1<w  and (g[i][j+1]%2 == 1 or i+1 == h):
                    g[i][j+1] += 1
                    cnt+=1
                    ans += [(i+1, j+1, i+1, j+1+1)]

                elif i+1<h:
                    g[i+1][j] += 1
                    cnt+=1
                    ans += [(i+1, j+1, i+2, j+1)]

    
    print(cnt)
    for i in ans:
        print(i[0], i[1], i[2], i[3])



solve()

Buggy submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    h,w = f()
    g = [ f() for i in range(h)]

    cnt = 0
    ans = []
    for i in range(h):
        for j in range(w):
            if g[i][j]%2 == 0:
                continue
            else:
                if (j+1<w and g[i][j+1]%2 == 1) or i+1 == h:
                    g[i][j+1] += 1
                    cnt+=1
                    ans += [(i+1, j+1, i+1, j+1+1)]

                elif i+1<h:
                    g[i+1][j] += 1
                    cnt+=1
                    ans += [(i+1, j+1, i+2, j+1)]

    
    print(cnt)
    for i in ans:
        print(i[0], i[1], i[2], i[3])



solve()
Problem p03597 (python)

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    a = f()[0]
    print(n*n - a)

solve()

Buggy submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n,a = f()
    print(n*n - a)

solve()
Problem p03633 (python)

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def gcd(a, b):
    return gcd(b, a % b) if b else a


def solve():
    n = f()[0]
    a = []
    for i in range(n):
        a.append(f()[0])

    lcm = a[0]

    for i in range(1,n):
        lcm = lcm*a[i]//gcd(lcm, a[i])

    print(lcm)


solve()

Buggy submission (verdict: Runtime Error):
// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;
int n;
long long a[N];


long long gcd(long long a, long long b){
    return b ? gcd(b, a % b) : a;
}



int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n;
    
    for (int i = 1; i <= n; i++)cin>>a[i];
    
    long long  lcm = 1;
    
    for (int i = 1; i <= n; i++){
        lcm = lcm/gcd(a[i], lcm)*a[i];
    }
    cout<<lcm<<endl;
    
    
    return 0;
}
Problem p03636 (python)

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input().strip()
    print(s[0]+ str(len(s)-2)+s[-1])

solve()

Buggy submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input().strip()
    print(s[0]+ str(lne(s)-2)+s[-1])

solve()
Problem p03711 (python)

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a = [1,3,5,7,8,10,12]
    b = [4,6,9,11]
    c = [2]

    some_dic = {}

    for i in a:
        some_dic[i] = 1
    for i in b:
        some_dic[i] = 2
    for i in c:
        some_dic[i] = 3

    x , y = f()

    if some_dic[x] == some_dic[y]:
        print('Yes')
    else:
        print('No')

solve()

Buggy submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a = [1,3,5,7,8,10,12]
    b = [4,6,9,11]
    c = [2]

    some_dic = {}

    for i in a:
        some_dic[i] = 1
    for i in b:
        some_dic[i] = 2
    for i in c:
        some_dic[i] = 3

    x , y ={}

    if some_dic[x] == some_dic[y]:
        print('Yes')
    else:
        print('No')

solve()
Problem p03729 (python)

Fixed submission:
import sys, os
import numpy as np

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

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

solve()

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

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b,c = input(), input(), input()
    if a[-1]== b[0] and b[-1] = c[0]:
        print('YES')
    else:
        print('NO')
    

solve()
Problem p03777 (python)

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a , b = input().split()
    if a == 'H':
        print(b)
    else:
        if b == 'D':
            print('H')
        else:
            print('D')

solve()

Buggy submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a , b = input(), input()
    if a == 'H':
        print(b)
    else:
        if b == 'D':
            print('H')
        else:
            print('D')

solve()