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

Fixed submission:
s = int(input())
if s%2 == 0:
    print(int(s/2))
else:
    print(int(s/2+1))

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(M)]
num = [0,0,0]
for i in range(M):
    if N == 3 and sc[i][0] == 1 and sc[i][1] == 0 or N == 2 and sc[i][0] == 2 and sc[i][1] == 0: # or sc[i][1] == 0 and sc[i][0] == 2 and  #値が０かつそれが１００の位 or 値が０かつそれが１０の位かつ１００がない
        print("-1")
        exit()
    else:
        for j in range(M-1):
            if sc[i][0] == sc[j+1][0]:
                if sc[i][1] != sc[j+1][1]:
                    print("-1")
                    exit()
                else:
                    #if sc[i][1] not in num:
                    num[sc[i][0]-1] = sc[i][1]
            else:
                num[sc[i][0]-1] = sc[i][1]
NUM = num[0] * 100 + num[1] * 10 + num[2]
print(NUM)
Problem p02831 (python)

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

Buggy submission (verdict: Runtime Error):
import math
A,B = input().split()
A = int(A)
B = int(B)
lcm = int(A*B/math.gcd(A,B))
print(lcm)
Problem p02759 (python)

Fixed submission:
N = input()
N =int(N)

if 1<= N and N<=100:
    if N%2 ==0:
        n = N/2
    else:
        n = N/2+1
  
print(int(n))

Buggy submission (verdict: Runtime Error):
1<= N and N<=100

N = input()
if N%2 ==0:
  n = N/2
else:
  n = N/2+1
  
print(int(n))
Problem p02707 (python)

Fixed submission:
from collections import defaultdict
n=int(input())
ar=list(map(int,input().split()))
d=defaultdict(int)
for i in ar:
  d[i]+=1
for i in range (1,n+1):
  if i in d.keys():
    print(d[i])
  else:
    print(0)

Buggy submission (verdict: Runtime Error):
from collections import deafualtdict
n=int(input())
ar=list(map(int,input().split()))
d=defaultdict(int)
for i in ar:
  d[i]+=1
for i in range (1,n+1):
  if i in d.keys():
    print(d[i])
  else:
    print(0)
Problem p03775 (python)

Fixed submission:

import math

N = int(input())
def checklen(A, B):
    return max(len(str(A)), len(str(B)))

ans = float("inf")
M = round(math.sqrt(N))
for i in range(1, M+1):
    if N % i == 0:
        m = round(N/i)
        ans = min(checklen(i, m), ans)
print(ans)

Buggy submission (verdict: Runtime Error):


N = int(input())
def checklen(A, B):
    return max(len(str(A)), len(str(B)))

