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

Fixed submission:
from heapq import heapify, heappop, heappush
from sys import stdin

N, M = map(int, input().split())
A = list(map(int, stdin.readline().split()))
heapify(A)
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, stdin.readline().split()))
BC = sorted(BC, key=lambda x: x[1], reverse=True)

enough = False
for bc in BC:
    if enough:
        break
    for i in range(bc[0]):
        if bc[1] <= A[0]:
            enough = True
            break
        heappop(A)
        heappush(A, bc[1])

print(sum(A))

Buggy submission (verdict: Runtime Error):
from heapq import heapify, heappop, heappush
from sys import stdin

N, M = map(int, input().split())
A = list(map(int, stdin.readline().split()))
heapify(A)
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, stdin.readline().split()))
BC = sorted(BC, key=lambda x: x[1], reversed=True)

print(BC)

enough = False
for bc in BC:
    if enough:
        break
    for i in range(bc[0]):
        if bc[1] <= A[0]:
            enough = True
            break
        heappop(A)
        heappush(A, bc[1])

print(sum(A))
Problem p03137 (python)

Fixed submission:
n = list(map(int, input().split())) 
i = list(map(int, input().split())) 
i.sort()
if(n[0] >= n[1]):
  print(0)
else:
	k=1
	kyori=list()
	while k < n[1]: 
	  sa=i[k]-i[k-1]
	  kyori.append(sa)
	  k=k+1
	kyori.sort()
	mm=1
	owari=n[1]-n[0]
	kyori=kyori[0:owari]
	idou=sum(kyori)
	print(idou)

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split())) 
i = list(map(int, input().split())) 
i.sort()
if(n[0] >= n[1]):
  print(0)
  break
else:
	k=1
	kyori=list()
	while k < n[1]: 
	  sa=i[k]-i[k-1]
	  kyori.append(sa)
	  k=k+1
	kyori.sort()
	mm=1
	owari=n[1]-n[0]
	kyori=kyori[0:owari]
	idou=sum(kyori)
	print(idou)

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split())) 
i = list(map(int, input().split())) 
i.sort()
while(n[0] >= n[1]):
  print(0)
  break
k=1
kyori=list()
while k < n[1]: 
  sa=i[k]-i[k-1]
  kyori.append(sa)
  k=k+1
mm=1
idou=sum(kyori)
for mm in range(0, n[0]-1,1):
  saidai=max(kyori)
  idou=idou-saidai
  kyori.remove(saidai)
print(idou)

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split())) 
i = list(map(int, input().split())) 
i.sort()
while(n[0] >= n[1]):
  print(0)
  break
k=1
kyori=list()
while k < n[1]: 
  sa=i[k]-i[k-1]
  kyori.append(sa)
  k=k+1
mm=1
idou=sum(kyori)
idoulist=kyori
for mm in range(0, n[0]-1,1):
  saidai=max(idoulist)
  idou=idou-saidai
  idoulist.remove(saidai)
print(idou)
Problem p02915 (python)

Fixed submission:
N = int(input())
pw = N**3
print(pw)

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

count = 0

for i in range(3):
    if s[i] == t[i]:
        count = count + 1

print(count)
Problem p02990 (python)

Fixed submission:
from scipy.misc import comb
MOD = 10**9+7
n, k = map(int, input().split())

def comb_mod(a, b):
    return int(comb(a, b, exact=True)) % MOD

for i in range(1, k+1):
    blue = comb_mod(k-1, i-1)
    red = comb_mod(n-k+1, i)
    print((red*blue)%MOD)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
MOD = 10**9+7
n, k = map(int, input().split())

def comb_mod(a, b):
    return int(comb(a, b, exact=True)) % MOD

for i in range(1, k+1):
    blue = comb_mod(k-1, i-1)
    red = comb_mod(n-k-1, i-2) + comb_mod(n-k-1, i) + 2*comb_mod(n-k-1, i-1)
    print((red*blue)%MOD)
Problem p03045 (python)

