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

Fixed submission:
from collections import Counter

n = int(input()) 
times = 0

def make_divisors(n):
    divisors = [n]
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    divisors.sort()
    return divisors
    
times = len(make_divisors(n - 1))
a = make_divisors(n)

for i in a:
    tmp = n // i
    if tmp == 1:
        times += 1 
        continue
    while tmp % i == 0:
        tmp = tmp // i
    if tmp % i == 1:
        times += 1 
    
print(times if n != 2 else 1)

Buggy submission (verdict: Runtime Error):
from math import gcd, sqrt
from collections import Counter

n = int(input()) 
times = 0

# 公約数を求める
def gcd(tmpn):
    lists = []
    while True:
        end = True
        for i in range(2, int(sqrt(tmpn)) + 1):
            if tmpn % i == 0:
                lists.append(i)
                tmpn = tmpn // i
                end = False         
        if end:  
            lists.append(tmpn)
            break
    return lists
    
def gori(lists, num=1, ans=[]):
    if len(lists) == 0:
        ans.append(num)
        return ans
    for i in range(len(lists)):
        tmp = lists[0:i] + lists[i + 1:len(lists)]
        ans = gori(tmp, num * lists[i], ans)
        ans = gori(tmp, num, ans)
    return ans

# 1を除いた公約数の個数を出力する
a = Counter(gcd(n - 1))
times = sum(map(lambda x: x+1, a.values())) - 1

a = set(gori(gcd(n)))
a.remove(1)

for i in a:
    tmp = n // i
    if tmp < i:
        if tmp == 1:
            times += 1
        
    else:
        while True:
            if tmp < i:
                if tmp == 1:
                    times += 1
                    break
            if tmp % i == 0:
                tmp = tmp // i
                    
            else:
                if tmp % i == 1:
                    times += 1
                break

print(times)
Problem p02761 (python)

Fixed submission:
n, m = map(int, input().split())
s, c = [], []
for i in range(m):
    a, b = map(int, input().split())
    s.append(a), c.append(b)


for i in range(0, 10 ** n):
    loop = True
    string = str(i)
    if len(string) != n:
        continue
    for j in range(m):
        if string[s[j] - 1] != str(c[j]):
            loop = False
    if loop:
        print(string)
        exit()

print('-1')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
s, c = [], []
for i in range(m):
    a, b = map(input().split())
    s.append(a), c.append(b)
loop = True

for i in range(10 ** (n - 1), 10 ** n):
    string = str(i)
    for j in range(m):
        if string[s[j] - 1] != c[j]:
            break
        if j == m - 1:
            print(string)
            loop = False
    if loop == False:
        break
    if i == 10 ** n - 1:
        print('-1')

Buggy submission (verdict: Runtime Error):
s, c = [], []
for i in range(m):
    a, b = map(int, input().split())
    s.append(a), c.append(b)

dicts = {}

ans = [0 for i in range(n)]
b = 0

for i in range(m):
    if s[i] not in dicts:
        dicts[s[i]] = c[i]
    elif s[i] in dicts and dicts[s[i]] != c[i]:
        print('-1')
        break


    if i == m - 1:
        for j in range(n + 1):
            if j in dicts:
                ans[j - 1] = dicts[j]
        # print(ans)
        for j in range(n):
            b += ans[n - j - 1] * (10 ** j)
        
        if b >= 10 ** (n - 1) and b <= (10 ** n) - 1:
            print(b)
        else:
            print('-1')
Problem p02843 (python)

Fixed submission:
x = int(input())

if x >= 2000:
    print(1) 
