Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
n=int(input())
s=list(map(int,input().split()))
x=np.argsort(s)
print(*x+1)

Fixed submission:
import numpy as np
n=int(input())
s=list(map(int,input().split()))
x=np.argsort(s)
print(*x+1)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=list(map(int,input().split()))
for i in range(1,n+1):
    print(s.index(i)+1,end=" ")

Fixed submission:
import numpy as np
n=int(input())
s=list(map(int,input().split()))
x=np.argsort(s)
print(*x+1)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=1
s=list(map(int,input().split()))
for i in range(1,n+1):
    print(s.index(i)+1,end=" ")

Fixed submission:
import numpy as np
n=int(input())
s=list(map(int,input().split()))
x=np.argsort(s)
print(*x+1)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a>= b:
  ans=1
else:
  c = b-a
  d=c//a+1
  ans=d+1
print(ans)

Fixed submission:
a,b = map(int, input().split())
c=a-1
d=b-1
if d%c==0:
    ans=d//c
else :
    ans=d//c +1
print(ans)
Buggy python submission (verdict: Runtime Error):
a=map(int,input().split())
print(max(a)-min(a))

Fixed submission:
a,b,c=sorted(map(int,input().split()),reverse=False)
print(a*b//2)
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
print((x-a)%b)

Fixed submission:
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n,x,m = map(int,input().split())
    ans = x
    y = [x]
    for i in range(n-1):
        x = (x**2)%m
        if x not in y:
            y.append(x)
        else:
            break
    b = y.index(x)
    N = len(y[b:])
    c = sum(y[b:])
    ans = sum(y[:b]) + c*((n-b)//N)+sum(y[b:b+(n-b)%N])
    print(ans)
resolve()

Fixed submission:
def resolve():
    n,x,m = map(int,input().split())
    ans = x
    y = [x]
    for i in range(n-1):
        x = (x**2)%m
        if x not in y:
            y.append(x)
        else:
            break
    b = y.index(x)
    N = len(y[b:])
    c = sum(y[b:])
    ans = sum(y[:b]) + c*((n-b)//N)+sum(y[b:b+(n-b)%N])
    print(ans)
resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    N = 10**9+7
    ans = 0
    for i in range(n):
        for j in range(i+1,n):
            ans += a[i]*a[j]
            ans %= N
    print(ans)
resolve()

Fixed submission:
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    N = 10**9+7
    s = sum(a) % N
    ans = 0
    for i in a:
        s -= i
        ans += s*i
        ans %= N
    print(ans)
resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def prod(x):
    c = 1
    for i in x:
        c *= i
    return c
        
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(0,n-k):
    if prod(a[i:k+i]) < prod(a[i+1:k+i+1]):
        print('Yes')
    else:
        print('No')

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(0,n-k):
    if a[i]<a[k+i]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
v = []
before = 0
for i in a:
    if i!=before:v.append(i)
    before = i
money = 1000
stack = 0
if v[0]<v[1]:
    buy_point = [1]
else:
    buy_point = [0]
for i in range(1,len(v)-1):
    if v[i-1]  < v[i] < v[i+1]:
        buy_point.append(2)
    elif v[i-1]  > v[i] > v[i+1]:
        buy_point.append(0)
    elif v[i-1]  < v[i] and v[i] > v[i+1]:
        buy_point.append(-1)
    elif v[i-1]  > v[i] and v[i] < v[i+1]:
        buy_point.append(1)
    else:
        print('error')
if v[-2] < v[-1]:
    buy_point.append(-1)
else:
    buy_point.append(0)

for (i,j) in zip(v,buy_point):
    if j == 1:
        stack += money//i
        money = money%i
    elif j == -1:
        money += stack * i
        stack = 0
    elif j == 2:
        stack += money//i
        money = money%i
        
print(money)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
v = []
before = 0
for i in a:
    if i!=before:v.append(i)
    before = i
money = 1000
stack = 0
if len(v) != 1:
    if v[0]<v[1]:
        buy_point = [1]
    else:
        buy_point = [0]
    for i in range(1,len(v)-1):
        if v[i-1]  < v[i] < v[i+1]:
            buy_point.append(2)
        elif v[i-1]  > v[i] > v[i+1]:
            buy_point.append(0)
        elif v[i-1]  < v[i] and v[i] > v[i+1]:
            buy_point.append(-1)
        elif v[i-1]  > v[i] and v[i] < v[i+1]:
            buy_point.append(1)
        else:
            print('error')
    if v[-2] < v[-1]:
        buy_point.append(-1)
    else:
        buy_point.append(0)

    for (i,j) in zip(v,buy_point):
        if j == 1:
            stack += money//i
            money = money%i
        elif j == -1:
            money += stack * i
            stack = 0
        elif j == 2:
            stack += money//i
            money = money%i

print(money)
Buggy python submission (verdict: Runtime Error):
cnt = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for i in range(int(input()):
               s = input()
               cnt[s] += 1
for i in ['AC','WA','TLE','RE']:
               print(f'{i} x {cnt[i]}'
                     
               

Fixed submission:
count = {'AC':0,'WA':0,'TLE':0,'RE':0}
for i in range(int(input())):
  count[input()] += 1

print(f"AC x {count['AC']}")
print(f"WA x {count['WA']}")
print(f"TLE x {count['TLE']}")
print(f"RE x {count['RE']}")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int,input().split()))
for i in range(int(input())):
  b,c = map(int,input().split())
  a = [i if b!=i else c for i in a]
  print(sum(a))

Fixed submission:
import collections
N = int(input())
a = list(map(int,input().split()))
ans = sum(a)
cnt = collections.Counter(a)
for i in range(int(input())):
  b,c = map(int,input().split())
  ans += (c-b)*cnt[b]
  cnt[c] += cnt[b]
  cnt[b] = 0
  print(ans)
Buggy python submission (verdict: Runtime Error):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
N = int(input())
if a == 1:
  print(0)
  exit()
a = factorization(N)
cnt = 0
for i in a:
  temp = i[1]-1
  d = 2
  while temp>=d:
    temp -= d
    d += 1
  cnt+=d-1
print(cnt)
  
  
  
  
  
  

Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
N = int(input())
if N == 1:
  print(0)
  exit()
a = factorization(N)
cnt = 0
for i in a:
  temp = i[1]-1
  d = 2
  while temp>=d:
    temp -= d
    d += 1
  cnt+=d-1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
a = [0]*3
for _ in range(k):
    kind = int(input())
    for i in list(map(int,input().split())):
        a[i-1] += 1
print(a.count(0))
    

Fixed submission:
n,k = map(int,input().split())
a = [0]*n
for _ in range(k):
    kind = int(input())
    for i in list(map(int,input().split())):
        a[i-1] += 1
print(a.count(0) if 0 in a else 0)
Buggy python submission (verdict: Runtime Error):
def resolve():
    a,b,c,d = map(int,input().split())
    A = math.ceil(c/b)
    B = math.ceil(a/d)
    print('Yes' if A <= B else 'No')
    
resolve()

Fixed submission:
import math
def resolve():
    a,b,c,d = map(int,input().split())
    A = math.ceil(c/b)
    B = math.ceil(a/d)
    print('Yes' if A <= B else 'No')
resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    for i in range(n):
        print(a.count(i+1))
resolve()

Fixed submission:
def resolve():
    n = int(input())
    ans = [0]*n
    a = list(map(int,input().split()))
    for i in a:
        ans[i-1] += 1
    for i in ans:
        print(i)
resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    A = collections.Counter(a)
    cnt_0 = 0
    for i in A.values():
        cnt_0 += int(i*(i-1)/2)
    for i in a:
        cnt_1 = A[i]-1
        print(cnt_0-cnt_1)
resolve()

Fixed submission:
import collections
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    A = collections.Counter(a)
    cnt_0 = 0
    for i in A.values():
        cnt_0 += int(i*(i-1)/2)
    for i in a:
        cnt_1 = A[i]-1
        print(cnt_0-cnt_1)
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    cnt_0 = 0
    for i in set(a):
        b = a.count(i)
        cnt_0 += int(b*(b-1)/2)
    for i in a:
        b = a.count(i)
        cnt_1 = b-1
        print(cnt_0-cnt_1)

resolve()

Fixed submission:
import collections
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    A = collections.Counter(a)
    cnt_0 = 0
    for i in A.values():
        cnt_0 += int(i*(i-1)/2)
    for i in a:
        cnt_1 = A[i]-1
        print(cnt_0-cnt_1)
resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    s = input()
    query = int(input())
    r = 0
    for i in range(query):
        q = input()
        if q[0]=='2':
            _,f,c = q.split()
            if (int(f)+r)%2 == 0:
                s = s + c
            else:
                s = c + s
        else:
            r = (r+1)%2
    print(s if r==0 else s[::-1])
resolve()

Fixed submission:
def resolve():
    s = input()
    query = int(input())
    r = 0
    left = ''
    for i in range(query):
        q = input()
        if q[0]=='2':
            _,f,c = q.split()
            if (int(f)+r)%2 == 0:
                s += c
            else:
                left += c
        else:
            r = (r+1)%2
    print(left[::-1]+s if r==0 else s[::-1]+left)
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    s = input()
    query = int(input())
    r = 0
    for i in range(query):
        q = input()
        if q[0]=='2':
            _,f,c = q.split()
            if (int(f)+r)%2 == 0:
                s = s + c
            else:
                s = c + s
        else:
            r = (r+1)%2
    print(s if r==0 else s[::-1])
resolve()

Fixed submission:
def resolve():
    s = input()
    query = int(input())
    r = 0
    left = ''
    for i in range(query):
        q = input()
        if q[0]=='2':
            _,f,c = q.split()
            if (int(f)+r)%2 == 0:
                s += c
            else:
                left += c
        else:
            r = (r+1)%2
    print(left[::-1]+s if r==0 else s[::-1]+left)
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    s = input()
    query = int(input())
    for i in range(query):
        q = input()
        if q[0]=='2':
            _,f,c = q.split()
            if f == '1':
                s = c + s
            else:
                s = s + c
        else:
            s = s[::-1]
    print(s)
resolve()

Fixed submission:
def resolve():
    s = input()
    query = int(input())
    r = 0
    left = ''
    for i in range(query):
        q = input()
        if q[0]=='2':
            _,f,c = q.split()
            if (int(f)+r)%2 == 0:
                s += c
            else:
                left += c
        else:
            r = (r+1)%2
    print(left[::-1]+s if r==0 else s[::-1]+left)
resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    s,t = input().split()
    a,b = map(int,input().split())
    u = input()
    print(a-(s==u),b-(t==u))
reoslve()

Fixed submission:
def resolve():
    s,t = input().split()
    a,b = map(int,input().split())
    u = input()
    print(a-(s==u),b-(t==u))
resolve()
Buggy python submission (verdict: Runtime Error):
h,a = map(int,input().split())
print(h//a+map(h%a!=0))

Fixed submission:
h,a = map(int,input().split())
print(h//a+(h%a!=0))
Buggy python submission (verdict: Runtime Error):
def resolve():
    n,m = map(int,input().split())
    ac_list = [1]*n
    ac = 0
    wa = 0
    for _ in range(m):
        p,s = input().split()
        if s == 'WA' and ac_list[int(p)-1]==1:
            wa += 1
        elif s == 'AC' and ac_list[int(p)-1]==1:
            ac += 1
            ac_list[int(p)-1] = 0
    print(f'{ac} {wa}')
resolve():

Fixed submission:
def resolve():
    n,m = map(int,input().split())
    ac_list = [0]*n
    wa_count = [0]*n
    ac = 0
    wa = 0
    for _ in range(m):
        p,s = input().split()
        if s == 'WA' and (ac_list[int(p)-1]==0):
            wa_count[int(p)-1] += 1
        elif s == 'AC' and (ac_list[int(p)-1]==0):
            ac += 1
            ac_list[int(p)-1] = 1
    for (i,j) in zip(wa_count,ac_list):
        if j: wa+=i
    print(f'{ac} {wa}')
resolve()
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(a*b//math.gcd(a,b))

Fixed submission:
import math
a,b = map(int,input().split())
print(a*b//math.gcd(a,b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
if 1 not in a: 
    print(-1)
else:
    cnt = 1
    a = a[a.index(cnt)+1:]
    while cnt+1 in a:
        cnt += 1 
        a = a[a.index(cnt):]
    print(n - cnt)

Fixed submission:
n = int(input())
a = [int(i)-1 for i in input().split()]
ans = 0
for i in range(n):
    if a[i] != (i - ans):
        ans += 1
print(ans if ans != n else -1)
Buggy python submission (verdict: Runtime Error):
def distance(a,b):
    return ((a[0]-b[0])**2+(a[1]-b[1])**2)**0.5
n = int(input())
a = [tuple(map(int,input().split())) for _ in range(n)]
l = []
for m in list(itertools.permutations(a)):
    d = 0
    for i in range(n-1):
        d += distance(m[i],m[i+1])
    l.append(d)
print(sum(l)/len(l))

Fixed submission:
import itertools
def distance(a,b):
    return ((a[0]-b[0])**2+(a[1]-b[1])**2)**0.5
n = int(input())
a = [tuple(map(int,input().split())) for _ in range(n)]
l = []
for m in list(itertools.permutations(a)):
    d = 0
    for i in range(n-1):
        d += distance(m[i],m[i+1])
    l.append(d)
print(sum(l)/len(l))
Buggy python submission (verdict: Runtime Error):
	import numpy as np
    a, b, x = map(int,input().split())
    if x >= a**2*b/2:
        ans = np.arctan(2*(b-x/a**2)/a)
    else:
        ans = np.arctan(a*b/2/x*b)
    print(ans*180/np.pi)

Fixed submission:
import numpy as np
a, b, x = map(int,input().split())
if x >= a**2*b/2:
    ans = np.arctan(2*(b-x/a**2)/a)
else:
    ans = np.arctan(a*b/2/x*b)
print(ans*180/np.pi)

Buggy python submission (verdict: Runtime Error):
    a, b, x = map(int,input().split())
    if x >= a**2*b/2:
        ans = np.arctan(2*(b-x/a**2)/a)
    else:
        ans = np.arctan(a*b/2/x*b)
    print(ans*180/np.pi)

Fixed submission:
import numpy as np
a, b, x = map(int,input().split())
if x >= a**2*b/2:
    ans = np.arctan(2*(b-x/a**2)/a)
else:
    ans = np.arctan(a*b/2/x*b)
print(ans*180/np.pi)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
def resolve():
    n = int(input())
    l = tuple(map(int,input().split()))
    cnt = 0
    for i in itertools.combinations(l,3):
        a,b,c = i
        if a<b+c and b<c+a and c<a+b:
            cnt += 1
    print(cnt)
resolve()

Fixed submission:
import bisect
def resolve():
    n = int(input())
    l = sorted(list(map(int,input().split())))
    ans = 0
    for a in range(n):
        for b in range(a+1,n):
            c = bisect.bisect_left(l,l[a]+l[b])
            if c > b:
                ans += c-b-1
            else:
                pass
    print(ans)
resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    ans = [a.index(i+1)+1 for i in range(n)]
    print(' '.join(map(str,ans)))
resolve()

Fixed submission:
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    attend = [0]*n
    for i,j in enumerate(a):
        attend[j-1] = i+1
    print(*attend)
resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    words = []
    for _ in range(n):
        words.append(str(sorted(list(input()))))
    a = collections.Counter(words)
    ans = 0
    for i in a.values():
        ans += i*(i-1)//2
    print(ans)
resolve()

Fixed submission:
import collections
def resolve():
    n = int(input())
    words = []
    for _ in range(n):
        words.append(str(sorted(list(input()))))
    a = collections.Counter(words)
    ans = 0
    for i in a.values():
        ans += i*(i-1)//2
    print(ans)
resolve()
Buggy python submission (verdict: Runtime Error):
n = int(input())
work = [list(map(int,input().split())) for _ in range(n)]
work = sorted(work,key = lambda x:x[1])
a = [0] * n
a[0] = work[0][0]
for i in range(1,N):
    a[i] = a[i-1] + work[i][0]
ans = 'Yes'
for j in range(N):
    if a[j] > work[j][1]:
        ans = 'No'
        break
print(ans)

Fixed submission:
n = int(input())
work = [list(map(int,input().split())) for _ in range(n)]
work = sorted(work,key = lambda x:x[1])
a = [0] * n
a[0] = work[0][0]
for i in range(1,n):
    a[i] = a[i-1] + work[i][0]
ans = 'Yes'
for j in range(n):
    if a[j] > work[j][1]:
        ans = 'No'
        break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
work = [list(map(int,input().split())) for _ in range(n)]
work = sorted(work,key = lambda x:x[1])
a = [0] * n
a[0] = work[0][0]
for i in range(1,N):
    a[i] = a[i-1] + work[i][0]
ans = 'Yes'
for j in range(N):
    if a[j] > work[j][1]:
        ans = 'No'
        break
print(ans)

Fixed submission:
n = int(input())
work = [list(map(int,input().split())) for _ in range(n)]
work = sorted(work,key = lambda x:x[1])
a = [0] * n
a[0] = work[0][0]
for i in range(1,n):
    a[i] = a[i-1] + work[i][0]
ans = 'Yes'
for j in range(n):
    if a[j] > work[j][1]:
        ans = 'No'
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(int(n**0.5),0,-1):
    if n%i == 0:
        a = max(i,n//i)
        print(int(math.log10(a))+1)
        break

Fixed submission:
import math
n = int(input())
for i in range(int(n**0.5),0,-1):
    if n%i == 0:
        a = max(i,n//i)
        print(int(math.log10(a))+1)
        break
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    input = sys.stdin.readline

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

    ans = 0
    for i in range(N):
        ans += sum(list(map(lambda x: A[i] * x, A[i + 1:])))
    print(ans % (10 ** 9 + 7))


main()


Fixed submission:
def main():
    import sys
    input = sys.stdin.readline

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

    ans = 0
    all_num = sum(A)
    for i in range(N, 1, -1):
        all_num -= A[i - 1]
        ans += A[i - 1] * all_num
    print(ans % (10 ** 9 + 7))


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

if N == 0:
    print(X)
else:
    p = list(map(int, input().split()))
    nums = {i for i in range(1, 101)}
    nothings = nums - set(p)
    differences = {}
    for i in nothings:
        difference = abs(X - i)
        if difference in differences:
            differences[difference].append(i)
        else:
            differences[difference] = [i]
    ans = sorted(differences.items())
    print(min(ans[0][1]))

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

if N == 0:
    print(X)
else:
    p = list(map(int, input().split()))
    nums = {i for i in range(0, 102)}
    nothings = nums - set(p)
    differences = {}
    for i in nothings:
        difference = abs(X - i)
        if difference in differences:
            differences[difference].append(i)
        else:
            differences[difference] = [i]
    ans = sorted(differences.items())
    print(min(ans[0][1]))
Buggy python submission (verdict: Time Limit Exceeded):
import functools
import operator


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

prod = functools.partial(functools.reduce, operator.mul)
if 10 ** 18 < prod(A):
    print(-1)
else:
    print(prod(A))

Fixed submission:
def ans(a):
    ans = 1
    if 0 in a:
        return 0
    for i in A:
        ans *= i
        if 10 ** 18 < ans:
            ans = -1
            return ans
    return ans


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

print(ans(A))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = 1
for i in A:
    ans *= i
if 10 ** 18 < ans:
    print(-1)
else:
    print(ans)


Fixed submission:
def ans(a):
    ans = 1
    if 0 in a:
        return 0
    for i in A:
        ans *= i
        if 10 ** 18 < ans:
            ans = -1
            return ans
    return ans


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

print(ans(A))
Buggy python submission (verdict: Runtime Error):
import sys
input_line = [int(i) for i in input().split(" ")]
n = input_line[0]
m = input_line[1]

ans = ["0"] * n
for i in range(m):
    input_line = input().split(" ")
    if ans[int(input_line[0] - 1)] == "0" or ans[int(input_line[0] - 1)] == input_line[1]:
        ans[int(input_line[0] - 1)] = input_line[1]
    else:
        print(-1)
        sys.exit()

if m == 0:
    ans[0] = "1"

ans_num = int("".join(ans))
if n == len(str(ans_num)):
    print(ans_num)
else:
    print(-1)


Fixed submission:
import sys
input_line = [int(i) for i in input().split(" ")]
n = input_line[0]
m = input_line[1]

ans = ["1"] + ["0"] * (n - 1)
flag = 0
for i in range(m):
    input_line = input().split(" ")
    if int(input_line[0]) == 1 and flag == 0:
        ans[int(input_line[0]) - 1] = input_line[1]
        flag = 1
        continue
    elif int(input_line[0]) == 1 and flag == 1:
        if input_line[1] != ans[0]:
            print(-1)
            sys.exit()

    if ans[int(input_line[0]) - 1] == "0" or ans[int(input_line[0]) - 1] == input_line[1]:
        ans[int(input_line[0]) - 1] = input_line[1]
    else:
        print(-1)
        sys.exit()

if m == 0 and n == 1:
    ans[0] = "0"

ans_num = int("".join(ans))
if n == len(str(ans_num)):
    print(ans_num)
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
count = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        if i*j >= N:
            break
        else:
            count += 1
print(count)

Fixed submission:
N = int(input())
count = 0
flg = False
for i in range(1,N):

    count +=  int(N / i)
    if N% i == 0:
        count -=1
print(count)