ans = float("inf")
for i in range(1,round(N/2):
    if N % i == 0:
        m = round(N/i)
        ans = min(checklen(i, m), ans)
print(ans)
Problem p03805 (python)

Fixed submission:

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

def mkmap(N, M):
    mapdic = {}
    for i in range(1, N+1):
        mapdic[str(i)] = [] 
    for j in range(M):
        pathA, pathB = map(str, input().split())
        mapdic[pathA] = mapdic[pathA] + [pathB]
        mapdic[pathB] = mapdic[pathB] + [pathA]
    return mapdic

mapdic = mkmap(N, M)
import copy

roots = [[]]*N
roots[0] = ["1"]
for i in range(N-1):
    root = copy.deepcopy(roots[i])
    for nowroot in root:
        for nextroot in mapdic[nowroot[-1]]:
            if  i >= 1:
                if not nextroot in nowroot:                    
                    roots[i+1] = roots[i+1] + [nowroot + nextroot]
                else:
                    pass
            else:
                roots[i+1] = roots[i+1] + [nowroot + nextroot]


List = [str(n+1) for n in range(N)]
check = "".join(List)
ans = 0
for i in roots[-1]:
    TF = "".join(sorted(list(i))) == check
    if TF:
        ans = ans + 1

print(ans)

Buggy submission (verdict: Runtime Error):

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

def mkmap(N, M):
    mapdic = {}
    for i in range(1, M+1):
        mapdic[str(i)] = [] 
    for j in range(N):
        pathA, pathB = map(str, input().split())
        mapdic[pathA] = mapdic[pathA] + [pathB]
        mapdic[pathB] = mapdic[pathB] + [pathA]
    return mapdic

mapdic = mkmap(N, M)
import copy

roots = [[]]*N
roots[0] = ["1"]
for i in range(N-1):
    root = copy.deepcopy(roots[i])
    for nowroot in root:
        for nextroot in mapdic[nowroot[-1]]:
            if  i >= 1:
                if not nextroot in nowroot:                    
                    roots[i+1] = roots[i+1] + [nowroot + nextroot]
                else:
                    pass
            else:
                roots[i+1] = roots[i+1] + [nowroot + nextroot]


List = [str(n+1) for n in range(N)]
check = "".join(List)
ans = 0
for i in roots[-1]:
    TF = "".join(sorted(list(i))) == check
    if TF:
        ans = ans + 1

print(ans)

Buggy submission (verdict: Runtime Error):

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

def mkmap(N, M):
    mapdic = {}
    for i in range(1, M+1):
        mapdic[str(i)] = [] 
    for j in range(N):
        pathA, pathB = map(str, input().split())
        mapdic[pathA] = mapdic[pathA] + [pathB]
        mapdic[pathB] = mapdic[pathB] + [pathA]
    return mapdic

mapdic = mkmap(N, M)
import copy

roots = [[]]*N
roots[0] = ["1"]
for i in range(N-1):
    root = copy.deepcopy(roots[i])
    for nowroot in root:
        for nextroot in mapdic[nowroot[-1]]:
            if  i >= 1:
                if not nextroot in nowroot:                    
                    roots[i+1] = roots[i+1] + [nowroot + nextroot]
                else:
                    pass
            else:
                roots[i+1] = roots[i+1] + [nowroot + nextroot]

print(len(roots[-1]))
Problem p02707 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
for i in range(n-1):
    ans[a[i]-1] += 1
for i in range(n):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
count = 0
for i in N-1:
  if i ==
Problem p02712 (python)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
  if (i%3) != 0 and (i%5) != 0:
    total =  total + i
print(total)

Buggy submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1, N+1):
  if （i%3) !=0 and (i%5) !=0:
    total += i
print(total)
Problem p02723 (python)

Fixed submission:
S = input()
print("Yes" if S[2] == S[3] and S[4] == S[5] else "No")

Buggy submission (verdict: Runtime Error):
S = input()
print("Yes" if S[3] == S[4] and S[5] == S[6] else "No")

Buggy submission (verdict: Runtime Error):
S = input()
print("Yes" if S[4] == S[5] and S[6] == S[7] else "No")
Problem p02753 (python)

Fixed submission:
S = input()
print("Yes" if len(set(S)) ==2 else "No")

Buggy submission (verdict: Runtime Error):
S = input()
print("Yes" len(set(S)) ==2 else "No")
Problem p02777 (python)

Fixed submission:
S, T = input().split()
A, B = map(int, input().split())
U = input()

print(A-1, B) if U == S else print(A, B-1)

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

print("A-1 B" if U == S else "A B-1")

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

print(A-1 B if U == S else A B-1)

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

print("A-1 B" if U == S else "A B")

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

print(A-1 B if U == S else A B)

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

print("S-1 T" if U == S else "S T-1")

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

print(S-1 T if U == S else S T-1)
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()
if N%2 != 0:
  print("No")
elif S[:int(N/2)] == S[int(N/2):]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
print("Yes" if N[0:N/2-1] == N[N/2+1:] else "No")
Problem p02897 (python)

