Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

H, W = map(int, input().split())
A = [list(map(int, input().split())) for i in range(H)]
B = [list(map(int, input().split())) for i in range(H)]
D = [[0]*W for i in range(H)]
mx = 1
for i in range(H):
    for j in range(W):
        D[i][j] = abs(A[i][j]-B[i][j])
        mx = max(mx, D[i][j])
MX = mx*(H+W)
dp = [[[0]*(MX+1) for _ in range(W+1)] for _ in range(H+1)]
dp[1][1][D[0][0]] = 1
for i in range(1,H+1):
    for j in range(1,W+1):
        for k in range(MX+1):
            if dp[i][j][k]:
                if j+1 <= W:
                    d = D[i-1][j]
                    if k+d <= MX:
                        dp[i][j+1][k+d] = 1
                    dp[i][j+1][abs(k-d)] = 1
                if i+1 <= H:
                    d = D[i][j-1]
                    if k+d <= MX:
                        dp[i+1][j][k+d] = 1
                    dp[i+1][j][abs(k-d)] = 1
#for i in range(H+1):
#    for j in range(W+1):
#        print(i, j)
#        print(dp[i][j])
for i in range(MX+1):
    if dp[H][W][i]:
        print(i)
        exit()


Fixed submission:
import sys
input = sys.stdin.readline

H, W = map(int, input().split())
A = [list(map(int, input().split())) for i in range(H)]
B = [list(map(int, input().split())) for i in range(H)]
D = [[0]*W for i in range(H)]
for i in range(H):
    for j in range(W):
        D[i][j] = abs(A[i][j]-B[i][j])
buf = 80*(H+W)
dp = [[0]*W for i in range(H)]
dp[0][0] = 1<<(buf+D[0][0]) | 1<<(buf-D[0][0])
for i in range(H):
    for j in range(W):
        d = D[i][j]
        if i:
            dp[i][j] |= dp[i-1][j]<<d | dp[i-1][j]>>d
        if j:
            dp[i][j] |= dp[i][j-1]<<d | dp[i][j-1]>>d
ans = 10**18
for i in range(buf*2+1):
    if dp[H-1][W-1]&(1<<i):
        ans = min(ans, abs(buf-i))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
ans = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            nums = [str(x) for x in [i, j, k]]
            for s in S:
                if s == nums[0]:
                    nums = nums[1:]
                    if len(nums) == 0:
                        ans += 1
                        break
print(ans)


Fixed submission:
def find(fr, target):
    for i in range(fr, len(S)):
        if S[i] == target:
            return i
    return -1

N = int(input())
S = input()
ans = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            now = find(0, str(i))
            if now == -1: continue
            now = find(now+1, str(j))
            if now == -1: continue
            now = find(now+1, str(k))
            if now == -1: continue
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

N, K = map(int, input().split())
A = list(map(int, input().split()))
cum = [0]*(N+1)
for i in range(1,N+1):
    cum[i] = cum[i-1] + A[i-1]
ans = 0
dic = defaultdict(int)
v_by_indx = defaultdict(int)
for i in range(N+1):
    if i-K >= 0:
        dic[v_by_indx[i-K]] -= 1
    diff = (cum[i]-i)%K
    ans += dic[diff]
    dic[diff] += 1
    v_by_indx[i] = diff
print(ans)
from collections import defaultdict

N, K = map(int, input().split())
A = list(map(int, input().split()))
cum = [0]*(N+1)
for i in range(1,N+1):
    cum[i] = cum[i-1] + A[i-1]
ans = 0
dic = defaultdict(int)
v_by_indx = defaultdict(int)
for i in range(N+1):
    if i-K >= 0:
        dic[v_by_indx[i-K]] -= 1
    diff = (cum[i]-i)%K
    ans += dic[diff]
    dic[diff] += 1
    v_by_indx[i] = diff
print(ans)

Fixed submission:
from collections import defaultdict

N, K = map(int, input().split())
A = list(map(int, input().split()))
cum = [0]*(N+1)
for i in range(1,N+1):
    cum[i] = cum[i-1] + A[i-1]
