Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# 2020/04/22
# AtCoder Beginner Contest 142 - C

# Input
n = int(input())
a = list(map(int,input().split()))
tbl = [-1] * (n+1)

# Calc
for i in range(n):
    tbl[a[i]] = i+1

# Output
ans = str(tbl[1])
for i in range(2, n+1):
    ans = ans + " " + str(tbl[i])

print(ans)

Fixed submission:
# 2020/04/22
# AtCoder Beginner Contest 142 - C

# Input
n = int(input())
a = list(map(int,input().split()))
tbl = [-1] * (n+1)

# Calc
for i in range(n):
    tbl[a[i]] = i+1

tbl.pop(0)

# Output
print(' '.join(map(str, tbl)))

Buggy python submission (verdict: Time Limit Exceeded):
# 2020/04/22
# AtCoder Beginner Contest 142 - C

from operator import itemgetter

# Input
n = int(input())
a = list(map(int,input().split()))
tbl = list()

# Calc
for i in range(n):
    wkl = [i+1, a[i]]
    tbl.append(wkl)

# Sort key B
tbl.sort(key=itemgetter(1))

# Output
ans = str(tbl[0][0])
for i in range(1, n):
    ans = ans + " " + str(tbl[i][0])

print(ans)

Fixed submission:
# 2020/04/22
# AtCoder Beginner Contest 142 - C

# Input
n = int(input())
a = list(map(int,input().split()))
tbl = [-1] * (n+1)

# Calc
for i in range(n):
    tbl[a[i]] = i+1

tbl.pop(0)

# Output
print(' '.join(map(str, tbl)))

Buggy python submission (verdict: Time Limit Exceeded):
# 2020/04/22
# AtCoder Beginner Contest 142 - C

from operator import itemgetter

# Input
n = int(input())
a = list(map(int,input().split()))
tbl = list()

# Calc
for i in range(n):
    wkl = [i+1, a[i]]
    tbl.append(wkl)

# Sort key B
tbl.sort(key=itemgetter(1))

# Output
ans = str(tbl[0][0])
for i in range(1, n):
    ans = ans + " " + str(tbl[i][0])

print(ans)

Fixed submission:
# 2020/04/22
# AtCoder Beginner Contest 142 - C

# Input
n = int(input())
a = list(map(int,input().split()))
tbl = [-1] * (n+1)

# Calc
for i in range(n):
    tbl[a[i]] = i+1

tbl.pop(0)

# Output
print(' '.join(map(str, tbl)))
Buggy python submission (verdict: Time Limit Exceeded):
# 2020/08/16
# AtCoder Beginner Contest 139 - D

# Input
n = int(input())

# Calc
asum = 0
# for i in range(1, n+1):
#     asum = asum + (n + 1 - i) % i
for i in range(1, n):
    asum = asum + i

# Output
print(asum)


Fixed submission:
# 2020/08/16
# AtCoder Beginner Contest 139 - D

# Input
n = int(input())

# Calc
ans = n * (n-1) // 2

# Output
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# 2019/09/01
# AtCoder Beginner Contest 139 - D

# Input
n = int(input())

# Make List
p = n
asum = n % 1
lim = n + 1

for i in range(2, lim):
    p = i - 1
    asum = asum + p % i

# Output
print(asum)


Fixed submission:
# 2020/08/16
# AtCoder Beginner Contest 139 - D

# Input
n = int(input())

# Calc
ans = n * (n-1) // 2

# Output
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# 2019/09/01
# AtCoder Beginner Contest 139 - D

# Input
n = int(input())
plist = list()
mlist = list()

# Make List
p = n
asum = n % 1
plist.append(p)
plist.append(asum)

for i in range(2, n + 1):
    p = i - 1
    plist.append(p)
    mlist.append(p % i)
    asum = asum + p % i

# Output
print(asum)


Fixed submission:
# 2020/08/16
# AtCoder Beginner Contest 139 - D

# Input
n = int(input())

# Calc
ans = n * (n-1) // 2