Fixed submission:
class UnionFind:
    def __init__(self, n):
        self.table = [-1 for _ in range(n)]

    def _root(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self._root(self.table[x])
            return self.table[x]

    def find(self, x, y):
        return self._root(x) == self._root(y)

    def union(self, x, y):
        r1 = self._root(x)
        r2 = self._root(y)
        if r1 == r2:
            return
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1<=d2:
            self.table[r2] = r1
            if d1==d2:
                self.table[r1] -= 1
        else:
            self.table[r1] = r2

n, m = map(int, input().split())
uf = UnionFind(n)
for _ in range(m):
    x, y, z = map(int, input().split())
    x -= 1
    y -= 1
    uf.union(x, y)

ans = 0
for v in uf.table:
    if v<0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
class UnionFind:
    def __init__(self, n):
        self.table = [-1 for _ in range(n)]

    def _root(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self._root(self.table[x])
            return self.table[x]

    def find(self, x, y):
        return self._root(x) == self._root(y)

    def union(self, x, y):
        r1 = self._root(x)
        r2 = self._root(y)
        if r1 == r2:
            return
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1<=d2:
            self.table[r2] = r1
            if d1==d2:
                self.table[r1] -= 1
        else:
            self.table[r1] = r2

n, m = map(int, input().split())
uf = UnionFind(n)
for _ in range(n):
    x, y, z = map(int, input().split())
    x -= 1
    y -= 1
    uf.union(x, y)

ans = 0
for v in uf.table:
    if v<0:
        ans += 1
print(ans)
Problem p03075 (python)

Fixed submission:
dist = [0]*5
for i in range(5):
    dist[i] = int(input())
k = int(input())

for i in range(5):
    for j in range(i):
        if abs(dist[j]-dist[i]) > k:
            print(":(")
            exit()

print("Yay!")

Buggy submission (verdict: Runtime Error):
dist = [0]*5
for i in range(5):
    dist[i] = int(input())
k = int(input())

for i in range(5):
    for j in range(i):
        if abs(dist[j]-dist[i]) > k:
            exit(":(")

print("Yay!")
Problem p03252 (python)

Fixed submission:
S = input()
T = input()
d0, d1 = {}, {}
for s, t in zip(S, T):
    if s in d0:
        if d0[s] != t:
            print('No')
            exit()
    elif t in d1:
        if d1[t] != s:
            print('No')
            exit()
    else:
        d0[s] = t; d1[t] = s
print('Yes')

Buggy submission (verdict: Runtime Error):
chokudai
redcoder
Problem p02781 (python)

Fixed submission:
import math
def comb(n, r):
  if n >= r:
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  else:
    return 0
N = int(input())
K = int(input())
A = []
ans = 0


for i in range(K):
  n = int(str(N)[0])
  dig = len(str(N)) - 1
  A.append([n, dig])
  N -= n * 10**dig
  if N == 0:
    break
#print(A)

for i in range(len(A)):
  if A[i][1] >= K-i:
    ans += comb(A[i][1], K-i) * 9 ** (K-i) 
#    print(ans)
  ans += (A[i][0]-1) * comb(A[i][1], K-i-1) * 9 ** (K-i-1)
#  print(ans)
if len(A) == K:
  ans += 1


print(ans)

Buggy submission (verdict: Runtime Error):
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = int(input())
K = int(input())
A = []
ans = 1


for i in range(K):
  n = int(str(N)[0])
  dig = len(str(N)) - 1
  A.append([n, dig])
  N -= n * 10**dig


for i in range(K):
  if A[i][1] >= K-i:
    ans += comb(A[i][1], K-i) * 9 ** (K-i) 
  ans += (A[i][0]-1) * comb(A[i][1], K-i-1) * 9 ** (K-i-1)
#  print(ans)

print(ans)
Problem p02831 (python)

Fixed submission:
import fractions
A, B = map(int, input().split())
print(A * B // fractions.gcd(A, B))

Buggy submission (verdict: Runtime Error):
import fractions:
A, B = map(int, input().split())
C = fractions.gcd(A, B)
print(A * B // C)

Buggy submission (verdict: Runtime Error):
import fractions:
A, B = map(int, input().split())
print(A * B // fractions.gcd(A, B))
Problem p02916 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
happiness = 0
memory = 100
for i in range(N):
  happiness += B[A[i]-1]
  if memory + 1 == A[i]:
    happiness += C[A[i]-2]
  memory = A[i]
print(happiness)

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()))
happiness = 0
memory = 100
for i in range(N):
  happiness += B[A[i]]
  if memory + 1 == A[i]:
    happiness += C[A[i]-1]
  memory = A[i]
print(happiness)

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()))
happiness = 0
memory = 100
for i in range(N):
  happiness += B[A[i]]
  if memory + 1 == A[i]:
    happiness += C[A[i]]
  memory = A[i]
print(happiness)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(int, input().split())
B = list(int, input().split())
C = list(int, input().split())
happiness = 0
memory = 100
for i in range(N):
  happiness += B[A[i]]
  if memory + 1 == A[i]:
    happiness += C[A[i]]
  memory = A[i]
print(happiness)
Problem p02935 (python)

Fixed submission:
from functools import reduce
N = int(input())
L = list(map(int, input().split()))
L.sort()
print(reduce(lambda x, y: (x + y)/2, L))

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input()))
L.sorted
ans = reduce(lambda x, y: (x + y)/2, L)
print(ans)
Problem p03013 (python)