ans = 0
dic = defaultdict(int)
v_by_indx = defaultdict(int)
for i in range(N+1):
    if i-K >= 0:
        dic[v_by_indx[i-K]] -= 1
    diff = (cum[i]-i)%K
    ans += dic[diff]
    dic[diff] += 1
    v_by_indx[i] = diff
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def f(point):
    k = K
    for i in range(N):
        a = A[i]
        f = F[i]
        if a*f > point:
            k -= a - point//f
        if k < 0:
            return False
    return True

N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)
l = -1
r = 10**12+1
while (r-l) > 1:
    mid = (r+l)//2
    if f(mid):
        r = mid
    else:
        l = mid
print(r)


Fixed submission:
def f(point):
    k = K
    for i in range(N):
        a = A[i]
        f = F[i]
        if a*f > point:
            k -= a - point//f
        if k < 0:
            return False
    # print(point, k)
    return True

N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)
l = -1
r = 10**18+1
while (r-l) > 1:
    mid = (r+l)//2
    if f(mid):
        r = mid
    else:
        l = mid
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
def f(point):
    k = K
    for i in range(N):
        a = A[i]
        f = F[i]
        if a*f > point:
            k -= a - point//f
        if k < 0:
            return False
    # print(point, k)
    return True

N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)
l = -1
r = 10**18+1
while (r-l) > 1:
    mid = (r+l)//2
    if f(mid):
        r = mid
    else:
        l = mid
print(r)


Fixed submission:
def f(point):
    k = K
    for i in range(N):
        a = A[i]
        f = F[i]
        if a*f > point:
            k -= a - point//f
        if k < 0:
            return False
    # print(point, k)
    return True

N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)
l = -1
r = 10**18+1
while (r-l) > 1:
    mid = (r+l)//2
    if f(mid):
        r = mid
    else:
        l = mid
print(r)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
def f(m):
    res = False
    hs = []
    for i in range(0,N-m+1):
        hs.append(hash(S[i:i+m]))
    for i in range(0,N-m+1):
        if hash(S[i:i+m]) in hs[i+m:]:
            res = True
            break
    return res

l = 0
r = N//2+1
while (r-l)>1:
    mid = (r+l)//2
    if f(mid):
        l = mid
    else:
        r = mid
print(l)

Fixed submission:
N = int(input())
S = input()
dp = [[0]*N for _ in range(N)]
ans = 0
for i in range(N-1,0,-1):
    for j in range(i-1,-1,-1):
        if S[i] == S[j]:
            if i < N-1 and j < i-1:
                dp[i][j] = min(dp[i+1][j+1]+1, i-j)
            else:
                dp[i][j] = 1
        ans = max(ans, dp[i][j])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
dp = [[0]*N for _ in range(N)]
ans = 0
for i in range(N-1,0,-1):
    for j in range(i-1,-1,-1):
        if S[i] == S[j]:
            if i < N-1 and j < i-1:
                dp[i][j] = min(dp[i+1][j+1]+1, i-j)
            else:
                dp[i][j] = 1
        ans = max(ans, dp[i][j])
print(ans)

Fixed submission:
N = int(input())
S = input()
dp = [[0]*N for _ in range(N)]
ans = 0
for i in range(N-1,0,-1):
    for j in range(i-1,-1,-1):
        if S[i] == S[j]:
            if i < N-1 and j < i-1:
                dp[i][j] = min(dp[i+1][j+1]+1, i-j)
            else:
                dp[i][j] = 1
        ans = max(ans, dp[i][j])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

N, Q = map(int, input().split())
G = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    G[a].append(b)
    G[b].append(a)
point = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    point[p-1] += x
done = [-1]*N
def dfs(cur, fr, p):
    done[cur] = p
    for nex in G[cur]:
        if nex == fr: continue
        dfs(nex, cur, p+point[nex])
dfs(0, -1, point[0])
ans = []
for i in range(N):
    ans.append(done[i])
print(*ans)


Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

N, Q = map(int, input().split())
G = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    G[a].append(b)
    G[b].append(a)
point = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    point[p-1] += x
done = [-1]*N
def dfs(cur, fr, p):
    done[cur] = p
    for nex in G[cur]:
        if nex == fr: continue
        dfs(nex, cur, p+point[nex])
