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

Fixed submission:
from collections import deque
import sys
input = sys.stdin.readline

n = int(input())
game = {}

for i in range(1, n+1):
    game[i] = deque((map(int, input().split())))

count = 0
final = n*(n-1)//2
done = []

finish = [0] * (n + 1)
for me in range(1, n + 1):
    if finish[me] == 1 or game[me] == deque([]):
        continue

    you = game[me][0]
    if finish[you] == 1:
        continue
    else:
        if game[you][0] == me:
            done.append(you)
            done.append(me)
            finish[game[you].popleft()] = 1
            finish[game[me].popleft()] = 1
            possible = True
            count += 1
        else:
            continue

for day in range(2, 1000000):
    finish = [0]*(n+1)
    possible = False
    new_done = []
    for me in done:
        if finish[me] == 1 or game[me] == deque([]):
            continue

        you = game[me][0]
        if finish[you] == 1:
            continue
        else:
            if game[you][0] == me:
                finish[game[you].popleft()] = 1
                finish[game[me].popleft()] = 1
                new_done.append(me)
                new_done.append(you)
                possible = True
                count += 1
            else:
                continue
    done = new_done
    if not possible:
        print(-1)
        exit()

    if count == final:
        print(day)
        exit()

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

game = [0]

for _ in range(n):
    comp = list(map(int, input().split()))
    game.append(comp[::-1])

count = 0
final = n*(n-1)//2
for day in range(1, 1000000):
    finish = set()
    possible = False
    for me in range(1, n+1):
        if me in finish or game[me] == []:
            continue

        you = game[me][-1]
        if you in finish:
            continue
        else:
            if game[you][-1] == me:
                finish.add(game[you].pop())
                finish.add(game[me].pop())
                possible = True
                count += 1
            else:
                contin
    if not possible:
        print(-1)
        exit()

    if count == final:
        print(day)
        exit()
Problem p02955 (python)

Fixed submission:
import  numpy as np


def divisors(num):
    array = []
    limit = int(num ** 0.5) + 1
    for i in range(1, limit):
        if num % i == 0:
            div1 = i
            div2 = num//i
            array.append(div1)
            if div1 != div2:
                array.append(div2)
    array.sort(reverse=True)
    return array


n, k = map(int, input().split())
A = np.array(list(map(int, input().split())), dtype=int)

total = sum(A)
candidates = divisors(total)


for div in candidates:
    mods = A % div
    mods.sort()
    add = div - mods

    addcum = np.cumsum(add)
    subcum = np.cumsum(mods)
    for i in range(n):
        addcount = addcum[n-1] - addcum[i]
        subcount = subcum[i]
        if addcount == subcount and addcount <= k:
            print(div)
            exit()

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


def divisors(num):
    array = []
    limit = int(num ** 0.5) + 1
    for i in range(1, limit):
        if num % i == 0:
            div1 = i
            div2 = num//i
            array.append(div1)
            if div1 != div2:
                array.append(div2)
    array.sort(reverse=True)
    return array


n, k = map(int, input().split())
A = np.array(list(map(int, input().split())), dtype=int64)

total = sum(A)
candidates = divisors(total)


for div in candidates:
    mods = A % div
    mods.sort()
    subcum = np.cumsum(mods)
    idx = subcum[n-1] // div
    count = subcum[-1-idx]
    if count <= k:
        print(count)
        exit()
Problem p02990 (python)

Fixed submission:
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n-r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


N, k = map(int, input().split())
if N == k:
    print(1)
    for i in range(N-1):
        print(0)
    exit()

for i in range(1, k+1):
    t = N-k+1
    if i > t:
        print(0)
        continue
    count = cmb(t, i) * cmb(k-1, i-1) % (10**9 + 7)
    print(count)

Buggy submission (verdict: Runtime Error):
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n-r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


N, k = map(int, input().split())
for i in range(1, k+1):
    t = N-k+1
    count = cmb(t, i) * cmb(k-1, i-1) % (10**9 + 7)
    print(count)
Problem p03041 (python)

Fixed submission:
n, k = map(int, input().split())
S = list(input())
S[k-1] = S[k-1].lower()

print(''.join(S))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)

n = int(input())
seen = [-1]*(n+1)
path = defaultdict(dict)

for _ in range(n-1):
    u, v, w = map(int, input().split())
    path[u][v] = w
    path[v][u] = w