Fixed submission:
Num = 10 ** 9 + 7
N, M = map(int, input().split())
danger = -1
if M != 0:
  danger = int(input())
count = 1
l = [1, 1]
for i in range(1, N):
  if i == danger:
    l[1] = 0
    if count < M:
      danger = int(input())
      count += 1
  l = [l[1] % Num, l[0] + l[1]]
  if l == [0, 0]:
    break
if N == danger:
  l[1] = 0
print(l[1] % Num)

Buggy submission (verdict: Runtime Error):
Num = 10 ** 9 + 7
N, M = map(int, input().split())
if M != 0
  danger = int(input())
count = 1
l = [1, 1]
for i in range(1, N):
  if i == danger:
    l[1] = 0
    if count < M:
      danger = int(input())
      count += 1
  l = [l[1] % Num, l[0] + l[1]]
  if l == [0, 0]:
    break
if N == danger:
  l[1] = 0
print(l[1] % Num)

Buggy submission (verdict: Runtime Error):
Num = 10 ** 9 + 7
N, M = map(int, input().split())
danger = int(input())
count = 1
l = [1, 1]
for i in range(1, N):
  if i == danger:
    l[1] = 0
    if count < M:
      danger = int(input())
      count += 1
  l = [l[1] % Num, l[0] + l[1]]
  if l == [0, 0]:
    break
if N == danger:
  l[1] = 0
print(l[1] % Num)

Buggy submission (verdict: Runtime Error):
Num = 10 ** 9 + 7
N, M = map(int, input().split())
danger = int(input())
count = 1
l = [1, 1]
for i in range(1, N):
  if i == danger:
    l[1] = 0
    if count < M:
      danger = int(input())
      count += 1
  l = [l[1] % Num, l[0] + l[1]]
  if l == [0, 0]:
    break
if N == danger:
  l[1] = 0
print(l[1] % Num)

Buggy submission (verdict: Runtime Error):
Num = 10 ** 9 + 7
N, M = map(int, input().split())
danger = int(input())
count = 1
l = [1, 1]
for i in range(1, N):
  if i == danger:
    l[1] = 0
    if count < M:
      danger = int(input())
      count += 1
  l = [l[1] % Num, l[0] + l[1]]
  if l == [0, 0]:
    break
if N == danger:
  l[1] = 0
print(l[1] % Num)
Problem p03038 (python)

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

for i in range(M):
  exc.append(list(map(int, input().split())))
exc.sort(key=lambda x: x[1], reverse=True)
e = []
count = 0
for i in range(M):
  e += [exc[i][1]] * exc[i][0]
  count += exc[i][0]
  if count >= N:
    break
cards = sorted(A+e, reverse=True)
print(sum(cards[:N]))

