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

Fixed submission:
D, G = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(D)]

ans_cnt = 10 ** 20
for i in range(2 ** (D)):
    def make_p(i):
        p = bin(i)[2::]
        while len(p) != D:
            p = "0" + p
        key = D
        for j in range(D - 1, -1, -1):
            if int(p[j]) == 0:
                key = j
                break
        return p, key
    
    p_and_key = make_p(i)
    p = p_and_key[0]
    key = p_and_key[1]
    cnt = 0
    ansP = 0
    for j in range(len(p)):
        if p[j] == "1":
            ansP += pc[j][0] * 100 * (j + 1) + pc[j][1]
            cnt += pc[j][0]
    j = 0
    if int(key) != int(D):
        key = int(key)
        while ansP < G:
            j = int(j)
            if pc[key][0] <= j:
                break
            ansP += 100 * (key + 1)
            cnt += 1
            j += 1
    if ansP >= G:
        ans_cnt = min(ans_cnt, cnt)

print(ans_cnt)

Buggy submission (verdict: Runtime Error):
D, G = map(int, input().split())
p = []
c = []
for i in range(D):
    P, C = map(int, input().split())
    p.append(P)
    c.append(C)

getPoint = [[] for i in range(max(p))]
#getPoint = [0 for i in range(max(p))]
#print(c)
for i in range(max(p)):
    for j in range(D):
        if p[j] - 1> i:
            getPoint[i].append((i + 1) * 100 * (j + 1))
        else:
            getPoint[i].append(p[j] * (j + 1) * 100 + c[j])

#print(getPoint)

def sarch(G, keypoint):
    i = 0
    print(G, keypoint, 1111)
    if max(getPoint[-1]) >= G:
        i = 0
        while True:
            if max(getPoint[i]) >= G:
                print(keypoint + i + 1)
                break
            i += 1
    else:
        G -= max(getPoint[-1])
        keypoint += max(p)
        for i in range(len(getPoint[-1])):
            if getPoint[-1][i] == max(getPoint[-1]):
                key = i
        del p[i]
        del getPoint[max(p) + 1:]
        for i in range(len(getPoint)):
            del getPoint[i][key]
        sarch(G, keypoint)

def sarch2(G, keypoint):
    if G < 0:
        return print(keypoint)
    num = sorted(getPoint[0])[-1]
    for i in range(len(getPoint[0])):
        if getPoint[0][i] == max(getPoint[0]):
            num = i
    i = 0
    while True:
        if getPoint[i][num] < max(getPoint[i]):
            G -= getPoint[i][num]
            keypoint = keypoint + i + 1
            for j in range(len(getPoint)):
                if j < i:
                    #print(j, i)
                    getPoint[j][num] = getPoint[j + i + 1][num]
                else:
                    getPoint[j][num] = getPoint[-1][num]
            sarch2(G, keypoint)
            break
        i += 1
        if i >= len(getPoint):
            break
i = 0
#sarch(G, 0)
sarch2(G, 0)
Problem p03353 (python)

Fixed submission:
s = list(input())
K = int(input())
j = 0
candidate = []
while True:
    if j > 26:
        break
    for i in range(len(s)):
        if s[i] == chr(ord("a") + j):
            for k in range(1, min(6, len(s) - i + 1)):
                candidate.append(s[i:i + k])
    j += 1
i = 1
candidate.sort()
while i < len(candidate):
    if candidate[i] == candidate[i - 1]:
        del candidate[i]
        i -= 1
    i += 1

for i in candidate[K - 1]:
    print(i, end = "")
print()

Buggy submission (verdict: Runtime Error):
s = input()
K = int(input())
S = []
for i in range(1, len(s) + 1):
    k = 0
    while True:
        if len(s) - k - i < 0:
            break
        a = []
        for j in range(0, i):
            a.append(s[j + k])
        S.append(a)
        k += 1