def dfs(seen, pos, color):
    if seen[pos] != -1:
        return
    else:
        seen[pos] = color
        change_color = 1 - color
        for nx in path[pos].keys():
            check = path[pos][nx]
            if check % 2 == 1:
                dfs(seen, nx, change_color)
            dfs(seen, nx, color)


dfs(seen, 1, 0)
for i in range(1, n+1):
    print(seen[i])
Problem p03108 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)


class UnionFind:
    def __init__(self, num):
        self.parent = list(range(num))
        self.size = [1] * num

    def get_root(self, node):
        root = self.parent[node]
        if root == node:
            return root
        else:
            root = self.get_root(root)
            self.parent[node] = root
            return root

    def are_in_same_union(self, node1, node2):
        root1 = self.get_root(node1)
        root2 = self.get_root(node2)
        if root1 == root2:
            return True
        else:
            return False

    def combine(self, node1, node2):
        root1 = self.get_root(node1)
        root2 = self.get_root(node2)
        self.parent[root2] = root1
        self.size[root1] += self.size[root2]


n, m = map(int, input().split())
pairs = [list(map(int, input().split())) for _ in range(m)]
pairs = pairs[::-1]
answers = []
UF = UnionFind(n+1)
ans = n*(n-1)//2
answers.append(ans)

for land1, land2 in pairs:
    if UF.are_in_same_union(land1, land2):
        ans = ans
    else:
        root1, root2 = UF.get_root(land1), UF.get_root(land2)
        ans -= UF.size[root1] * UF.size[root2]
        UF.combine(land1, land2)
    answers.append(ans)

answers.pop()
answers = answers[::-1]

for x in answers:
    print(x)

Buggy submission (verdict: Runtime Error):
class UnionFind:
    def __init__(self, num):
        self.parent = list(range(num))
        self.size = [1] * num

    def get_root(self, node):
        root = self.parent[node]
        if root == node:
            return root
        else:
            root = self.get_root(root)
            self.parent[node] = root
            return root

    def are_in_same_union(self, node1, node2):
        root1 = self.get_root(node1)
        root2 = self.get_root(node2)
        if root1 == root2:
            return True
        else:
            return False

    def combine(self, node1, node2):
        root1 = self.get_root(node1)
        root2 = self.get_root(node2)
        self.parent[root2] = root1
        self.size[root1] += self.size[root2]


n, m = map(int, input().split())
pairs = [list(map(int, input().split())) for _ in range(m)]
pairs = pairs[::-1]
answers = []
UF = UnionFind(n+1)
ans = n*(n-1)//2
answers.append(ans)

for land1, land2 in pairs:
    if UF.are_in_same_union(land1, land2):
        ans = ans
    else:
        root1, root2 = UF.get_root(land1), UF.get_root(land2)
        ans -= UF.size[root1] * UF.size[root2]
        UF.combine(land1, land2)
    answers.append(ans)

answers.pop()
answers = answers[::-1]

for x in answers:
    print(x)
Problem p03426 (python)

Fixed submission:
H, W, D = map(int, input().split())

dic = {}
K = H*W//D
memo = [[0]* (K+1) for _ in range(D+1)]

for y in range(1, H+1):
    A = list(map(int, input().split()))
    for x, a in enumerate(A, 1):
        dic[a] = [x, y]

for extra in range(H*W+1, H*W+2*D):
    dic[extra] = [0, 0]

for i in range(1, D+1):
    for j in range(K):
        x, y = dic[i+D*j]
        nx, ny = dic[i+D*(j+1)]
        cost = abs(x-nx) + abs(y-ny)
        memo[i][j+1] = memo[i][j] + cost

Q = int(input())
for _ in range(Q):
    L, R = map(int, input().split())
    i = L % D
    j = L//D
    delta = (R-L)//D
    if i == 0:
        i = D
        j -= 1
    ans = memo[i][j+delta] - memo[i][j]
    print(ans)

Buggy submission (verdict: Runtime Error):
H, W, D = map(int, input().split())

dic = {}


def magic_test(L, R, power):
    if L == R:
        return power
    x, y = dic[L]
    nx, ny = dic[L+D]
    power += abs(x-nx) + abs(y-ny)
    return magic_test(L+D, R, power)


for y in range(1, H+1):
    A = list(map(int, input().split()))

    for x, a in enumerate(A, 1):
        dic[a] = [x, y]

Q = int(input())
for _ in range(Q):
    L, R = map(int, input().split())
    ans = magic_test(L, R, 0)
    print(ans)
Problem p02693 (python)

Fixed submission:
k = int(input())
a,b = map(int,input().split())
if a % k == 0:
    c = a