Buggy submission (verdict: Runtime Error):
import heapq
N, M = map(int, input().split())
A = list(map(int, input().split()))
s = 0
for i in range(M):
  b, c = map(int, input().split())
  b = min(b, N)
  A += heapq.heapify([c for j in range(b)])
  s += b
  heapq.heapify(A)
  for i in range(b):
    A_min = heapq.heappop(A)
    if A_min == c:
      break
print(sum(A))
Problem p03041 (python)

Fixed submission:
N, K = map(int, input().split())
s = input()
print(s[:K-1] + s[K-1:].capitalize().swapcase())

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
s = input()
print(s[:K] + s[K:].capitalize.swapcase)
Problem p02777 (python)

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

if s == u:
    a -= 1
elif t == u:
    b -= 1
print(a, b)

Buggy submission (verdict: Runtime Error):
from collections import deque
import itertools
 
n, k = map(int, input().split())
p = list(map(int, input().split()))
 
kukan = 0
kukan_list = deque()
for i in range(k):
    kukan_list.append(p[i])
 
for i in range(n - k+1):
    if kukan < sum(kukan_list):
        kukan = sum(kukan_list)
    if i+k<n:
        kukan_list.popleft()
        kukan_list.append(p[i+k])
 
 
ans = kukan / 2 + 0.5 * k
print(ans)
Problem p02688 (python)

Fixed submission:
(n, k) = [int(x) for x in input().split()]

s = set()

for i in range(k):
    input()
    s |= set(input().split())
    
print(n-len(s))

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

s = set()

for i in range(k):
    input()
    s |= set(input().split)
    
print(n-len(s))

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

s = set()

for i in range(k):
  input()
  s |= set(input().split)
    
print(n-len(s))

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

s = set()

for i in range(k):
	input()
    s |= set(input().split)
    
print(n-len(s))
Problem p02831 (python)

Fixed submission:
def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


a, b = map(int, input().split())
print(a * b // gcd(a, b))

Buggy submission (verdict: Runtime Error):
from math import gcd
a, b = map(int, input().split())
print(a * b // gcd(a, b))
Problem p02836 (python)

Fixed submission:
import sys
import functools
import operator

def main():
   s = sys.stdin.readline().strip()
   h = int(len(s) / 2)
   n = functools.reduce(operator.add, map(lambda x: 0 if(s[x] == s[-1-x]) else 1, range(0, h)), 0)
   print(n)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
import functools
import operator

def main():
   s = sys.stdin.readline().rstrip()
   h = int(len(s) / 2)
   n = functools.reduce(operator.add, map(lambda x: 0 if(s[x] == s[-1-x]) else 1, range(0, h)))
   print(n)

if __name__ == '__main__':
    main()
Problem p02771 (python)

Fixed submission:
on= input()

on = on.split()
 
if (on[0] != on[1] and on[0] != on[2] and on[1] != on[2]):
    print("No")
elif (on[0] == on[1] and on[0] == on[2] and on[1] == on[2]):
    print("No")

else:
  print("Yes")

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

on = on.split()
 
if (on[0] != on[1] and on[0] != on[2] and on[1] != on[2]):
    print("No")
elif (on[0] == on[1] and on[0] == on[2] and on[1] == on[2]):
    print("No")

else:
  print("Yes")
  //print(on[0],on[1],on[2]

Buggy submission (verdict: Runtime Error):
int 1,2,3 = input():

if 1 != 2{
  if 1 != 3{
    print("No")
  }
}
else{
  print("Yes")
}
Problem p02912 (python)

Fixed submission:
import heapq

N,M=map(int,input().split())
A=list(map(int,input().split()))
#print(A)
A =[-a for a in A]
#print(A)
heapq.heapify(A)

for w in range(M):
    max=heapq.heappop(A)
    heapq.heappush(A,max/2)
   
B=list(map(int, A))
#print(B)
print(sum(B)*-1)

Buggy submission (verdict: Runtime Error):
import bisect

N,M=map(int,input().split())

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

for w in range(M):
    max2=A.pop(N-1)/2
    #A[N-1]=A[N-1]/2
    #max=A[N-1]
    if max2<A[N-2]:
        bisect.insort_left(A,max2)
    else:
        A[N-1]=max2
    #print(A)

B=list(map(int, A))
#print(B)
print(sum(B))
Problem p03077 (python)

Fixed submission:
import math
n = int(input())
l = [int(input()) for i in range(5)] 
print(math.ceil(n/min(l))-1+5)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))