Fixed submission:
N = int(input())
print(((N//2)+1)/N if N%2 != 0 else "0.5" )

Buggy submission (verdict: Runtime Error):
N = int(input())
print(((N//2)+1)/2N if N%2 != 0 else "0.5" )

Buggy submission (verdict: Runtime Error):
N = int(input())
print(((N//2)+1)/2N if N%2 != 0 else 0.5 )

Buggy submission (verdict: Runtime Error):
N = int(input())
print((N//2)+1/2N if N%2 != 0 else "0.5" )

Buggy submission (verdict: Runtime Error):
N = int(input())
print((N//2)+1/2N if N%2 != 0 else 0.5 )

Buggy submission (verdict: Runtime Error):
N = int(input())
print((N+1)/2N if N%2 != 0 else 0.5 )
Problem p02970 (python)

Fixed submission:
import math
N, D = map(int, input().split())
print(math.ceil(N/(2*D+1)))

Buggy submission (verdict: Runtime Error):
import math
N, D = map(int, input().split())
print(math.ceil(N/(2D+1)))
Problem p02847 (python)

Fixed submission:
# -*- coding utf-8 -*-
hash = {'SUN':7, 'MON':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2,'SAT':1}
s = input()
print(hash[s])

Buggy submission (verdict: Runtime Error):
# -*- coding utf-8 -*-
hash = {'SUN':7, 'MON':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2,'STA':1}
s = input()
print(hash[s])
Problem p02951 (python)

Fixed submission:
a,b,c = [int(x) for x in input().split()]
i = c - (a - b)
if i < 0:
  print(0)
else :
  print(i)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
x = c - (a - b)
print(x if x > 0 else 0)4

Buggy submission (verdict: Runtime Error):
a,b,c = [int(x) for x input().split()]
i = c - (a - b)
if i < 0:
  print(0)
else :
  print(i)
Problem p02879 (python)

Fixed submission:
S = input()
li = S.split(" ")
A = int(li[0])
B = int(li[1])
if A>9 or B>9:
    print(-1)
else:
    print(A*B)

Buggy submission (verdict: Runtime Error):
number_1 = int(input())
number_2 = int(input())
if number_1>9 or number_2>9:
  print(-1)
else:
  print(number_1*number_2)

Buggy submission (verdict: Runtime Error):
number_1 = int(input())
number_2 = int(input())
if number_1>9 or number_2>9:
  print("-1")
else:
  print(str(number_1*number_2))

Buggy submission (verdict: Runtime Error):
number_1 = int(input())
number_2 = int(input())
if number_1>9 or number_2>9:
  print(-1)
else:
  print(number_1*number_2)
Problem p02712 (python)

Fixed submission:
N = int(input())
 
org_sum = 1 * N * (N+1) // 2
div3 = N // 3
sum3 = 3 * div3 * (div3+1) //2
div5 = N // 5
sum5 = 5 * div5 * (div5+1) // 2
div15 = N // 15
sum15 = 15 * div15 * (div15+1) // 2
 
print(org_sum - sum3 - sum5 + sum15)

Buggy submission (verdict: Runtime Error):
N = int(input())
 
org_sum = 1/2 * N * (N+1)
div3 = N // 3
sum3 = 3/2 * div3 * (div3+1)
div5 = N // 5
sum5 = 5/2 * div5 * (div5+1)
div15 = N // 15
sum15 = 15/2 * div15 * (div15+1)
 
return org_sum - sum3 - sum5 + sum15

Buggy submission (verdict: Runtime Error):
N = input()
 
org_sum = 1/2 * N * (N+1)
div3 = N // 3
sum3 = 3/2 * div3 * (div3+1)
div5 = N // 5
sum5 = 5/2 * div5 * (div5+1)
div15 = N // 15
sum15 = 15/2 * div15 * (div15+1)
 
return org_sum - sum3 - sum5 + sum15

Buggy submission (verdict: Runtime Error):
N = input()
 
org_sum = 1/2*N*(N+1)
div3 = N // 3 * 3
div5 = N // 5 * 5
div15 = N // 15 * 15
 
return org_sum - div3 - div5 + div15

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

org_sum = 1/2*N*(N+1)
div3 = N // 3
div5 = N // 5
div15 = N // 15

return org_sum - div3 - div5 + div15
Problem p02779 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
for i in range(N-1):
  if A[i] == A[i+1]:
    print("NO")
    break
else:
  print('YES')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
for i in nrange(N-1):
  if A[i] == A[i+1]:
    print("NO")
    break
else:
  print('YES')

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

for i in range(N):
  if A[i] in A[i+1:]:
    print('NN)
else:
  print('YES')
Problem p02792 (python)

Fixed submission:
N = int(input())
Cij = [[0 for _ in range(10)] for _ in range(10)]
for i in range(1,N+1):
  a, b = int(str(i)[0]), int(str(i)[-1])
  Cij[a][b] += 1
print(sum(Cij[i][j]*Cij[j][i] for i in range(10) for j in range(10)))

Buggy submission (verdict: Runtime Error):
N = int(input())
Cij = [[0 for _ in range(N)] for _ in range(N)]
for i in range(1,N+1):
  a, b = int(str(i)[0]), int(str(i)[-1])
  Cij[a][b] += 1
print(sum(Cij[i][j]*Cij[j][i] for i in range(N) for j in range(N)))
Problem p02707 (python)

Fixed submission:
n=int(input())
boss=[int(x) for x in input().split()]
mem=list(range(1, n+1))
h_map = dict.fromkeys(mem, 0)
for i in boss:
    h_map[i]+=1

for i in mem:
    print(h_map[i])

Buggy submission (verdict: Runtime Error):
 n=int(input())
    boss=[int(x) for x in input().split()]
    mem=list(range(1, n+1))
    h_map = dict.fromkeys(mem, 0)
    for i in boss:
      h_map[i]+=1
    for i in mem:
      print(h_map[i])
Problem p02771 (python)

Fixed submission:
s = input().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())

if a == b:
    if a == c:
        print("No")
    else:
        print("Yes")
elif a != b:
    if a == c:
        print("Yes")
    elif b == c:
        print("Yes")
    else:
        print("No")
Problem p02777 (python)

Fixed submission:
# それぞれのボールの文字列を取得
a, b = input().split()

# それぞれのボールの個数を取得
aCount, bCount = input().split()
aNumber = int(aCount)
bNumber = int(bCount)

ball = []
ball.append(aNumber)
ball.append(bNumber)

# 取り出したボールの文字列を取得
selectBall = input()

if selectBall == a:
    aNumber = aNumber-1
    ball[0] = aNumber
    print(' '.join(map(str,ball)))
elif selectBall == b:
    bNumber = bNumber-1
    ball[1] = bNumber
    print(' '.join(map(str,ball)))
else:
    print(' '.join(map(str,ball)))

Buggy submission (verdict: Runtime Error):
# それぞれのボールの文字列を取得
a = input()
b = input()

# それぞれのボールの個数を取得
aCount = int(input())
bCount = int(input())
ball = []
ball.append(aCount)
ball.append(bCount)

# 取り出したボールの文字列を取得
selectBall = input()

if selectBall == a:
    aCount = aCount-1
    ball[0] = aCount
    print(' '.join(map(str,ball)))
elif selectBall == b:
    bCount = bCount-1
    ball[1] = bCount
    print(' '.join(map(str,ball)))
else:
    print(' '.join(map(str,ball)))

Buggy submission (verdict: Runtime Error):
# それぞれのボールの文字列を取得
a = input()
b = input()

# それぞれのボールの個数を取得
aCount = int(input())
bCount = int(input())
ball = []
ball.append(aCount)
ball.append(bCount)

# 取り出したボールの文字列を取得
selectBall = input()

# それぞれの文字列の文字数を取得
# aLength = len(a)
# bLength = len(b)

# print(aLength)
# print(bLength)

if selectBall == a:
    aCount = aCount-1
    # print(aCount)
    ball[0] = aCount
    print(' '.join(map(str,ball)))
elif selectBall == b:
    bCount = bCount-1
    ball[1] = bCount
    print(' '.join(map(str,ball)))
else:
    print(' '.join(map(str,ball)))
Problem p02879 (python)

Fixed submission:
A, B = map(int, input().split())
if 1 <= A <= 9 and 1 <= B <= 9:
  print(A*B)
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
A, B = A, B = map(int, input().split())
if 1 <= A <= 9 and 1 <= B <= 9:
  print(A*B)
else:
  print(-1)
Problem p02711 (python)

Fixed submission:
N=list(input())
if N.count("7")!=0:
	print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
S=list(input())
n=0
for i in range(1,N-1):
	for j in range(i+1,N):
		for k in range(j+1,N+1):
			if j-i!=k-j and 1<=i and i<j and j<k <=N and S[i-1]!=S[j-1] and S[j-1]!=S[k-1] and S[k-1]!=S[i-1]:
				n+=1
print(n)
Problem p02707 (python)

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



# if N >= sum(A):
#     print(N-sum(A))
# else:
#     print(-1)
count= [0] * N

for x in A:
    count[x-1] +=1
for i in range(N):
    print(count[i])

# def count_defaultdict(it):
#     counter = collections.defaultdict(int)
#     for x in it:
#         counter[x] += 1
#     return dict(counter)

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

count= [0] * N

for x in A:
    count[x-1] +=1
for i in range(N):
    print(count[i])

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

# if N >= sum(A):
#     print(N-sum(A))
# else:
#     print(-1)
count= [0] * N

for x in A:
    count[x] +=1
for i in range(1,N+1):
    print(count[i])

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

# if N >= sum(A):
#     print(N-sum(A))
# else:
#     print(-1)
for x in A:
    count[i] +=1
for i in range(1,N+1):
    print(count[i])
Problem p02712 (python)

Fixed submission:
N = int(input())+1
# M=1
# A=[5,4,2,1]
 
cnt = 0
cnt1 = 0
 
# for i in range(N):
#     cnt = cnt + A[i]
#
# for i in range(N):
#     if A[i] / cnt > 1 / 4 / M:
#         cnt1 = cnt1 + 1
 
sum=0
for i in range(N):
    if (i % 3) != 0 and (i % 5) != 0:
        sum = sum + i
        # print(i,sum)
 
# a1 = N % 10
# a2 = ((N-a1*10) % 100)/10
# a3 = ((N-a1*100-a2*10))/100
 
print(sum)

Buggy submission (verdict: Runtime Error):
N = map(int, input().split())
# M=1
# A=[5,4,2,1]

cnt = 0
cnt1 = 0

# for i in range(N):
#     cnt = cnt + A[i]
#
# for i in range(N):
#     if A[i] / cnt > 1 / 4 / M:
#         cnt1 = cnt1 + 1

sum=0
for i in range(N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        sum=sum+i
        # print(i,sum)

# a1 = N % 10
# a2 = ((N-a1*10) % 100)/10
# a3 = ((N-a1*100-a2*10))/100

print(sum)
Problem p02707 (python)

Fixed submission:
from itertools import repeat
 
n = int(input())
lis = list(map(int, input().split()))
d = [[0] for i in repeat(None, n)]
 
for i in lis:
  d[i - 1][0] += 1
  
for i in d:
  print(i[0])

Buggy submission (verdict: Runtime Error):
from itertools import repeat

n = int(input())
lis = list(map(int, input.split()))
d = [[0] for i in repeat(None, n)]

for i in lis:
  d[i - 1][0] += 1
  
for i in d:
  print(i[0])
Problem p02897 (python)

Fixed submission:
N = int(input())
if N%2 == 0:
    print(0.5)
else:
    a = ((N+1)/2)/N
    print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%2 == 0:
    print(0.5)
else:
    a = ((N+1)/
Problem p03295 (python)

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

ab.sort(key=lambda ab:ab[1])
ans=[ab[0]]
for i in range(1,m):
    if ans[-1][1]<=ab[i][0]:
        ans.append(ab[i])
print(len(ans))

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

ab.sort(key=lambda ab:ab[1])
ans=[ab[0]]
for i in range(1:m):
    if ans[-1][1]<=ab[i][0]:
        ans.append(ab[i])
print(len(ans))
Problem p03805 (python)

Fixed submission:
import itertools

n,m=map(int, input().split()) 
ab=[list(map(int, input().split())) for _ in range(m)]
#ab=Input.split()
#d：隣接行列

d = [[] for i in range(n)]
for i in range(m):
    a = ab[i][0]
    b = ab[i][1]
    d[a-1].append(b-1)
    d[b-1].append(a-1)
    
#per：順列列挙
per= itertools.permutations(range(1,n))
ans=0
for i in per:
    cnt=1
    x = [0]+list(i)
    for j in range(1,n):
        #隣接していなければ終了
        if not x[j] in d[x[j-1]]:
            break
        else:
            cnt+=1
    if(cnt==n):
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

n,m=map(int, input().split()) 
ab=[list(map(int, input().split())) for _ in range(m)]
#ab=Input.split()
#d：隣接行列
print(ab)
print(type(ab))
d = [[] for i in range(n)]
for i in range(m):
    a = ab[i][0]
    b = ab[i][1]
    d[a-1].append(b-1)
    d[b-1].append(a-1)
    
#per：順列列挙
per= list(itertools.permutations(range(1,n)))
cnt=0
for i in range(len(per)):
    x = [0]+per[i]
    for j in range(n):
        #隣接していなければ終了
        if not x[j+1] in d[x[j]]:
            break
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
import itertools

n,m=map(int, input().split()) 
ab=[list(map(int, input().split())) for _ in range(m)]
#ab=Input.split()
#d：隣接行列
print(ab)
print(type(ab))
d = [[] for i in range(n)]
for i in range(m):
    a = ab[i][0]
    b = ab[i][1]
    d[a-1].append(b-1)
    d[b-1].append(a-1)
    
#per：順列列挙
per= list(itertools.permutations(range(1,n)))
cnt=0
for i in range(len(graph)):
    x = [0]+per[i]
    for j in range(n):
        #隣接していなければ終了
        if not x[j+1] in d[x[j]]:
            break
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
import itertools

n,m=map(int, input().split()) 
ab=[list(map(int, input().split())) for _ in range(m)]
#ab=Input.split()
#d：隣接行列
print(ab)
print(type(ab))
d = [[] for i in range(n)]
for i in range(m):
    a = ab[i][0]
    b = ab[i][1]
    d[a-1].append(b-1)
    d[b-1].append(a-1)
    
#per：順列列挙
per= list(itertools.permutations(range(1,n)))
cnt=0
for i in range(len(graph)):
    x = [0]+graph[i]
    for j in range(n):
        #隣接していなければ終了
        if not x[j+1] in d[x[j]]:
            break
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split()) 
ab=[list(map(int, input().split())) for _ in range(m)]
#ab=Input.split()
#d：隣接行列
d = [[] for i in range(n)]
for i in range(m):
    a = ab[i][0]
    b = ab[i][1]
    d[a-1].append(b-1)
    d[b-1].append(a-1)
    
#per：順列列挙
per= list(itertools.permutations(range(1,n)))
cnt=0
for i in range(len(graph)):
    x = [0]+graph[i]
    for j in range(n):
        #隣接していなければ終了
        if not x[j+1] in d[x[j]]:
            break
        cnt+=1
print(cnt)
Problem p02832 (python)

Fixed submission:
n = int(input())
lst = list(map(int, input().split()))
x = 0
for i in lst:
  if i == x + 1:
    	x = x + 1
if x == 0:
  print(-1)
else:
  print(n-x)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = list(map(int, intput().split()))
x = 0
for i in lst:
  if i == x + 1:
    	x = x + 1

print(n-x)
Problem p02707 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
count_list = [0] * N
for item in A:
    count_list[item-1] += 1
for countitem in count_list:
    print(countitem)

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

for i in range(1,N+1):
    counter = 0
    prev_item = 1
    for item in A:
        if item == i:
            counter += 1
            prev_item = item
    print(counter)
    if i < N:
        A.remove(prev_item)
Problem p02711 (python)

Fixed submission:
import sys

N = input()

for N_char in N:
    if N_char == "7":
        print("Yes")
        sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for k in range(N):
    for j in range(k):
        if S[k] == S[j]:
            continue
        for i in range(j):
            if S[i] == S[j] or S[i] == S[k] or j-i == k-j:
                continue
            count+=1
print(count)
Problem p02711 (python)

Fixed submission:
N = int(input())

if (N - 7)% 10 ==0 or (N//10 - 7) % 10==0 or (N//100 % 7)==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = str(input())
result = any(True if m== '7' else False for n in N)


if result;
	print('yes')
  
else ;
	print('no')
Problem p02880 (python)

Fixed submission:
n = int(input())

ln = []

for i in range(1,10):
  for j in range(1,10):
    ln.append(i*j)
    
print("Yes" if n in ln else "No")

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

ln = []

for i in range(1:10):
  for j in range(1:10):
    ln.append(i*j)
    
print("Yes" if n in ln else "No")
Problem p02707 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = dict()
for i in range(n):
    b[i+1] = 0

for i in range(n-1):
    b[a[i]] += 1

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = dict()
for i in range(n):
    b[i+1] = 0

for i in range(n):
    b[a[i]] += 1

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = dict()
for i in range(n):
    b[i+1] = 0

for i in range(n):
    b[a[i]+1] += 1

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