keylist = []
for i in range(len(S)):
    for j in range(len(S)):
        if S[i] == S[j] and i != j and i > j:
            keylist.append(i)

for i in keylist:
    del S[i]
S.sort()
print(''.join(S[K - 1]))
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min([A, B]) + min([C, D]))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min([A, B] + min([C, D])))
Problem p03485 (python)

Fixed submission:
a, b = map(int, input().split())
c = (a + b) / 2
if c == int(c): print(int(c))
else: print(int(c + 1))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
print(int((a + b ) / 2))
Problem p03557 (python)

Fixed submission:
import bisect

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

cnt = 0
cnt_b = []
for i_b in range(n):
    # if max(c) < b[i_b]:
    #     cnt_b.append(0)
    #     continue
    i_a = bisect.bisect_left(a, b[i_b]) - 1
    i_c = bisect.bisect_right(c, b[i_b])
    if i_a < 0 or n <= i_c:
        continue
    cnt += (i_a + 1) * (n - i_c)
    # print(i_a, i_b, i_c)

print(cnt)

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()))
A.sort()
B.sort()
C.sort()
#A < B < C
def sarch(i, left, right, x, y):
    mid = (right + left) // 2
    if right - left < 3:
        return left, right
    elif x[i] <= y[mid]:
        sarch(i, left, mid, x, y)
    elif y[mid] <= x[i]:
        sarch(i, mid, right, x, y)
cnt_a = [0 for i in range(N)]
cnt_b = [0 for i in range(N)]


for i in range(N):
    sg = sarch(i, 0, N - 1, B, C)
    s = sg[0]
    g = sg[1]
    ans = -1
    for j in range(s, g + 1):
        if B[i] < C[j]:
            ans = 1
            break
    if ans == -1:
        j = N
    cnt_b[i] = N - j
ans_2 = 0    
for i in range(N):
    sg = sarch(i, 0, N - 1, A, B)
    s = sg[0]
    g = sg[1]
    ans = -1
    for j in range(s, g + 1):
        if A[i] < B[j]:
            ans = 1
            break
    if ans == 1:
        for k in range(j, N):
            ans_2 += cnt_b[k]
    cnt_a[i] = N - j
print(ans_2)

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()))
A.sort()
B.sort()
C.sort()
#A < B < C
def sarch(i, left, right, x, y):
    mid = (right + left) // 2
    if right - left < 10:
        return left, right
    elif x[i] <= y[mid]:
        sarch(i, left, mid, x, y)
    elif y[mid] <= x[i]:
        sarch(i, mid, right, x, y)
cnt_a = [0 for i in range(N)]
cnt_b = [0 for i in range(N)]


for i in range(N):
    sg = sarch(i, 0, N - 1, B, C)
    s = sg[0]
    g = sg[1]
    ans = -1
    for j in range(s, g + 1):
        if B[i] < C[j]:
            ans = 1
            break
    if ans == -1:
        j = N
    cnt_b[i] = N - j
ans_2 = 0    
for i in range(N):
    sg = sarch(i, 0, N - 1, A, B)
    s = sg[0]
    g = sg[1]
    ans = -1
    for j in range(s, g + 1):
        if A[i] < B[j]:
            ans = 1
            break
    if ans == 1:
        for k in range(j, N):
            ans_2 += cnt_b[k]
    cnt_a[i] = N - j
print(ans_2)
Problem p03565 (python)

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

ans = -1
ansS = []
if len(S) < len(T):
    ans = -1
else:
    for i in range(len(S) - len(T) + 1):
        ans = 1
        for j in range(len(T)):
            #print(S[i + j], T[j])
            if S[i + j] != T[j] and S[i + j] != "?":
                ans = -1
                break
        if ans == 1:
            thisS = S[:i] + T + S[i + len(T):]
            for j in range(len(S)):
                if thisS[j] == "?":
                    thisS[j] = "a"
            ansS.append(thisS)