print(math.ceil(n/min(l))-1+5)
Problem p03250 (python)

Fixed submission:
l=list(map(int,input().split()))
print(max(l)*9+sum(l))

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

print(max(a,b,c)*9+sum(a,b,c)
Problem p03307 (python)

Fixed submission:
n=int(input())
if n%2==0:
    print(n)
else:
    print(n*2)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==0:print(n)
else print(n*2)
Problem p03774 (python)

Fixed submission:
n,m=map(int,input().split())
g=[list(map(int,input().split())) for i in range(n)] 
c=[list(map(int,input().split())) for i in range(m)] 

for i in g:
    tmp=10**9
    
    for j in range(m):
        t2=abs(i[0]-c[j][0]) + abs(i[1]-c[j][1])
        if t2 <tmp:
            no=j+1
            tmp=t2
            
    print(no)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
g=[list(map(int,input().split())) for i in range(n)] 
c=[list(map(int,input().split())) for i in range(m)] 

for i in g:
    tmp=1000
    
    for j in range(m):
        t2=abs(i[0]-c[j][0]) + abs(i[1]-c[j][1])
        if t2 <tmp:
            no=j+1
            tmp=t2
            
    print(no)
Problem p02879 (python)

Fixed submission:
x,y = map(int,input().split())
import sys

if x>9 or y>9:
    print(-1)
else:
    print(x*y)

Buggy submission (verdict: Runtime Error):
n=int(input())
import sys
import math
list=[]


for i in range(0,int(math.sqrt(n))):
    if n%(i+1)==0:
        list.append(i-1+(n/(i+1)))

print(int(min(list)))
Problem p02688 (python)

Fixed submission:
N,K=map(int,input().split())
arr=[]
ans=[str(i) for  i in range(1,N+1)]
for i in range(K):
    _=input()
    arr.extend((input().split()))
    arr=list(set(arr))
p=0
for n  in  ans:
    if(not(n in arr) ) :
        p=p+1
print(p)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
arr=[]
ans=[str(i) for  i in range(1,N+1)]
for i in range(K):
    _=input()
    arr.extend((input().split()))
    arr=list(set(arr))
p=0
for n  in  ans:
    if(!(n in arr) ) :
        p=p+1
print(p)
Problem p02689 (python)

Fixed submission:
N,M=map(int,input().split())
high_list=list(map(int,input().split()))
highest=[True]*N
for i in range(M):
    a,b=map(int,input().split())
    if(high_list[a-1]>=high_list[b-1]):
        highest[b-1]=False
    if(high_list[a-1]<=high_list[b-1]):
        highest[a-1]=False
print(sum(highest))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
high_list=list(map(int,input().split()))
highest=[True]*N
for i in range(M):
    a,b=map(int,input().split()))
    if(high_list[a-1]>=high_list[b-1]):
        highest[b-1]=False
    if(high_list[a-1]<=high_list[b-1]):
        highest[a-1]=False
print(sum(highest))
Problem p02699 (python)

Fixed submission:
s, w = map(int, input() .split())
if w >= s:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
1 2
a, b= map(int , input().split())
print (a)
print (b)
unsafe
s = input()
print(s)
Problem p02688 (python)

Fixed submission:
import itertools

inp2intlist = lambda inp:list(map(int,inp))

N,K = list(map(int, input().split(" ")))
A = list(itertools.chain.from_iterable([inp2intlist(input().split())  for i in range(K) if input().split()]))

print(N - len(set(A)))

Buggy submission (verdict: Runtime Error):
import itertools^M
N,K = list(map(int, input().split(" ")))^M
A = list(itertools.chain.from_iterable([input().split(" ")  for i in range(K) if input().split(" ")]))^M
A = list(map(int, A))
none = [a for a in range(1, K + 1) if a not in A]
print(len(none))
Problem p02771 (python)

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

if a == b and a != c:
    print('Yes')