else:
    c = (a // k) * k + k
if c <= b:
    print("OK")
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
k = int(input())
a,b = map(int,input().split())
c = k
while(c <= b):
	if a <= k <= b:
		print("OK")
		quit()
    c += k
print("NG")
Problem p02711 (python)

Fixed submission:
N = input()
if N[0] == "7" or N[1] == "7" or N[2] == "7":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
def main():
  N = int(input())
  S = input()
  R = 0
  G = 0
  B = 0
  nsum = 0
  for s in S:
      if s == "R":
          R += 1
      elif s == "G":
          G += 1
      else:
          B += 1
  count = 0
  for i in range(N):
      for k in range(i+1,N):
          if not S[i] == S[k]:
              if 2*k - i <= N - 1:
                  if S[i] != S[2*k - i] and S[k] != S[2*k - i]:
                      count += 1
  print(R*G*B - count)

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

Fixed submission:
S = input()

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

Buggy submission (verdict: Runtime Error):
N, X, Y = map(int,input().split())
a = [0 for _ in range(N - 1)]

for lt in range(1, N+1):
    for rt in range(lt+1, N+1):
        a[min(rt-lt-1, abs(X-lt) + abs(Y-rt))] += 1

print(*a, sep="\n")
Problem p03011 (python)

Fixed submission:
a = list(map(int,input().split()))
a.sort()
print(a[0] + a[1])

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
a.sorted()
print(a[0] + a[1])
Problem p03137 (python)

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

if n >= m:
	print(0)
else:
	sorted_x = sorted(x)
 
	diff_x = []
	diff = 0
	result = 0
 
	for i in range(m-1):
		diff = sorted_x[i+1] - sorted_x[i]
		result += diff
		diff_x.append(diff)

	sorted_diff = sorted(diff_x, reverse=True)[:n-1]
 
	for i in range(n-1):
		result -= sorted_diff[i]
	 
	print(result)

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

if m == 1:
	print(0)
else:
	sorted_x = sorted(x)
 
	diff_x = []
	diff = 0
	result = 0
 
	for i in range(m-1):
		diff = sorted_x[i+1] - sorted_x[i]
		result += diff
		diff_x.append(diff)

	sorted_diff = sorted(diff_x, reverse=True)[:n-1]
 
	if n == 1:
 		result -= sorted_diff[0]
	else:
		for i in range(n-1):
			result -= sorted_diff[i]
	 
	print(result)

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

if m == 1:
	print(0)
else:
	sorted_x = sorted(x)
 
	diff_x = []
	diff = 0
	result = 0
 
	for i in range(m-1):
		diff = sorted_x[i+1] - sorted_x[i]
		result += diff
		diff_x.append(diff)

	sorted_diff = sorted(diff_x, reverse=True)[:n-1]
 
 	if n == 1:
 		result -= sorted_diff[0]
	else:
		for i in range(n-1):
			result -= sorted_diff[i]
	 
	print(result)

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

if m == 1:
	print(0)
else:
	sorted_x = sorted(x)
 
	diff_x = []
	diff = 0
	result = 0
 
	for i in range(m-1):
		diff = sorted_x[i+1] - sorted_x[i]
		result += diff
		diff_x.append(diff)

	sorted_diff = sorted(diff_x, reverse=True)[:n-1]
 
	for i in range(n-1):
		result -= sorted_diff[i]
 
	print(result)

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

if m == 1:
	print(0)
else:
	x.sort()

	tupple_diff_x = (x[i+1] - x[i] for i in range(m-1))

	list_diff_x = list(tupple_diff_x)

	for i in range(n-1):
		list_diff_x.remove(max(list_diff_x))

	print(sum(list_diff_x))

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

if m == 1:
	print(0)
else:
	sorted_x = sorted(x)

	tupple_diff_x = (sorted_x[i+1] - sorted_x[i] for i in range(m-1))

	list_diff_x = list(tupple_diff_x)

	for i in range(n-1):
		list_diff_x.remove(max(list_diff_x))

	print(sum(list_diff_x))

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

if m == 1:
	print(0)
else:
	sorted_x = sorted(x)

	diff_x = [sorted_x[i+1] - sorted_x[i] for i in range(m-1)]

	for i in range(n-1):
		diff_x.remove(max(diff_x))

	print(sum(diff_x))

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

if m == 1:
	print(0)
else:
	sorted_x = sorted(x)

	diff_x = []

	for i in range(m-1):
		diff_x.append(sorted_x[i+1] - sorted_x[i])

	for i in range(n-1):
		diff_x.remove(max(diff_x))

	print(sum(diff_x))
Problem p02580 (python)

Fixed submission:
H, W, M = map(int, input().split())

hdic = {}
wdic = {}
hws_h = {}
hws_w = {}

for m in range(M):
    h, w = map(int, input().split())
    if h in hdic.keys():
        hdic[h] += 1
        hws_h[h].append(w)
    else:
        hdic[h] = 1
        hws_h[h] = [w]
    
    if w in wdic.keys():
        wdic[w] += 1
        hws_w[w].append(h)
    else:
        wdic[w] = 1
        hws_w[w] = [h]

hmax = max(hdic.values())
wmax = max(wdic.values())

hs = []
ws = []

hs = [k for k, v in hdic.items() if v==hmax]
ws = [k for k, v in wdic.items() if v==wmax]

f = 1

if len(ws) < len(hs):
    for h in hs:
        wlist = hws_h[h]
        for w in ws:
            if w not in wlist:
                f = 0
                break
        if f == 0:
            break
        
else:
    for w in ws:
        hlist = hws_w[w]
        for h in hs:
            if h not in hlist:
                f = 0
                break
        if f == 0:
            break

print(hmax + wmax - f)

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

H, W, M = map(int, input().split())

G = np.zeros((H, W))
for _ in range(M):
    h, w = map(int, input().split())
    G[h-1, w-1] += 1

h_idx = np.argmax(np.sum(G, axis=0))
w_idx = np.argmax(np.sum(G, axis=1))

print(int(sum(G[:, h_idx]) + sum(G[w_idx]) - G[h_idx, w_idx]))
Problem p02777 (python)

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

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

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

if S==U:
    print(A-1, B)
else:
    print(A, B-1)
Problem p02912 (python)

Fixed submission:
import heapq
N, M = map(int, input().split())
Alist = list(map(int, input().split()))

q = []
for a in Alist:
    heapq.heappush(q, -a)

for i in range(M):
    m = heapq.heappop(q)
    heapq.heappush(q, -((-m)//2))

print(-sum(q))

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

Alist = sorted(Alist, reverse=True)

cnt = 0
while cnt <= M:
    cnt += 1
    Alist[0] = Alist[0]//2
    if Alist[0] <= Alist[1]:
        Alist = sorted(Alist, reverse=True)

print(sum(Alist))

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

def solve(A, M):
    if len(A) > 1:
        if M==1:
            B = sum(A[1:]) + A[0]//2
        else:
            A = [A[0]//2] + A[1:]
            A.sort(reverse=True)
            B = solve(A, M-1)
    else:
        B = A[0] // (2**M)
    return B

Alist.sort(reverse=True)
B = solve(Alist, M)
print(B)
Problem p03041 (python)

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

Buggy submission (verdict: Runtime Error):
N, K = input().split()
K = int(K)
N[K-1].lower()
print(N)
Problem p03108 (python)

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

pairs = []
for _ in range(M):
    pairs.append(list(map(int, input().split())))
pairs = pairs[::-1]

# rank保持のためにunionでrankを足し合わせる
# 島を数えるためにデフォルトのrank=1とする
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [1 for i in range(n)]

    def root(self, x):
        if (self.par[x]==x):
            return x
        else:
            # path compression
            self.par[x] = self.root(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.root(x)
        y = self.root(y)

        if (x==y):
            return

        if (self.rank[x] < self.rank[y]):
            self.par[x] = y
            self.rank[y] += self.rank[x]
            self.rank[x] = 0
        else:
            self.par[y] = x
            self.rank[x] += self.rank[y]
            self.rank[y] = 0

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

        if x==y:
            return 0
        else:
            return self.rank[x] * self.rank[y]

uf = UnionFind(N)
inconvenience = [int(N*(N-1)/2)]
for m in range(M-1):
    inconvenience.append(inconvenience[-1] - uf.get_inconvenience(pairs[m][0]-1, pairs[m][1]-1))
    uf.union(pairs[m][0]-1, pairs[m][1]-1)

print(*inconvenience[::-1], sep='\n')

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())

pairs = []
for _ in range(M):
    pairs.append(list(map(int, input().split())))
pairs = pairs[::-1]

# rank保持のためにpath compressionやめてunionでrankを足し合わせる
# 島を数えるためにデフォルトのrank=1とする
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [1 for i in range(n)]

    def root(self, x):
        if (self.par[x]==x):
            return x
        else:
            # path compression
#            self.par[x] = self.root(self.par[x])
            return self.root(self.par[x])

    def union(self, x, y):
        x = self.root(x)
        y = self.root(y)

        if (x==y):
            return

        if (self.rank[x] < self.rank[y]):
            self.par[x] = y
            self.rank[y] += self.rank[x]
            self.rank[x] = 0
        else:
            self.par[y] = x
            self.rank[x] += self.rank[y]
            self.rank[y] = 0

    def find(self, x, y):
        return self.root(x)==self.root(y)
    
    def get_inconvenience(self):
        rankMat = np.zeros((len(self.rank), len(self.rank)))
        for i in range(len(self.rank)):
            rankMat[i] = self.rank
            rankMat[i][i] = 0
        rank = np.array(self.rank)
        return int(np.sum(np.dot(rank, rankMat))/2)

uf = UnionFind(N)
inconvenience = []
for m in range(M):
    inconvenience.append(uf.get_inconvenience())
    uf.union(pairs[m][0]-1, pairs[m][1]-1)

inconvenience = inconvenience[::-1]
for m in range(M):
    print(inconvenience[m])
Problem p03135 (python)

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

print(T/X)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
X_list = list(map(int, input().split()))
X_list.sort()
err_list = [X_list[i+1] - X_list[i] for i in range(len(X_list)-1)]
err_list.sort()

if N == 1:
    print(sum(err_list))
else:
    print(sum(err_list[:-(N-1)]))
Problem p02552 (python)

Fixed submission:
x = int(input())

if x == 0 :
    print(1)
else :
    print(0)

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

if x = 0 :
  print(1)
else :
  print(0)
Problem p02571 (python)

Fixed submission:
S = input()
T = input()

ans = len(T)

for i in range(len(S) - len(T) + 1):
    diff = 0
    for j in range(len(T)):
        if T[j] != S[i+j]:
            diff += 1
            
    ans = min(ans, diff)

print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

ans = len(T)

for i in range(len(S) - len(T) + 1):
    diff = 0
    for j in range(len(T)):
        if T[i] != S[j]:
            diff += 1
        ans = min(ans, diff)
        
print(ans)
Problem p02629 (python)

Fixed submission:
N = int(input())
alphabets = {i: chr(i + 96) for i in range(1, 26)}
alphabets[0] = 'z'

queue = []
if N <= 26:
    print(alphabets[N])
else:
    while N > 0:
        queue.insert(0, alphabets[N % 26])
        N -= 1
        N //= 26

    print(''.join(queue))

Buggy submission (verdict: Runtime Error):
N = int(input())
alphabets = {i: chr(i + 96) for i in range(1, 27)}

queue = []
while N > 0:
    queue.insert(0, alphabets[N % 26])
    N //= 26
    
print(''.join(queue))
Problem p02682 (python)

Fixed submission:
A, B, C, K = map(int,input().split())

if K <= A:
    print(K)
else:
    cards  = [A, B, C]
    points = [1, 0, -1]
    val = 0
    rem = K
    for i in range(3):
        rem -= cards[i]
        if rem <= 0:
            val += (cards[i] + rem) * points[i]
            break
        else:
            val += cards[i] * points[i]
    print(val)

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

if K <= A:
    print(A)
elif K <= A+B:
    print(A)
else:
    print(2A+B-K)
Problem p02682 (python)

Fixed submission:
A,B,C,K = map(int, input().split())
if A >= K:
  print(K)
elif A + B >= K:
  print(A)
else:
  print(A-(K-A-B))

Buggy submission (verdict: Runtime Error):
A,B,C,K = map(int, input().split())
if A >= K:
  print(K)
elif: A + B >= K:
  print(A)
else
  print(A-(K-A-B))
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
flg = 'No'
for i in range(1,10):
  for j in range(1, 10):
    if N == i*j:
      flg = 'Yes'
print(flg)
Problem p02836 (python)

Fixed submission:
S = str(input())
Slist = list(S)
newlist = list(reversed(Slist))
ans = 0
for i in range((len(S)//2)):
  if Slist[i] != newlist[i]:
    ans += 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
S = str(input())
Slist = list(S)
newlist = list(reversed(Slist))
ans != 0
for i in range((len(S)//2)):
  if Slist[i] == newlist[i]:
    ans += 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
S = str(input())
Slist = list(S)
newlist = list(reversed(Slist))
ans = 0
for i in range((len(S)//2)):
  if Slist[i] == newlist[i]:
    a += 1
    
print(ans)