# Output
print(ans)
Buggy python submission (verdict: Runtime Error):
# 2020/05/10
# AtCoder Beginner Contest 129 - C

# Input
n, m = map(int,input().split())
sav_a = -1
ans = 0
a = [0] * (n+1)
imp_flg = False
for i in range(m):
    ia = int(input())
    a[ia] = 1
    if sav_a + 1 == ia:
        imp_flg = True
    sav_a = ia

dp = [0] * (n+1)

if imp_flg == True:
    ans = 0
else:
    dp[1] = 1
    dp[2] = 2
    if a[1] == 1:
        dp[1] = 0
        dp[2] = 1
    if a[2] == 1:
        dp[2] = 0

    for i in range(3, n+1):
        if a[i] == 0:
            dp[i] = (dp[i-1] + dp[i-2]) % (10**9+7)

# Output
print(dp[n])


Fixed submission:
# 2020/05/10
# AtCoder Beginner Contest 129 - C

# Input
n, m = map(int,input().split())
sav_a = -1
ans = 0
a = [0] * (n+1)
imp_flg = False
for i in range(m):
    ia = int(input())
    a[ia] = 1
    if sav_a + 1 == ia:
        imp_flg = True
    sav_a = ia

dp = [0] * (n+1)

if imp_flg != True and n > 1:
    dp[1] = 1
    dp[2] = 2
    if a[1] == 1:
        dp[1] = 0
        dp[2] = 1
    if a[2] == 1:
        dp[2] = 0

    for i in range(3, n+1):
        if a[i] == 0:
            dp[i] = (dp[i-1] + dp[i-2]) % (10**9+7)
elif n == 1:
    dp[1] = 1

# Output
print(dp[n])
Buggy python submission (verdict: Runtime Error):
# 2019/06/02
# AtCoder Grand Contest 034 - A

# For the answer:
# 1-1. Search min(ac) and max(abcd)
# 1-2. Search ## between min and max
# 2. Case:B<C, Left of B is . and (. or C), or exist .. -> Yes

# Def 1 : True is "Case No"
def searchRock(in_l, in_r, in_str, in_tg):
    rcflg = False
    for i in range(in_l - 1, in_r - 1): # Change -2 -> -1
        if in_str[i] == in_tg and in_str[i+1] == in_tg:
            rcflg = True
            break
    return rcflg

def searchPlain(in_l, in_r, in_str, in_tg):
    rcflg = False
    for i in range(in_l - 1, in_r - 2): # Change -2 -> -1
        if in_str[i] == in_tg and in_str[i+1] == in_tg and in_str[i+2] == in_tg:
            rcflg = True
            break
    return rcflg

# Input
n, a, b, c, d = map(int, input().split())
s = input()
ans = ""

# 1. Search ##
if c < b:
    # Search between a and c, b and d
    rflg = searchRock(a, c+1, s, "#")
    if rflg == True:
        ans = "No"
    else:
        rflg = searchRock(b, d+1, s, "#")
        if rflg == True:
            ans = "No"

else:
    # Search between a and max(c, d)
    rflg = searchRock(a, max(c, d)+1, s, "#")
    if rflg == True:
        ans = "No"
    
# 2. Check around b
if ans != "No":
    if (b < c and d < c):
        # Case: B < D < C 
        pflg = searchPlain(b-1, d, s, ".")
#        if pflg == False:
#            if s[b-2] == "." and s[b] == ".":
#                ans = "Yes"
#            else:
#                ans = "No"
        else:
            ans = "Yes"
    else:
        ans = "Yes"

# Output
print(ans)


Fixed submission:
# 2019/06/02
# AtCoder Grand Contest 034 - A

# For the answer:
# 1-1. Search min(ac) and max(abcd)
# 1-2. Search ## between min and max
# 2. Case:B<C, Left of B is . and (. or C), or exist .. -> Yes

# Def 1 : True is "Case No"
def searchRock(in_l, in_r, in_str, in_tg):
    rcflg = False
    for i in range(in_l - 1, in_r - 1): # Change -2 -> -1
        if in_str[i] == in_tg and in_str[i+1] == in_tg:
            rcflg = True
            break
    return rcflg