elif a == c and a != b:
    print('Yes')
elif b == c and a != b:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b, c =map(int,input().split())
if a == b and a != c:
    print("Yes")
elif a == c and a != b:
    print("Yes")
elif b == c and a != b:
    peint("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c =map(int,input().split())
if a == b and a != c:
    print("Yes")
elif a == c and a != b:
    print("Yes")
elif b == c and a != b:
    peint("Yes")
else:
    print("No")
Problem p02897 (python)

Fixed submission:
n = int(input())
num = 0
for i in range(1, n+1):
    if i % 2 != 0:
        num += 1
          
print(num/n)

Buggy submission (verdict: Runtime Error):
n = int(input())
num = 0
for i in range(1, n+1):
    if i%2 != 0
    num += 1
    
print(num/n)

Buggy submission (verdict: Runtime Error):
n = int(input())
num = 0
for i in range(1, n+1):
    if i%2 != 0
    num += 1
    
print(num/n)
Problem p02689 (python)

Fixed submission:
import copy
n,m = map(int,input().split())
ht = [x for x in input().split()]
hl = {x + 1 : int(ht[x]) for x in range(len(ht))}
mx = {h:0 for h in hl}
for i in range(m):
    l,r = map(int,input().split())
    mx[l] = max(mx[l],hl[r])
    mx[r] = max(mx[r],hl[l])
cnt = 0
for h in hl:
    if mx[h] < hl[h]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import copy
n,m = map(int,input().split())
ht = [x for x in input().split()]
hl = {ht.index(x) + 1 : int(x) for x in ht}
p = []
for i in range(m):
    p.append([int(x) for x in input().split()])
hl2 = copy.copy(hl)
p2 = copy.copy(p)
g = []
for h in hl:
    if not (h in hl2):
        continue
    c = False
    for pt in p2:
        if not (h in pt):
            continue
        gp = copy.copy(pt)
        l = gp.pop(pt.index(h))
        lh = hl[l]
        r = gp.pop()
        rh = hl[r]
        if lh <= rh:
            c = True
            break
        if r in hl2:
            hl2.pop(r)
    if not c:
        g.append(h)
print(len(g))
Problem p02711 (python)

Fixed submission:
# 入力N:3桁の整数
N = input()
print("Yes" if str(N).count("7") != 0 else "No")

Buggy submission (verdict: Runtime Error):
# 入力N:3桁の整数
N = input()
print("Yes" if str(N).index("7") != -1 else "No")
Problem p02836 (python)

Fixed submission:
s = input()
res = 0
for i in range(len(s) // 2):
    if s[i] != s[len(s)-1-i]:
        res += 1
print(res)

Buggy submission (verdict: Runtime Error):
s = input()
res = 0
for i in range(len(s)//2):
	if s[i] != s[len(s)-1-i]:
    	res += 1
print(res)

Buggy submission (verdict: Runtime Error):
s = input()
res = 0
for i in range(len(s)//2):
	if s[i] != s[len(s)-1-i]:
        res += 1
print(res)

Buggy submission (verdict: Runtime Error):
s = input()
res = 0
for i in range(len(s)//2):
	if s[i] != s[len(s)-1-i]:
    	res += 1
print(res)
Problem p02859 (python)

Fixed submission:
print(int(input()) ** 2)

Buggy submission (verdict: Runtime Error):
kkk

Buggy submission (verdict: Runtime Error):
hhh

Buggy submission (verdict: Runtime Error):
print(int(input() ** 2)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()
h = n // 2
if s[:h] == s[h:]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
aaaaaaaaaaaaaaaaaaaa
Problem p02881 (python)

Fixed submission:
n = int(input())
i = 1
res = n
while i * i <= n:
  if n % i == 0:
    res = min(res, i + n//i - 2)
  i += 1
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
int x = 1
res = n
while x * x <= n:
  if n % x == 0:
    res = min(res, x + n // x)
print(res)
Problem p02897 (python)

Fixed submission:
n = int(input())
print(((n + 1) // 2) / n)

Buggy submission (verdict: Runtime Error):
n = int(inpuit())
print((n // 2) / n)