elif x >= 100:
    print(1 if x % 100 <= x // 100 * 5 else 0)
else:
    print(0)

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

elif x >= 100:
    print(1 if x % 100 <= x // 100 * 5 else 0)
else:
    print(0)
Problem p02947 (python)

Fixed submission:
from collections import Counter

def ABC137C_GreenBin():
    N = int(input().strip())
    S = [input().strip() for i in range(N)]

    ans = 0
    di = Counter()
    for s in S:
        s = ''.join(sorted(list(s)))
        
        if s in di:
            ans += di[s]

        di[s] += 1
    
    print(ans)


def main():
    ABC137C_GreenBin()

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def ABC137C_GreenBin():
    N = int(input().strip())
    S = [input().strip() for i in range(N)]

    ans = 0
    di = Counter()
    for s in S:
        s = ''.join(sorted(list(s)))
        
        if s in di:
            ans += di[s]

        di[s] += 1
    
    print(ans)


def main():
    ABC137C_GreenBin()

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from collections import Counter
class Combination:
    _maxNum = 0
    _divider = 0
    _fact = []
    _inv = []
    _finv = []

    def __init__(self, maxNum, divider):
        self._maxNum = maxNum
        self._divider = divider
 
        _fact = [0] * (maxNum + 1)
        _fact[0] = _fact[1] = 1


        if divider != 0:
            _inv = [0] * (maxNum + 1)
            _finv = [0] * (maxNum + 1)
            _inv[0] = _inv[1] = _finv[0] = _finv[1] = 1
        else:
            _inv = []
            _finv = []

        for i in range(2, maxNum + 1):
            _fact[i] = _fact[i - 1] * i;
            if divider != 0:
                _fact[i] %= _divider
                _inv[i] = _divider - _inv[_divider % i] * (_divider // i) % _divider
                _finv[i] = _finv[i - 1] * _inv[i] % _divider

        self._fact = _fact
        self._inv = _inv
        self._finv = _finv

    def nPk(self, n, k):
        if(k > self._maxNum) or (n > self._maxNum) or (k > n) or (k < 0) or (n < 0):
            return 0
        return(self._fact[n] // self._fact[n - k])

    def nCk(self, n, k):
        ans = 0
        if(k > self._maxNum) or (n > self._maxNum) or (k > n) or (k < 0) or (n < 0):
            ans = 0
        elif self._divider == 0:
            ans = self.nPk(n, k)
            ans //= self._fact[k]
        else:
            ans = self._fact[n] * (self._finv[k] * self._finv[n - k] % self._divider) % self._divider

        return ans

def ABC137C_GreenBin():
    N = int(input().strip())
    S = [input().strip() for i in range(N)]

    di = Counter()
    for s in S:
        s = ''.join(sorted(list(s)))
        di[s] += 1
    
    cmb = Combination(max(di.values()), 0)

    ans = 0
    for num in di.values():
#        ans += cmb.nCk(num, 2)

    print(ans)


def main():
    ABC137C_GreenBin()

if __name__ == "__main__":
    main()
Problem p02981 (python)

Fixed submission:

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

train = N * A

if(train < B) :
  print(train)
else:
  print(B)

Buggy submission (verdict: Runtime Error):

N, A, B  = input()

train = N * A

if(train < B) :
  print(train)
else:
  print(B)
Problem p03565 (python)

Fixed submission:
def ABC076C_DubiousDocument2():
    Sd = list(input().strip())
    T = list(input().strip())

    tlen = len(T)
    slen = len(Sd)

    ans = 'UNRESTORABLE'
    nowPos = 0
    for pos in range(slen - 1, -1, -1):
        if pos < (tlen - 1):
            break
        if(T[tlen - 1] == Sd[pos]) or (Sd[pos] == '?'):
            nowPos = pos
            match = True
            for chk in range(nowPos, nowPos - tlen, -1):
                if(T[tlen - (nowPos - chk) - 1] != Sd[chk]) and (Sd[chk] != '?'):
                    match = False
                    break

            if match:
                # 書き換え
                for chk in range(nowPos, nowPos - tlen, -1):
                    Sd[chk] = T[tlen - (nowPos - chk) - 1]
                for i in range(0, slen):
                    if Sd[i] == '?':
                        Sd[i] = 'a'
                # 答えはこれ
                ans = ''.join(Sd)

    print(ans)

def main():
    ABC076C_DubiousDocument2()

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def ABC076C_DubiousDocument2():
    Sd = list(input().strip())
    T = list(input().strip())

    tlen = len(T)
    slen = len(Sd)

    ans = 'UNRESTORABLE'
    nowPos = 0
    for pos in range(slen - 1, -1, -1):
        if pos < (tlen - 1):
            break
        if(T[tlen - (slen - 1 - pos) - 1] == Sd[pos]) or (Sd[pos] == '?'):
            nowPos = pos
            match = True
            for chk in range(nowPos, nowPos - tlen, -1):
                if(T[tlen - (nowPos - chk) - 1] != Sd[chk]) and (Sd[chk] != '?'):
                    match = False
                    break

            if match:
                # 書き換え
                for chk in range(nowPos, nowPos - tlen, -1):
                    Sd[chk] = T[tlen - (nowPos - chk) - 1]
                for i in range(0, slen):
                    if Sd[i] == '?':
                        Sd[i] = 'a'
                # 答えはこれ
                ans = ''.join(Sd)

    print(ans)

def main():
    ABC076C_DubiousDocument2()

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def ABC076C_DubiousDocument2():
    Sd = list(input().strip())
    T = list(input().strip())

    tlen = len(T)
    slen = len(Sd)

    ans = 'UNRESTORABLE'
    nowPos = 0
    for pos in range(slen - 1, -1, -1):
        if pos < tlen:
            break
        if(T[tlen - (slen - 1 - pos) - 1] == Sd[pos]) or (Sd[pos] == '?'):
            nowPos = pos
            match = True
            for chk in range(nowPos, nowPos - tlen, -1):
                if(T[tlen - (nowPos - chk) - 1] != Sd[chk]) and (Sd[chk] != '?'):
                    match = False
                    break

            if match:
                # 書き換え
                for chk in range(nowPos, nowPos - tlen, -1):
                    Sd[chk] = T[tlen - (nowPos - chk) - 1]
                for i in range(0, slen):
                    if Sd[i] == '?':
                        Sd[i] = 'a'
                # 答えはこれ
                ans = ''.join(Sd)

    print(ans)

def main():
    ABC076C_DubiousDocument2()

if __name__ == "__main__":
    main()
Problem p02554 (python)

Fixed submission:
N = int(input())
mod = int(1e9 +7)

ans = pow(10, N, mod=mod)
ans -= 2*pow(9, N, mod=mod)
ans += pow(8, N, mod=mod)

print(ans%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
mod = int(1e9 +7)

ans = pow(10, N, mod=mod)
ans -= 2*pow(9, N, mod=mod)
ans += pow(8, N, mod=mod)

print(ans%mod)
Problem p02616 (python)

Fixed submission:
import numpy as np

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    mod = int(1e9+7)
    p = []
    m = []
    for a in A:
        if a >= 0:
            p.append(a)
        else:
            m.append(a)
    p.sort(reverse=True)
    m.sort(reverse=False)
    ans = 1
    if sum(np.sign(A)) == -N and K%2 == 1:
        A = sorted(A, reverse=True)
        for i in range(K):
            ans = (ans*A[i])%mod
        print(ans)
        return
    if N == K:
        for i in range(K):
            ans = (ans*A[i])%mod
        print(ans)
        return

    m_pair = []
    p_pair = []
    if K%2 == 1:
        ans *= p.pop(0)%mod
    for i in range(0, len(m), 2):
        if i+1 < len(m):
            m_pair.append(m[i]*m[i+1])
        # else:
        #     m_pair.append(m[i])
    for i in range(0, len(p), 2):
        if i+1 < len(p):
            p_pair.append(p[i]*p[i+1])
        else:
            p_pair.append(p[i])
    pairs = m_pair[:]
    pairs.extend(p_pair)
    pairs.sort(reverse=True)
    for i in range(K//2):
        ans = (ans*pairs[i])%mod
    print(ans)

main()

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

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    mod = int(1e9+7)
    p = []
    m = []
    for a in A:
        if a >= 0:
            p.append(a)
        else:
            m.append(a)
    p.sort(reverse=True)
    m.sort(reverse=False)
    ans = 1
    if sum(np.sign(A)) == -N and K%2 == 1:
        A = sorted(A, reverse=True)
        for i in range(K):
            ans = (ans*A[i])%mod
        print(ans)
        return

    m_pair = []
    p_pair = []
    if K%2 == 1:
        ans *= p.pop(0)%mod
    for i in range(0, len(m), 2):
        if i+1 < len(m):
            m_pair.append(m[i]*m[i+1])
        # else:
        #     m_pair.append(m[i])
    for i in range(0, len(p), 2):
        if i+1 < len(p):
            p_pair.append(p[i]*p[i+1])
        # else:
        #     p_pair.append(p[i])
    pairs = m_pair[:]
    pairs.extend(p_pair)
    pairs.sort(reverse=True)
    for i in range(K//2):
        ans = (ans*pairs[i])%mod
    print(ans)

main()
Problem p02630 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
count = [0 for _ in range(int(1e5)+1)]
for a in A:
    count[a] += 1    

Q = int(input())
for i in range(Q):
    b, c = map(int, input().split())
    S += (c-b) * count[b]
    count[c] += count[b]
    count[b] = 0
    print(S)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
count = [0 for _ in range(int(1e5))]
for a in A:
    count[a] += 1    

Q = int(input())
for i in range(Q):
    b, c = map(int, input().split())
    S += (c-b) * count[b]
    count[c] += count[b]
    count[b] = 0
    print(S)
Problem p02641 (python)

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

p.sort()
def main():
    l = [True for _ in range(100)]
    for x in p:
        l[x-1] = False
    diff = 0
    while True:
        if X-1 -diff < 0:
            print(0)
            return
        elif l[X-1 -diff]:
            print(X -diff)
            return
        elif X-1 +diff >= 100:
            print(101)
            return
        elif l[X-1 +diff]:
            print(X +diff)
            return
        diff += 1

main()

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

p.sort()
def main():
    l = [True for _ in range(100)]
    for x in p:
        l[x-1] = False
    diff = 0
    while True:
        if l[X-1 -diff]:
            print(X -diff)
            return
        elif l[X-1 +diff]:
            print(X +diff)
            return
        diff += 1

main()
Problem p02721 (python)

Fixed submission:
N, K, C = map(int, input().split())
S = input()
L, R = [0]*N, [0]*N
i = 0
count = 1
while count <= K:
    if S[i] == 'x':
        i += 1
        continue
    L[i] = count
    count += 1
    i += C+1
i = N-1
count = K
while count > 0:
    if S[i] == 'x':
        i -= 1
        continue
    R[i] = count
    count -= 1
    i -= C+1
for i in range(N):
    if L[i] == 0:
        continue
    if L[i] == R[i]:
        print(i+1)

Buggy submission (verdict: Runtime Error):
N, K, C = map(int, input().split())
S = input()
L, R = [0]*N, [0]*N
i = 0
count = 1
while count <= K:
    if S[i] == 'x':
        i += 1
        continue
    L[i] = count
    count += 1
    i += C+1
i = N-1
count = K
while count >= 0:
    if S[i] == 'x':
        i -= 1
        continue
    R[i] = count
    count -= 1
    i -= C+1
for i in range(N):
    if L[i] == 0:
        continue
    if L[i] == R[i]:
        print(i+1)
Problem p02732 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
# TLE
def test():
    duplication = {}
    ans = 0
    for x in A:
        if x in duplication:
            continue
        count = A.count(x)
        if count > 1:
            duplication[x] = count
            ans += count*(count-1)//2
    for x in A:
        if x not in duplication:
            print(ans)
        else:
            print(ans -(duplication[x]-1))
from collections import defaultdict

sum = 0
count_dic = defaultdict(int)
for x in A:
    count_dic[x] +=1
for v in count_dic.values():
    sum += v*(v-1)//2
for x in A:
    print(sum -(count_dic[x]-1))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
# TLE
duplication = {}
ans = 0
for x in A:
    if x in duplication:
        continue
    count = A.count(x)
    if count > 1:
        duplication[x] = count
        ans += count*(count-1)//2
for x in A:
    # if x not in duplication:
    #     print(ans)
    # else:
    print(ans -(duplication[x]-1))
Problem p02768 (python)

Fixed submission:
n, a, b = map(int, input().split())
mod = int(1e9+7)

def comb(r):
    bunshi = 1
    for i in range(n-r+1,n+1):
        bunshi = bunshi*i%mod
    bunbo = 1
    for i in range(1,r+1):
        bunbo = bunbo * i %mod
    return bunshi*pow(bunbo, mod-2,mod)%mod

ans = pow(2,n,mod) -1 - comb(b)-comb(a)
ans = (ans +2*mod)%mod
print(ans)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

n, a, b = map(int, input().split())
print((2**n -1 -comb(n, a, exact=True)- comb(n, b, exact=True))%(10**9+7))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

n, a, b = map(int, input().split())
total = 0
for i in range(1,n+1):
    if i == a or i == b:
        continue
    total += comb(n, i, exact=True)
print(total%(10**9+7))
Problem p02780 (python)

Fixed submission:
n, k = map(int, input().split())
p_n = [int(i) for i in input().split()]

def expected(x):
    return (x+1)/2

def test3():
    e_n = list(map(expected, p_n))
    s_n = []
    for i, e in enumerate(e_n):
        if i == 0:
            s_n.append(e)
            continue
        s_n.append(s_n[i-1] + e)
    result = []
    result.append(s_n[k-1])
    for i in range(len(s_n)):
        if i+k >= n:
            continue
        result.append(s_n[i+k]-s_n[i])
    print(max(result))      
test3()

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

def expected(x):
    return (x+1)/2

def test3():
    e_n = list(map(expected, p_n))
    s_n = []
    for i, e in enumerate(e_n):
        if i == 0:
            s_n.append(e)
            continue
        s_n.append(s_n[i-1] + e)
    result = []
    for i in range(len(s_n)):
        if i+k >= n:
            continue
        result.append(s_n[i+k]-s_n[i])
    print(max(result))      

test3()

Buggy submission (verdict: Runtime Error):
import pandas as pd

n, k = map(int, input().split())
p_n = [int(i) for i in input().split()]

def expected(x):
    return (x+1)/2*k

s = pd.Series(list(map(expected, p_n)))

print(s.rolling(window=k).mean().max())
Problem p02995 (python)

Fixed submission:
from fractions import gcd

A, B, C, D = map(int, input().split())
l = C * D // gcd(C, D)
x = (A - 1) - (A - 1) // C - (A - 1) // D + (A - 1) // l
y = B - B // C - B // D + B // l
print(y - x)

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def main():
    left = (b -int(b/c) -int(b/d) +int(b/lcm(c,d)))
    right = ((a-1) -int((a-1)/c) -int((a-1)/d) +int((a-1)/lcm(c,d)))
    print(left - right)
main()
Problem p03043 (python)

Fixed submission:
n, k = map(int, input().split())
win = 0
for i in range(1, n+1):
    index = 0
    while pow(2, index) < k/i:
        index += 1
    win += pow(0.5, index)/n
print(win)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())

pow2 = [1]
for i in range(1, k):
    pow2.append(pow2[i-1]*2)
win = 0
for i in range(1, n+1):
    for j, x in enumerate(pow2):
        if x > k/i:
            index = j
            break
    win += pow(1/2, index)
print(win/n)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())

pow2 = [1]
for i in range(1, k):
    pow2.append(pow2[i-1]*2)
win = 0
for i in range(1, n+1):
    for j, x in enumerate(pow2):
        if x > k/i:
            index = j
            break
    bunbo = pow(2, index)
    win += 1/bunbo
print(win/n)
Problem p03729 (python)

Fixed submission:
a, b, c = list(input().split())
if a[-1] == b[0] and b[-1] == c[0]:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = list(map(int, input().split()))
if a[-1] == b[0] and b[-1] == c[0]:
    print('YES')
else:
    print('NO')
Problem p02909 (python)

Fixed submission:
S = input()
if S == "Sunny" : 
  print("Cloudy")

if S == "Cloudy" : 
  print("Rainy")

if S == "Rainy" : 
  print("Sunny")

Buggy submission (verdict: Runtime Error):
import bisect
import math
 
N,M = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
 
for m in range(M):
    A[N-1] = math.floor( A[N-1]/2 )
    temp = A[N-1]
    del A[N-1]
    # 挿入    
    bisect.insort(A, temp)
print(sum(A))
Problem p02536 (python)

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

class UnionFind:
    def __init__(self, n):
        self.parent = list(range(n))

    def find(self, a):
        acopy = a
        while a != self.parent[a]:
            a = self.parent[a]
        while acopy != a:
            self.parent[acopy], acopy = a, self.parent[acopy]
        return a

    def union(self, a, b):
        self.parent[self.find(b)] = self.find(a)

n, m = map(int, input().split())
UF = UnionFind(n)
for _ in range(m):
    a,b = map(int, input().split())
    UF.union(a-1,b-1)
o=set()
for i in range(n):
    o.add(UF.find(i))
print(len(o) - 1)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

class UnionFind:
    def __init__(self, n):
        self.parent = list(range(n))

    def find(self, a):
        acopy = a
        while a != self.parent[a]:
            a = self.parent[a]
        while acopy != a:
            self.parent[acopy], acopy = a, self.parent[acopy]
        return a

    def union(self, a, b):
        self.parent[self.find(b)] = self.find(a)

n, m = map(int, input().split())
UF = UnionFind(n)
for _ in range(m):
    a,b = map(int, input().split())
    UF.union(a-1,b-1)
o=set()
for i in range(n):
    o.add(UF.fins(i))
print(len(o) - 1)
Problem p02705 (python)

Fixed submission:
print(6.28318530717958623200*int(input()))

Buggy submission (verdict: Runtime Error):
print(6.28318530717958623200*int(input())
Problem p02642 (python)

Fixed submission:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = lr()
A.sort()
bl = [True] * (A[-1]+1)
answer = 0
for i, a in enumerate(A):
    if i < N-1 and A[i+1] == a:
        pass
    elif bl[a]:
        answer += 1
    if bl[a]:
        bl[a] = False
        next = a + a
        while next <= A[-1]:
            bl[next] = False
            next += a

print(answer)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

def main():
    # 約数
    N = ir()
    A = lr()
    A.sort()
    answer = 0
    bl = [0] * (A.max()+1)

    def make_divisors(n):  # nの約数を列挙
        divisors = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.append(i)
                if i != n // i:
                    divisors.append(n//i)
        divisors.sort()
        return divisors

    for i, a in enumerate(A):
        if i < N-1 and a == A[i+1]:
            bl[a] = 1
            continue
        divs = make_divisors(a)
        flag = True
        for x in divs:
            if bl[x] == 1:
                flag = False
                break
        bl[a] = 1
        if flag:
            answer += 1

    print(answer)

main()
Problem p02705 (python)

Fixed submission:
# coding: utf-8
import sys
import math

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

R = ir()
answer = 2 * R * math.pi
print(answer)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  float r, ans;
  cin >> r;
  ans = 2 * r * M_PI;
  cout << ans << '\n';
  return 0;
}