def searchPlain(in_l, in_r, in_str, in_tg):
    rcflg = False
    for i in range(in_l - 1, in_r - 1): # Change -2 -> -1
        if in_str[i] == in_tg and in_str[i+1] == in_tg and in_str[i+2] == in_tg:
            rcflg = True
            break
    return rcflg

# Input
n, a, b, c, d = map(int, input().split())
s = input()
ans = ""

# 1. Search ##
if c < b:
    # Search between a and c, b and d
    rflg = searchRock(a, c+1, s, "#")
    if rflg == True:
        ans = "No"
    else:
        rflg = searchRock(b, d+1, s, "#")
        if rflg == True:
            ans = "No"

else:
    # Search between a and max(c, d)
    rflg = searchRock(a, max(c, d)+1, s, "#")
    if rflg == True:
        ans = "No"
    
# 2. Check around b
if ans != "No":
    if (b < c and d < c):
        # Case: B < D < C 
        pflg = searchPlain(b-1, d, s, ".")
        if pflg == False:
            ans = "No"
#            if s[b-2] == "." and s[b] == ".":
#                ans = "Yes"
#            else:
#                ans = "No"
        else:
            ans = "Yes"
    else:
        ans = "Yes"

# Output
print(ans)
Buggy python submission (verdict: Runtime Error):
# 2019/03/16
# AtCoder Grand Contest 031 - A

# Input
n = int(input())
s = input()

aprcnt = [1] * 26

# Count up Alphabets
for idx in range(n):
    w_idx = ord(s[idx]) - 97
    aprcnt[w_idx] += 1

# Calc Combination count
ans = 1
for idx in range(n):
    ans = ans * aprcnt[idx]

# Reduces 1 in choose nothing case
ans -= 1

# Output
print(ans)


Fixed submission:
# 2019/03/17
# AtCoder Grand Contest 031 - A

# Input
n = int(input())
s = input()

aprcnt = [1] * 26

# Count up Alphabets
for idx in range(n):
    w_idx = ord(s[idx]) - 97
    aprcnt[w_idx] += 1

# Calc Combination count
ans = 1
for idx in range(26):
    ans = ans * aprcnt[idx]

# Reduces 1 in choose nothing case
ans -= 1
ans = ans % (10**9 + 7)

# Output
print(ans)
Buggy python submission (verdict: Runtime Error):
# 2019/01/13
# KEYENCE Programming Contest 2019 - B

# Input
s = input()

# Init
key_str = "keyence"
search_idx = 0
okflg = 0
ngcnt = 0

# Search
for idx in range(len(s)):
    if s[idx] == key_str[search_idx]:
        search_idx += 1
        okflg = 1
    else:
        if okflg == 1:
            ngcnt += 1
            okflg = 0
        if ngcnt > 1:
            break

# Check
if search_idx == len(key_str):
    ans = "YES"
else:
    ans = "NO"

# Output
print(ans)


Fixed submission:
# 2019/01/13
# KEYENCE Programming Contest 2019 - B

# Input
s = input()

# Init
key_str = "keyence"
ans = "NO"
search_idx = 0

# Search
if s[0] == key_str[0]:
    # Pattern 2 or 3
    for idx in range(len(s)):
        if s[idx] == key_str[search_idx]:
            search_idx += 1
            if search_idx == len(key_str):
                # Pattern 3
                ans = "YES"
                break

        else:
            # Pattern 2
            for idx2 in range(len(s) - len(key_str) + search_idx, len(s)):
                if s[idx2] == key_str[search_idx]:
                    search_idx += 1
                    if search_idx == len(key_str):
                       ans = "YES"
            break
else:
    # Pattern 1
    for idx in range(len(s) - len(key_str), len(s)):
        if s[idx] == key_str[search_idx]:
            search_idx += 1
            if search_idx == len(key_str):
                ans = "YES"
                break

# Output
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# 2020/02/09
# Educational DP Contest / DP まとめコンテスト - B

# Input
n, k = map(int,input().split())
h = list(map(int,input().split()))