dfs(0, -1, point[0])
ans = []
for i in range(N):
    ans.append(done[i])
print(*ans)
Buggy python submission (verdict: Runtime Error):
INF = 10**18

def dfs1(cur):
    for to in G1[cur]:
        if done1[to]: continue
        done1[to] = True
        dfs1(to)

def dfs2(cur):
    for to in G2[cur]:
        if done2[to]: continue
        done2[to] = True
        dfs2(to)

N, M, P = map(int, input().split())
G = []
G1 = [[] for i in range(N)]
G2 = [[] for i in range(N)]
for i in range(M):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    G.append((a, b, c-P))
    G1[a].append(b)
    G2[b].append(a)
D = [0]*N
for i in range(N):
    D[i] = -INF
D[0] = 0
for i in range(N):
    for j in range(M):
        fr, to, cost = G[j]
        if D[fr] != -INF and D[fr]+cost > D[to]:
            D[to] = D[fr]+cost
done1 = [False]*N
done1[0] = True
dfs1(0)
done2 = [False]*N
done2[N-1] = True
dfs2(N-1)
for _ in range(N):
    for j in range(M):
        fr, to, cost = G[j]
        if D[fr] != -INF and D[fr]+cost > D[to]:
            D[to] = D[fr]+cost
            if done1[to] and done2[to]:
                print(-1)
                exit()
if D[N-1] < 0:
    print(0)
else:
    print(D[N-1])


Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**18

def dfs1(cur):
    for to in G1[cur]:
        if done1[to]: continue
        done1[to] = True
        dfs1(to)

def dfs2(cur):
    for to in G2[cur]:
        if done2[to]: continue
        done2[to] = True
        dfs2(to)

N, M, P = map(int, input().split())
G = []
G1 = [[] for i in range(N)]
G2 = [[] for i in range(N)]
for i in range(M):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    G.append((a, b, c-P))
    G1[a].append(b)
    G2[b].append(a)
D = [0]*N
for i in range(N):
    D[i] = -INF
D[0] = 0
for i in range(N):
    for j in range(M):
        fr, to, cost = G[j]
        if D[fr] != -INF and D[fr]+cost > D[to]:
            D[to] = D[fr]+cost
done1 = [False]*N
done1[0] = True
dfs1(0)
done2 = [False]*N
done2[N-1] = True
dfs2(N-1)
for _ in range(N):
    for j in range(M):
        fr, to, cost = G[j]
        if D[fr] != -INF and D[fr]+cost > D[to]:
            D[to] = D[fr]+cost
            if done1[to] and done2[to]:
                print(-1)
                exit()
if D[N-1] < 0:
    print(0)
else:
    print(D[N-1])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

N = int(input())
A = [int(input()) for _ in range(N)]
INF = 10**18
arr = []
for a in A:
    l, r = -1, len(arr)
    while (r-l) > 1:
        mid = (r+l)//2
        if arr[mid] < a:
            l = mid
        else:
            r = mid
    if l == -1:
        arr = [a]+arr
    else:
        arr[l] = a
print(len(arr))


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

N = int(input())
A = [int(input()) for _ in range(N)]
INF = 10**18
arr = deque([])
for a in A:
    l, r = -1, len(arr)
    while (r-l) > 1:
        mid = (r+l)//2
        if arr[mid] < a:
            l = mid
        else:
            r = mid
    if l == -1:
        arr.appendleft(a)
    else:
        arr[l] = a
print(len(arr))
Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10**9+7
N, M = map(int, input().split())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
sums = [[0]*(M+2) for i in range(N+2)]
dp = [[0]*(M+1) for i in range(N+1)]
dp[0][0] = 1
for i in range(N+1):
    for j in range(M+1):
        if i-1>=0 and j-1>=0 and S[i-1] == T[j-1]:
            dp[i][j] = sums[i][j]
        sums[i+1][j+1] = sums[i][j+1]+sums[i+1][j]-sums[i][j]+dp[i][j]
        sums[i+1][j+1] %= MOD
print(sums[N+1][M+1])