if len(ansS) == 0:
    print("UNRESTORABLE")
else:
    ansS.sort()
    for i in ansS[0]:
        print(i, end = "")
    print()

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
cnt = 0
for i in range(len(s) - len(t), -1, -1):
    cnt = 0
    for j in range(len(t)):
        if s[j + i] == "?" or s[j + i] == t[j]:
            cnt += 1
        else:
            break
    if cnt == len(t):
        for j in range(len(s)):
            if i <= j < j + len(t):
                print(t[j - i], end = "")
            elif s[j] == "?":
                print("a", end = "")
            else:
                print(s[j], end = "")
        print()
        break
if cnt != len(t):
    print("UNRESTORABLE")

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

S = []
T = []

S_a = []

for i in range(len(s)):
    S.append(s[i])

for i in range(len(t)):
    T.append(t[i])

for i in range(len(S)):
    if S[i] == T[0]:
        for j in range(len(T)):
            if S[i + j] != T[j] and S[i + j] != "?":
                print('a')
                print(S[i+j] + T[j])
                break
        if j == len(T) - 1:
            string = S[0:i] + T + S[i + len(T)::]
            S_a.append(string)
            for k in range(len(string)):
                if string[k] == "?":
                    string[k] = "a"
S_a.sort()
if S_a == []:
    print("UNRESTORABLE")
else: print(''.join(S_a[0]))
Problem p03573 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a == b:
  print(c)
elif b == c:
  print(a)
else:
  print(b)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, inpu())
if a == b:
  print(c)
elif b == c:
  print(a)
else:
  print(b)
Problem p03608 (python)

Fixed submission:
def ABC073D():
    N, M, R = map(int, input().split())
    r = list(map(int, input().split()))
    ABC = [list(map(int, input().split())) for i in range(M)]
    root = [[1000000000 for i in range(N)] for j in range(N)]
    for i, j, k in ABC:
        root[i - 1][j - 1] = k
        root[j - 1][i - 1] = k

    import itertools
    def kumiawase(list_name):  # list_name(リスト)のすべての並び替え
        return itertools.permutations(list_name)


    from scipy.sparse import csgraph
    root = csgraph.floyd_warshall(root)

    a = kumiawase(r)
    ans = float("inf")
    for i in a:
        key = 0
        for j in range(len(i) - 1):
            key += root[i[j] - 1][i[j + 1] - 1]
        if ans > key:
            ans = int(key)
    #print(root)
    print(ans)
ABC073D()

Buggy submission (verdict: Runtime Error):
def ABC073D():
    N, M, R = map(int, input().split())
    r = list(map(int, input().split()))
    ABC = [list(map(int, input().split())) for i in range(M)]
    #root = [[1000000000 for i in range(N)] for i in range(N)]
    #for i, j, k in ABC:
     #   root[i - 1][j - 1] = k
      #  root[j - 1][i - 1] = k

    import itertools
    def kumiawase(list_name):  # list_name(リスト)のすべての並び替えのタプル
        return itertools.permutations(list_name, len(list_name))

    for i in range(N):
        for j in range(N):
            for k in range(N):
                root[i][j] = min(root[i][j], root[i][k] + root[k][j])
    #a = kumiawase(r)
    #ans = 10000000000
    #for i in a:
     #   key = 0
      #  for j in range(len(i) - 1):
       #     key += root[i[j] - 1][i[j + 1] - 1]
        #ans = min(ans, key)
    #print(ans)
ABC073D()

Buggy submission (verdict: Runtime Error):
    import itertools

    def kumiawase(list_name):  # list_name(リスト)のすべての並び替えのタプル
        return itertools.permutations(list_name, len(list_name))

    for i in range(N):
        for j in range(N):
            for k in range(N):
                root[i][j] = min(root[i][j], root[i][k] + root[k][j])
    #a = kumiawase(r)
    #ans = 10000000000
    #for i in a:
     #   key = 0
      #  for j in range(len(i) - 1):
       #     key += root[i[j] - 1][i[j + 1] - 1]
        #ans = min(ans, key)
    #print(ans)