dp = [10 ** 10] * n
dp[0] = 0

for i in range(1, n):
    j = max(0, i-k)
    while(j < i):
        dp[i] = min(dp[i], abs(h[i] - h[j]) + dp[j])
        j = j + 1

# Output
print(dp[n-1])

Fixed submission:
# 2020/02/09
# Educational DP Contest / DP まとめコンテスト - B

# Input
n, k = map(int,input().split())
h = list(map(int,input().split()))

dp = [10 ** 10] * n
dp[0] = 0

for i in range(1, n):
    j = max(0, i-k)
    while(j < i):
        dp[i] = min(dp[i], abs(h[i] - h[j]) + dp[j])
        j = j + 1

# Output
print(dp[n-1])

Buggy python submission (verdict: Time Limit Exceeded):
# 2020/02/09
# Educational DP Contest / DP まとめコンテスト - B

# Input
n, k = map(int,input().split())
h = list(map(int,input().split()))

dp = [10 ** 10] * n
dp[0] = 0

for i in range(1, n):
    j = max(0, i-k)
    while(j < i):
        acost = abs(h[i] - h[j]) + dp[j]
        if dp[i] > acost:
            dp[i] = acost
        j = j + 1

# Output
print(dp[n-1])

Fixed submission:
# 2020/02/09
# Educational DP Contest / DP まとめコンテスト - B

# Input
n, k = map(int,input().split())
h = list(map(int,input().split()))

dp = [10 ** 10] * n
dp[0] = 0

for i in range(1, n):
    j = max(0, i-k)
    while(j < i):
        dp[i] = min(dp[i], abs(h[i] - h[j]) + dp[j])
        j = j + 1

# Output
print(dp[n-1])

Buggy python submission (verdict: Time Limit Exceeded):
# 2020/02/09
# Educational DP Contest / DP まとめコンテスト - B

# Input
n, k = map(int,input().split())
h = list(map(int,input().split()))

dp = [0] * n

for i in range(1, n):
    j = max(0, i-k)
    minh = 10 ** 10
    while(j < i):
        acost = abs(h[i] - h[j]) + dp[j]
        if minh > acost:
            minh = acost
        j = j + 1
    dp[i] = minh

# Output
print(dp[n-1])

Fixed submission:
# 2020/02/09
# Educational DP Contest / DP まとめコンテスト - B

# Input
n, k = map(int,input().split())
h = list(map(int,input().split()))

dp = [10 ** 10] * n
dp[0] = 0

for i in range(1, n):
    j = max(0, i-k)
    while(j < i):
        dp[i] = min(dp[i], abs(h[i] - h[j]) + dp[j])
        j = j + 1

# Output
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
def changeStr(in_str, tgt_idx):
    work_str = ""

    # Left
    if tgt_idx != 0:
        work_str = in_str[:tgt_idx]

    # Target
    if in_str[tgt_idx] == "W":
        work_str += "BW"
    else:
        work_str += "WB"
    
    # Right
    if tgt_idx < len(in_str) -2:
        work_str += in_str[tgt_idx+2:]
    
    return work_str

# Input
s = input()

idx = 0
sav_idx = -1
max_idx = -1
cnt = 0
ret_flg = False
while idx < len(s)-1:

    if idx == sav_idx:
        idx += 1
    # BW or WB
    if (s[idx] == "B" and s[idx+1] == "W") or (s[idx] == "W" and s[idx+1] == "B"):
        s = changeStr(s, idx)

        cnt += 1
        sav_idx = idx
        if max_idx < idx:
            max_idx = idx

        idx -= 1
        ret_flg = True
        if idx < 0:
            idx = 0

    # BB or WW
    else:
        if ret_flg == False:
            idx += 1
        else:
            idx = max_idx + 1
            ret_flg = False
# Output
print(cnt)

Fixed submission:
# 2020/05/02
# AtCoder Grand Contest 029 - A

# Input
s = input()