Fixed submission:
MOD = 10**9+7
N, M = map(int, input().split())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
dp = [[0]*(M+1) for i in range(N+1)]
dp[0][0] = 1
for i in range(N+1):
    for j in range(M+1):
        if i-1 >= 0 and j-1>=0 and S[i-1] == T[j-1]:
            dp[i][j] += dp[i-1][j-1]
        if i-1 >= 0:
            dp[i][j] += dp[i-1][j]
        if j-1>= 0:
            dp[i][j] += dp[i][j-1]
        if i-1 >= 0 and j-1>=0:
            dp[i][j] -= dp[i-1][j-1]
        dp[i][j] %= MOD
print(dp[N][M]%MOD)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from math import gcd
N, M = map(int, input().split())
S = input()
T = input()
g = N//gcd(N, M)*M
ans = ['?']*g
for i in range(N):
    ans[i*g//N] = S[i]
ok = True
for i in range(M):
    idx = i*g//M
    if ans[idx] != '?' and ans[idx] != T[i]:
        ok = False
        break
if ok:
    print(g)
else:
    print(-1)


Fixed submission:
from math import gcd
from collections import defaultdict

N, M = map(int, input().split())
S = input()
T = input()
g = N//gcd(N, M)*M
ans = defaultdict(bool)
for i in range(N):
    ans[i*g//N] = S[i]
ok = True
for i in range(M):
    idx = i*g//M
    if ans[idx] and ans[idx] != T[i]:
        ok = False
        break
if ok:
    print(g)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
from math import gcd
N, M = map(int, input().split())
S = input()
T = input()
g = N//gcd(N, M)*M
ans = ['?']*g
for i in range(N):
    ans[i*g//N] = S[i]
ok = True
for i in range(M):
    idx = i*g//M
    if ans[idx] != '?' and ans[idx] != T[i]:
        ok = False
        break
if ok:
    print(g)
else:
    print(-1)


Fixed submission:
from math import gcd
from collections import defaultdict

N, M = map(int, input().split())
S = input()
T = input()
g = N//gcd(N, M)*M
ans = defaultdict(bool)
for i in range(N):
    ans[i*g//N] = S[i]
ok = True
for i in range(M):
    idx = i*g//M
    if ans[idx] and ans[idx] != T[i]:
        ok = False
        break
if ok:
    print(g)
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10**9+7

S = input()
N = len(S)
dp = [[0]*4 for i in range(N+1)]
dp[0][0] = 1
for i in range(N):
    s = S[i]
    for j in range(4):
        if s == "?":
            dp[i+1][j] += dp[i][j]*3
        else:
            dp[i+1][j] += dp[i][j]
        if j < 3 and (s == "?" or s == "ABC"[j]):
            dp[i+1][j+1] += dp[i][j]
print(dp[N][3]%MOD)


Fixed submission:
MOD = 10**9+7

S = input()
N = len(S)
dp = [[0]*4 for i in range(N+1)]
dp[0][0] = 1
for i in range(N):
    s = S[i]
    for j in range(4):
        if s == "?":
            dp[i+1][j] += dp[i][j]*3%MOD
        else:
            dp[i+1][j] += dp[i][j]%MOD
        if j < 3 and (s == "?" or s == "ABC"[j]):
            dp[i+1][j+1] += dp[i][j]%MOD
print(dp[N][3]%MOD)
Buggy python submission (verdict: Time Limit Exceeded):
INF = 10**18

N = int(input())
T = list(map(int, input().split()))
V = list(map(int, input().split()))
V = [0] + V + [0]
R = [(0, 0)]*(N+2)
for i in range(1,N+1):
    R[i] = (R[i-1][1], R[i-1][1] + T[i-1])
R[N+1] = (R[N][1], R[N][1])
def velocity(i, x):
    if x < R[i][0]:
        return V[i]+R[i][0]-x
    elif R[i][0] <= x <= R[i][1]:
        return V[i]
    else:
        return V[i]+x-R[i][1]
ans = 0
dp = [0]*(R[N+1][1]*2+1)
for x in range(1, R[N+1][1]*2+1):
    mi = INF
    for i in range(N+2):
        mi = min(velocity(i, x/2), mi)
    dp[x] = mi
    ans += 0.25*(dp[x-1]+mi)
print(ans)


Fixed submission:
INF = 10**18

N = int(input())
T = list(map(int, input().split()))
V = list(map(int, input().split()))
V = [0] + V + [0]
R = [(0, 0)]*(N+2)
for i in range(1,N+1):
    R[i] = (R[i-1][1], R[i-1][1] + T[i-1])
R[N+1] = (R[N][1], R[N][1])
def velocity(i, x):
    if x < R[i][0]:
        return V[i]+R[i][0]-x
    elif R[i][0] <= x <= R[i][1]:
        return V[i]
    else:
        return V[i]+x-R[i][1]
ans = 0
dp = [0]*(R[N+1][1]*2+1)
for x in range(1, R[N+1][1]*2+1):
    mi = INF
    for i in range(N+2):
        mi = min(velocity(i, x/2), mi)
    dp[x] = mi
    ans += 0.25*(dp[x-1]+mi)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
MX = 401

N, Ma, Mb = map(int, input().split())
A = [0]*N
B = [0]*N
C = [0]*N
for i in range(N):
    a, b, c = map(int, input().split())
    A[i] = a
    B[i] = b
    C[i] = c
INF = 10**18
dp = [[[INF]*MX for i in range(MX)] for i in range(N+1)]
dp[0][0][0] = 0
for i in range(1, N+1):
    for j in range(0, MX):
        for k in range(0, MX):
            dp[i][j][k] = dp[i-1][j][k]
            if j < A[i-1] or k < B[i-1]: continue
            dp[i][j][k] = min(dp[i][j][k], dp[i-1][j-A[i-1]][k-B[i-1]]+C[i-1])
ans = INF
for i in range(1, MX):
    if Ma*i > MX-1 or Mb*i > MX-1: break
    ans = min(ans, dp[N][Ma*i][Mb*i])
if ans == INF:
    print(-1)
else:
    print(ans)


Fixed submission:
MX = 401

N, Ma, Mb = map(int, input().split())
A = [0]*N
B = [0]*N
C = [0]*N
for i in range(N):
    a, b, c = map(int, input().split())
    A[i] = a
    B[i] = b
    C[i] = c
INF = 10**18
dp = [[[INF]*MX for i in range(MX)] for i in range(N+1)]
dp[0][0][0] = 0
for i in range(1, N+1):
    for j in range(0, MX):
        for k in range(0, MX):
            dp[i][j][k] = dp[i-1][j][k]
            if j < A[i-1] or k < B[i-1]: continue
            dp[i][j][k] = min(dp[i][j][k], dp[i-1][j-A[i-1]][k-B[i-1]]+C[i-1])
ans = INF
for i in range(1, MX):
    if Ma*i > MX-1 or Mb*i > MX-1: break
    ans = min(ans, dp[N][Ma*i][Mb*i])
if ans == INF:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())
if x >= 0 and y >= 0:
    if x <= y:
        ans = abs(x-y)
    else:
        ans = abs(x-y)+2
elif x < 0 and y < 0:
    if x <= y:
        ans = abs(x-y)
    else:
        ans = abs(x-y)+2
elif x >= 0 and y <= 0:
    ans = abs(abs(x)-abs(y))+1
print(ans)


Fixed submission:
x, y = map(int, input().split())
if x >= 0 and y >= 0:
    if x <= y:
        ans = abs(x-y)
    elif y == 0:
        ans = abs(x-y)+1
    else:
        ans = abs(x-y)+2
elif x < 0 and y <= 0:
    if x <= y:
        ans = abs(x-y)
    else:
        ans = abs(x-y)+2
else:
    ans = abs(abs(x)-abs(y))+1
print(ans)
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
if H==1 or W ==1:
    print(1)
else:print(-(-H*W//2))

Fixed submission:
K = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
a = int(input())
b = K[a-1]

print(b)
Buggy python submission (verdict: Runtime Error):
D,T,S = input().split()

if S*T >= D:
  print("Yes")
else:
  print("No")

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

if S*T >= D:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
x = list(map(int, input().split()))
s = 0

for i in range(N-1):
  for j in range(i+1,N):
    s = s + x[i]*x[j]
s = s % 1000000007

print(s)


Fixed submission:
N = int(input())
x = list(map(int, input().split()))
s = sum(x) - x[0]
ans = 0

for i in range(N-1):
  ans = ans + x[i]*s
  s = s - x[i+1]
ans = ans % 1000000007
  
  
print(ans)
Buggy python submission (verdict: Runtime Error):
N = inport()
Ans = 0
for i in range(1,N):
  if not i % 3 == 0:
    if not i % 5 == 0:
      Ans = Ans + i
Ans

Fixed submission:
N = int(input())
A = [0, 0, 0]
bool = 0
for i in range(3):
  A[i] = N % 10
  N = (N - A[i])/10
  if A[i] == 7:
    print('Yes')
    bool = 1
    break
if bool == 0:
    print('No')

Buggy python submission (verdict: Runtime Error):
n = input():
A = [0, 0, 0]
bool = 0
for i in range(3):
  A[i] = N % 10
  N = (N - A[i])/10
  if A[i] == 7:
    print('Yes')
    bool = 1
    break
if bool == 0:
    print('No')

Fixed submission:
N = int(input())
A = [0, 0, 0]
bool = 0
for i in range(3):
  A[i] = N % 10
  N = (N - A[i])/10
  if A[i] == 7:
    print('Yes')
    bool = 1
    break
if bool == 0:
    print('No')

Buggy python submission (verdict: Runtime Error):
A = [0, 0, 0]
bool = 0
for i in range(3):
  A[i] = N % 10
  N = (N - A[i])/10
  if A[i] == 7:
    print('Yes')
    bool = 1
    break
if bool == 0:
    print('No')


Fixed submission:
N = int(input())
A = [0, 0, 0]
bool = 0
for i in range(3):
  A[i] = N % 10
  N = (N - A[i])/10
  if A[i] == 7:
    print('Yes')
    bool = 1
    break
if bool == 0:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if 1<=a<=100 and 1<=b<=100:
  return a*b

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

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 1<=a<=100 and 1<=b<=100:
  return a*b

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

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 1<=a<=100 and 1<=b<=100:
  print(a*b)

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

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 1<=a<=100 and 1<=b<=100:
  print(a*b)


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

Buggy python submission (verdict: Runtime Error):
for i,j in range(1,101):
  print(i*j)

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

Buggy python submission (verdict: Runtime Error):
for i,j in [[1:100],[1:100]]:
  print(i*j)

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

Buggy python submission (verdict: Runtime Error):
for i,j in [1:100,1:100]:
  print i*j

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

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a*b)

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

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
A*B

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

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a*b)

Fixed submission:
a,b = map(int,input().split())
print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
count = 0
while all(a%2==0 for a in A):
  count += 1
print(count)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
while all(a%2==0 for a in A):
  A = [a/2 for a in A]
  count +=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n=input()
n=int(n)
arrstr=input()
ans=0
for no in range(1000):
    no=str(no);
    no=no.zfill(3)
    suc=0
    poi=0
    for i in range(len(arrstr)):
        if(arrstr[i]==no[poi]):
            poi+=1
            if poi==3:
                suc=1
                break
             
    if suc:ans+=1
print(ans)

Fixed submission:
n=input()
n=int(n)
arrstr=input()
ans=0
for no in range(1000):
    no=str(no);
    no=no.zfill(3)
    suc=0
    poi=0
    for i in range(len(arrstr)):
        if(arrstr[i]==no[poi]):
            poi+=1
            if poi==3:
                suc=1
                break
             
    if suc:ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
b = a+a*a+a*a*a
print(int(b))

Fixed submission:
a = int(input())
print(a + a * a + a * a * a)

Buggy python submission (verdict: Runtime Error):
a = input()
print(int(a+a*a+a*a*a))


Fixed submission:
a = int(input())
print(a + a * a + a * a * a)

Buggy python submission (verdict: Runtime Error):
a = input()
print(a+a*a+a*a*a)


Fixed submission:
a = int(input())
print(a + a * a + a * a * a)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
a = 1
b = 1
c = 0
while a <= len(s):
    for n in s:
        for m in t:
            if a == b and n == m:
                c += 1
            b += 1
        a += 1
        b = 1
print(len(s) - c)


Fixed submission:
s = input()
t = input()
a = 0
for i in range(0, len(s)):
    if s[i] != t[i]:
        a += 1
print(a)