ABC073D()
Problem p03609 (python)

Fixed submission:
X, t = map(int, input().split())
X -= t
if X < 0:
  X = 0
print(X)

Buggy submission (verdict: Runtime Error):
X, t = map(int, input).split())
X -= t
if X < 0:
  X = 0
print(X)
Problem p03651 (python)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
import copy
Z = copy.deepcopy(A)
#for i in range(1, N):
 #   Z.append(abs(A[i] - A[i - 1]))
Z.sort()
i = 0

while True:
    if i >= len(Z):
        break
    if Z[i] == 0:
        del Z[i]
        i -= 1
    elif i > 0 and Z[i] == Z[i - 1]:
        del Z[i]
        i -= 1
    i += 1

ans = -1

import fractions
gcd = Z[0]
for i in range(1, len(Z)):
    gcd = fractions.gcd(gcd, Z[i])

if K % gcd == 0:
    ans = 1
    
if K > max(A):
    ans = -1
       
for i in A:
    if K == i:
        ans = 1
        break

if ans == -1:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
Z = []
for i in range(1, N):
    Z.append(abs(A[i] - A[i - 1]))
Z.sort()
i = 0
while True:
    if i <= len(Z):
        break
    if Z[i] == 0:
        del Z[i]
        i -= 1
    i += 1

    
for i in range(1, len(Z)):
    ans = -1
    if Z[i - 1] % Z[i] != 0:
        ans = 1
    
for i in A:
    if K == i:
        ans = 1
        
if K >= max(A):
    ans = -1
    
if ans == -1:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
Z = []
for i in range(1, N):
    Z.append(abs(A[i] - A[i - 1]))
Z.sort()
i = 0
while True:
    if i <= len(A):
        break
    if Z[i] == 0:
        del Z[i]
        i -= 1
    i += 1

    
for i in range(1, len(Z)):
    ans = -1
    if Z[i - 1] % Z[i] != 0:
        ans = 1
    
for i in A:
    if K == i:
        ans = 1
        
if K >= max(A):
    ans = -1
    
if ans == -1:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
Z = []
for i in range(1, N):
    Z.append(abs(A[i] - A[i - 1]))
Z.sort()
i = 0
while True:
    if i <= len(A):
        break
    if Z[i] == 0:
        del Z[i]
        i -= 1
    i += 1
    
ans = -1
for i in range(1, len(Z)):
    if Z[i - 1] % Z[i] != 0:
        ans = 1
        break
for i in A:
    if K == i:
        ans = 1
if K >= max(A):
    ans = -1
if ans == -1:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
Z = []
for i in range(1, N):
    Z.append(abs(A[i] - A[i - 1]))
Z.sort()
ans = -1
for i in range(1, N - 1):
    if Z[i - 1] % Z[i] != 0:
        ans = 1
        break
for i in A:
    if K == i:
        ans = 1
if K >= max(A):
    ans = -1
if ans == -1:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")
Problem p03719 (python)

Fixed submission:
A, B, C = map(int, input().split())
if A <= C and B >= C:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, iinput().split())
if A <= C and B >= C:
    print("Yes")
else:
    print("No")
Problem p03737 (python)

Fixed submission:
a, b, c = input().split()
print(chr(ord(a[0]) - 32) + chr(ord(b[0]) - 32) + chr(ord(c[0]) - 32))

Buggy submission (verdict: Runtime Error):
a, b, c = input().split()
print(chr(ord(a) + 26) + chr(ord(b) + 26) + chr(ord(c) + 26))
Problem p03796 (python)

Fixed submission:
import math
N = int(input())
print(math.factorial(N) % 1000000007)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = 1
for i in range(1, N ; 1):
    p *= i