sidx = len(s) - 1
bidx = -1
ans = 0
leftflg = True
while(sidx >= 0):
    # Set Init position of B
    if leftflg and s[sidx] == 'W':
        leftflg = False
        bidx = sidx
    # Put B
    elif s[sidx] == 'B':
        ans = ans + max(0, bidx - sidx) 
        bidx = bidx - 1
        
    sidx = sidx - 1

# Output
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def changeStr(in_str, tgt_idx):
    work_str = ""

    # Left
    if tgt_idx != 0:
        work_str = in_str[:tgt_idx]

    # Target
    if in_str[tgt_idx] == "W":
        work_str = work_str + "BW"
    else:
        work_str = work_str + "WB"
    
    # Right
    if tgt_idx < len(in_str) -2:
        work_str = work_str + in_str[tgt_idx+2:]
    
    return work_str

# Input
s = input()

idx = 0
sav_idx = -1
cnt = 0
while idx < len(s)-1:

    if idx == sav_idx:
        idx += 1
    # BW or WB
    if (s[idx] == "B" and s[idx+1] == "W") or (s[idx] == "W" and s[idx+1] == "B"):
        s = changeStr(s, idx)

        cnt += 1
        sav_idx = idx
        idx -= 1
        if idx < 0:
            idx = 0

    # BB or WW
    else:
        idx += 1
# Output
print(cnt)

Fixed submission:
# 2020/05/02
# AtCoder Grand Contest 029 - A

# Input
s = input()

sidx = len(s) - 1
bidx = -1
ans = 0
leftflg = True
while(sidx >= 0):
    # Set Init position of B
    if leftflg and s[sidx] == 'W':
        leftflg = False
        bidx = sidx
    # Put B
    elif s[sidx] == 'B':
        ans = ans + max(0, bidx - sidx) 
        bidx = bidx - 1
        
    sidx = sidx - 1

# Output
print(ans)
Buggy python submission (verdict: Runtime Error):
# 2020/02/11
# AtCoder Beginner Contest 103 - C

import math
import fractions

# Greatest Common Divisor(GCD)  
def gcd_fgf(a, b):
    return fractions.gcd(a, b)

# Least Common Multiple(LCM)
def lcm_fgf(a, b):
    return int(a * b / fractions.gcd(a, b))

# Input
n = int(input())
a = list(map(int,input().split()))

# Calc Co-LCM
work_lcm = a[0]
for i in range(1, n):
    work_lcm = lcm_fgf(work_lcm, a[i])

m = work_lcm - 1

# Sum remains
fm = 0
for i in range(n):
    fm = fm + (m % a[i])

ans = fm    
# Output
print(ans)

Fixed submission:
# 2020/02/11
# AtCoder Beginner Contest 103 - C

import math
import fractions

# Greatest Common Divisor(GCD)  
def gcd_fgf(a, b):
    return fractions.gcd(a, b)

# Least Common Multiple(LCM)
def lcm_fgf(a, b):
    return int(a * b // fractions.gcd(a, b))

# Input
n = int(input())
a = list(map(int,input().split()))

# Calc Co-LCM
work_lcm = a[0]
for i in range(1, len(a)):
    work_lcm = lcm_fgf(work_lcm, a[i])

m = work_lcm - 1

# Sum remains
fm = 0
for i in range(len(a)):
    fm = fm + (m % a[i])

ans = fm    
# Output
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# 2019/05/22
# AtCoder Beginner Contest 093 - B

# Input
a, b, k = map(int, input().split())

vals = list()
for i in range(a, b+1):
    vals.append(i)

if b - a + 1 < k:
    wk = b - a + 1
else:
    wk = k

# small
for i in range(wk):
    print(vals[i])
if k * 2 > b - a + 1:
    wk = b - a + 1 - wk

# large
for i in range(len(vals)-wk, len(vals)):
    print(vals[i])


Fixed submission:
# 2019/05/22
# AtCoder Beginner Contest 093 - B

# Input
a, b, k = map(int, input().split())
cnt = b - a + 1

vals = list()
if cnt < k:
    wk = cnt
else:
    wk = k

# small
for i in range(a, a + wk):
    print(i)

if k * 2 > cnt:
    wk = cnt - wk

# large
for i in range(b - wk + 1, b+1):
    print(i)

Buggy python submission (verdict: Runtime Error):
# 2019/05/22
# AtCoder Beginner Contest 093 - B

# Input
a, b, k = map(int, input().split())

vals = list()
for i in range(a, b+1):
    vals.append(i)

vals.sort()
# small
for i in range(k):
    print(vals[i])

# large
for i in range(len(vals)-k, len(vals)):
    print(vals[i])


Fixed submission:
# 2019/05/22
# AtCoder Beginner Contest 093 - B

# Input
a, b, k = map(int, input().split())
cnt = b - a + 1

vals = list()
if cnt < k:
    wk = cnt
else:
    wk = k

# small
for i in range(a, a + wk):
    print(i)

if k * 2 > cnt:
    wk = cnt - wk

# large
for i in range(b - wk + 1, b+1):
    print(i)
Buggy python submission (verdict: Runtime Error):
# 2019/05/16
# AtCoder Beginner Contest 091 - B

# Input
n = int(input())
bc = list()
for i in range(n):
    bc.append(input())

m = int(input())
rc = list()
for j in range(m):
    rc.append(input())

bc.sort()
rc.sort()

# Count up
strdict = dict()
wk_str = bc[0]
wk_cnt = 1
for i in range(1, n):
    if wk_str != bc[i]:
        strdict[wk_str] = wk_cnt
        wk_cnt = 1
        wk_str = bc[i]
    else:
        wk_cnt += 1

strdict[wk_str] = wk_cnt

wk_str = rc[0]
wk_cnt = 1

for j in range(1, m):
    if wk_str != rc[i]:
        strdict[wk_str] += wk_cnt * -1
        wk_cnt = 1
        wk_str = rc[i]
    else:
        wk_cnt += 1

strdict[wk_str] += wk_cnt * -1

# Search max
maxval = -101
for k in strdict.keys():
    if maxval < strdict[k]:
        maxval = strdict[k]

ans = max(maxval, 0)

# Output
print(ans)

Fixed submission:
# 2019/05/16
# AtCoder Beginner Contest 091 - B

# Input
n = int(input())
bc = list()
for i in range(n):
    bc.append(input())

m = int(input())
rc = list()
for j in range(m):
    rc.append(input())

bc.sort()
rc.sort()

# Count up
strdict = dict()
wk_str = bc[0]
wk_cnt = 1
for i in range(1, n):
    if wk_str != bc[i]:
        strdict[wk_str] = wk_cnt
        wk_cnt = 1
        wk_str = bc[i]
    else:
        wk_cnt += 1

strdict[wk_str] = wk_cnt

wk_str = rc[0]
wk_cnt = 1

for j in range(1, m):
    if wk_str != rc[j]:
        if strdict.get(wk_str) == None:
            strdict[wk_str] = wk_cnt * -1
        else:
            strdict[wk_str] += wk_cnt * -1
        wk_cnt = 1
        wk_str = rc[j]
    else:
        wk_cnt += 1

if strdict.get(wk_str) == None:
    strdict[wk_str] = wk_cnt * -1
else:
    strdict[wk_str] += wk_cnt * -1

# Search max
maxval = -101
for k in strdict.keys():
    if maxval < strdict[k]:
        maxval = strdict[k]

ans = max(maxval, 0)

print(ans)
Buggy python submission (verdict: Runtime Error):
# 2019/06/22
# AtCoder Beginner Contest 070 - C

import fractions

def lcm_fgf(a, b):
    return int(a * b / fractions.gcd(a, b))

# Input
n = int(input())
alcm = 1

for i in range(n):
    wt = int(input())
    alcm = lcm_fgf(alcm, wt)

# Output
print(alcm)


Fixed submission:
# 2019/06/22
# AtCoder Beginner Contest 070 - C

import fractions

def lcm_fgf(a, b):
    return int(a * b // fractions.gcd(a, b))

# Input
n = int(input())
alcm = 1

for i in range(n):
    wt = int(input())
    alcm = lcm_fgf(alcm, wt)

# Output
print(alcm)
Buggy python submission (verdict: Runtime Error):
# 2019/05/25
# AtCoder Beginner Contest 061 - B

# Input
n, m = map(int, input().split())
rcnt = [0] * (n + 1)
for i in range(m):
    a, b = map(int, input().split())
    rcnt[a] += 1
    rcnt[b] += 1

# Output
for i in range(1, n+1):
    print[i]


Fixed submission:
# 2019/05/25
# AtCoder Beginner Contest 061 - B

# Input
n, m = map(int, input().split())
rcnt = [0] * (n + 1)
for i in range(m):
    a, b = map(int, input().split())
    rcnt[a] += 1
    rcnt[b] += 1

# Output
for i in range(1, n+1):
    print(rcnt[i])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=0

for i in range(1,10**6):
  for j in range(1,(10**6)//i+1):
    if N > i*j:
      ans += 1

print(ans)

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

for i in range(1,10**6):
  for j in range(i,10**6//i+1):
    if N > i*j:
      if i==j:
        ans += 1
      else:
        ans += 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=0

for i in range(1,N+1):
  for j in range(1,(N+1)//i+1):
    if isinstance(i*j-N, int) and i*j-N<0:
      ans += 1
print(ans)

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

for i in range(1,10**6):
  for j in range(i,10**6//i+1):
    if N > i*j:
      if i==j:
        ans += 1
      else:
        ans += 2

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
mod=10**9+7
dp=[0]*2001
dp[0]=1
sdp=[0]*2001
sdp[0]=1
for i in range(2000):
  dp[i+1]=sdp[i-2]
  sdp[i+1]=dp[i+1]+sdp[i]
print(dp[n]%mod)

Fixed submission:
a,b,c,d=map(int, input().split())

e=a*c
f=a*d
g=b*c
h=b*d

print(max(e,f,g,h))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=0
mod=1000000007
list1=list(map(int ,input().split()))
for i in range(n):
  ans=ans+list1[i]*sum(list1[i+1:n])
    
print(ans%mod)

Fixed submission:
n=int(input())
ans=0
mod=10**9+7
list1=list(map(int ,input().split()))
sums=sum(list1)

for i in list1:
  sums -=i
  ans +=sums*i%mod
  
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=0
mod=1000000007
list1=list(map(int ,input().split()))
for i in range(n):
  for j in range(i+1,n):
    ans=ans+list1[i]%mod*list1[j]%mod
    
print(ans%mod)

Fixed submission:
n=int(input())
ans=0
mod=10**9+7
list1=list(map(int ,input().split()))
sums=sum(list1)

for i in list1:
  sums -=i
  ans +=sums*i%mod
  
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list1=list(map(int ,input().split()))
ans=0
mod=1000000007
for i in range(n):
  for j in range(i+1,n):
    ans=(ans+list1[i]*list1[j]%mod)%mod
    
print(ans)

Fixed submission:
n=int(input())
ans=0
mod=10**9+7
list1=list(map(int ,input().split()))
sums=sum(list1)

for i in list1:
  sums -=i
  ans +=sums*i%mod
  
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list1=list(map(int ,input().split()))
list2=[]
mod=1000000007
for i in range(n):
  for j in range(i+1,n):
    list2.append(list1[i]*list1[j]%mod)
a=sum(list2)%mod
    
print(a)
  

Fixed submission:
n=int(input())
ans=0
mod=10**9+7
list1=list(map(int ,input().split()))
sums=sum(list1)

for i in list1:
  sums -=i
  ans +=sums*i%mod
  
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list1=list(map(int ,input().split()))
list2=[]
for i in range(n):
  for j in range(i+1,n):
    list2.append(list1[i]*list1[j])
a=sum(list2)%1000000007
    
print(a)

Fixed submission:
n=int(input())
ans=0
mod=10**9+7
list1=list(map(int ,input().split()))
sums=sum(list1)

for i in list1:
  sums -=i
  ans +=sums*i%mod
  
print(ans%mod)