print(p % 1000000007)
Problem p03826 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
print(max([A * B, C * D]))

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
print(max[A * B, C * D])
Problem p03846 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
def main():
    if A[0] == N % 2:
        print(0)
        return 0
    if len(A) == 1 and A[0] == 0:
        print(1)
        return 0
    elif len(A) == 1:
        print(0)
        return 0
    if A[0] == 0:
        del A[0]
    if A[0] == 0:
        print(0)
        return 0
    i = 1
    while True:
        if i >= len(A):
            break
        if len(A) % 2 != 0:
            print(0)
            return 0
        if A[i] != A[i - 1]:
            print(0)
            return 0
        i += 2
    i = 2
    while True:
        if i >= len(A):
            break
        if A[i] == A[i - 1]:
            print(0)
            return 0
        i += 2
    print(pow(2, len(A) // 2) % 1000000007)
main()

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
def main():
    if A[0] == N % 2:
        print(0)
        return 0
    if A[0] == 0:
        del A[0]
    if A[0] == 0:
        print(0)
        return 0
    i = 1
    while True:
        if i >= len(A):
            break
        if len(A) % 2 != 0:
            print(0)
            return 0
        if A[i] != A[i - 1]:
            print(0)
            return 0
        i += 2
    i = 2
    while True:
        if i >= len(A):
            break
        if A[i] == A[i - 1]:
            print(0)
            return 0
        i += 2
    print(pow(2, len(A) // 2) % 1000000007)
main()
Problem p03959 (python)

Fixed submission:
N = int(input())
T = list(map(int, input().split()))
A = list(map(int, input().split()))
h = []
for i in range(N):
    if i == 0:
        h.append(1)
    elif i == N - 1:
        h.append(1)
    else:
        if T[i] > T[i - 1]:
            h.append(1)
            if T[i] > A[i]:
                h[i] = 0
                break
        elif A[i] > A[i + 1]:
            h.append(1)
            if A[i] > T[i]:
                h[i] = 0
                break
        else:
            h.append(min([A[i], T[i]]))

if max(T) != max(A):
    h.append(0)
    
cnt = 1
for i in range(len(h)):
    cnt *= h[i]
    cnt %= 1000000007
                     
print(cnt % 1000000007)

Buggy submission (verdict: Runtime Error):
N = int(input())
T = list(map(int, input().split()))
A = list(map(int, input().split()))
h = []
for i in range(N):
    if i == 0:
        h.append(1)
    elif i == N - 1:
        h.append(1)
    else:
        if T[i] > T[i - 1]:
            h.append(1)
            if T[i] > A[i]:
                h[i] = 0
                break
        elif A[i] > A[i + 1]:
            h.append(1)
            if A[i] > T[i]:
                h[i] = 0
                break
        else:
            h.append(min([A[i], T[i]]) % 1000000007)

if max[T] != max[A]:
    h.append(0)
    
cnt = 1
for i in range(len(h)):
    cnt *= h[i]
                     
print(cnt % 1000000007)
Problem p03999 (python)

Fixed submission:
def make(x):
    x = bin(x)[2:]
    while len(x) < len(S) - 1:
        x = "0" + x
    return list(x)

S = input()
a = pow(2, len(S) - 1)
b = []

for i in range(0, a):
    b.append(make(i))

i = 0
j = 0
key = int(S[0])
snum = 1
ans = 0
if len(S) != 1:
    for i in b:
        snum = 1
        key = int(S[0])
        for j in i:
            if j == "0":
                key *= 10
                key += int(S[snum])
            elif j == "1":
                ans += key
                key = int(S[snum])
            #print(i, j, key)
            snum += 1
        ans += key
    print(ans)
else:
    print(S)

Buggy submission (verdict: Runtime Error):
def make(x):
    x = bin(x)[2:]
    while len(x) < len(S) - 1:
        x = "0" + x
    return list(x)

S = input()
a = pow(2, len(S) - 1)
b = []

for i in range(0, a):
    b.append(make(i))

i = 0
j = 0
key = int(S[0])
snum = 1
ans = 0
for i in b:
    snum = 1
    key = int(S[0])
    for j in i:
        if j == "0":
            key *= 10
            key += int(S[snum])
        elif j == "1":
            ans += key
            key = int(S[snum])
        #print(i, j, key)
        snum += 1
    ans += key
print(ans)
Problem p04001 (python)

Fixed submission:
S = input()
S_len = len(S) - 1
p = []
for i in range(2 ** S_len):
    tmp = bin(i)[2::]
    while len(tmp) < S_len:
        tmp = "0" + tmp
    p.append(str(tmp))

sum = 0
for i in p:
    if len(p) == 1:
        sum = S
        break
    P = list(i)
    tmp = int(S[0])
    cnt = 1
    for j in P:
        if j == "0":
            tmp *= 10
            tmp += int(S[cnt])
        else:
            sum += tmp
            tmp = int(S[cnt])
        cnt += 1
    sum += tmp
print(sum)

Buggy submission (verdict: Runtime Error):
S = input()
S_len = len(S) - 1
p = []
for i in range(2 ** S_len):
    tmp = bin(i)[2::]
    while len(tmp) < S_len:
        tmp = "0" + tmp
    p.append(str(tmp))

sum = 0
for i in p:
    P = list(i)
    tmp = int(S[0])
    cnt = 1
    for j in P:
        if j == "0":
            tmp *= 10
            tmp += int(S[cnt])
        else:
            sum += tmp
            tmp = int(S[cnt])
        cnt += 1
    sum += tmp
print(sum)
Problem p04013 (python)

Fixed submission:
n, a = map(int, input().split())
x = list(map(int, input().split()))
x = [0] + x
dp = [[[0 for _ in range(max(x)*n+1)] for _ in range(n+1)] for _ in range(n+1)]
x.sort()
for j in range(n+1):
    for k in range(n+1):
        for s in range(max(x)*n+1):
            if j == 0 and k == 0 and s == 0:
                dp[j][k][s] = 1
            elif j >= 1 and s < x[j]:
                dp[j][k][s] = dp[j-1][k][s]
            elif j >= 1 and k >= 1 and s >= x[j]:
                dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-x[j]]
            else:
                dp[j][k][s] = 0

ans = 0
for k in range(1, n+1):
    try:
        ans += dp[n][k][k*a]
    except:
        pass

print(ans)

Buggy submission (verdict: Runtime Error):
n, a = map(int, input().split())
x = list(map(int, input().split()))
x = [0] + x
dp = [[[0 for _ in range(max(x)*n+1)] for _ in range(n+1)] for _ in range(n+1)]
x.sort()
for j in range(n+1):
    for k in range(n+1):
        for s in range(max(x)*n+1):
            if j == 0 and k == 0 and s == 0:
                dp[j][k][s] = 1
            elif j >= 1 and s < x[j]:
                dp[j][k][s] = dp[j-1][k][s]
            elif j >= 1 and k >= 1 and s >= x[j]:
                dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-x[j]]
            else:
                dp[j][k][s] = 0

ans = 0
for k in range(1, n+1):
    ans += dp[n][k][k*a]

print(ans)
Problem p02554 (python)

Fixed submission:
n = int(input())
p = 10**9+7
print((pow(10, n, p) - 2*pow(9, n, p) + pow(8, n, p)) % p)

Buggy submission (verdict: Runtime Error):
        n = int(input())
        p = 10**9+7
        print((pow(10, n, p) - 2*pow(9, n, p) + pow(8, n, p)) % p)

Buggy submission (verdict: Runtime Error):
    n = int(input())
    p = 10**9+7
    print((pow(10, n, p) - 2*pow(9, n, p) + pow(8, n, p) % p)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = 10**9+7
print((pow(10, n, p) - 2*pow(9, n, p) + pow(8, n, p)) % p