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

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, h: "List[int]"):
    dp = [0] * N
    dp[0] = 0
    dp[1] = dp[0] + abs(h[1] - h[0])
    for i in range(2, N):
        dp[i] = min(
            dp[i-1] + abs(h[i] - h[i-1]),
            dp[i-2] + abs(h[i] - h[i-2]),
        )

    print(dp[-1])


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    h = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, h)


if __name__ == '__main__':
    main()

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

dp = [0] * N

for i in range(1, N):
	if i == 1:
		dp[i] = dp[0] + abs(H[i] - H[0])
	else:
		dp[i] = min(dp[i-2] + abs(H[i] - H[i-2]), dp[i-1] + abs(H[i] - H[i-1]))

return dp[-1]
Problem p03166 (python)

Fixed submission:
#!/usr/bin/env python3
import sys

sys.setrecursionlimit(10**9)


def dfs(v, graph, memo):
    if v in memo:
        return memo[v]

    if graph[v]:
        res = float("-inf")
        for child in graph[v]:
            res = max(res, dfs(child, graph, memo) + 1)
        memo[v] = res
    else:
        res = 0
        memo[v] = 0

    return memo[v]


def solve(N: int, M: int, x: "List[int]", y: "List[int]"):
    graph = [[] for _ in range(N)]
    for i in range(M):
        graph[x[i]-1].append(y[i]-1)

    memo = {}

    res = float("-inf")
    for i in range(N):
        res = max(res, dfs(i, graph, memo))
    print(res)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    x = [int()] * (M)  # type: "List[int]"
    y = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, M, x, y)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(N: int, M: int, x: "List[int]", y: "List[int]"):
    graph = [[] for _ in range(N)]
    for i in range(M):
        graph[x[i]-1].append(y[i]-1)

    memo = {}

    def dfs(v):
        if v in memo:
            return memo[v]

        if graph[v]:
            res = max(dfs(child) for child in graph[v])
            memo[v] = res + 1
        else:
            res = 0
            memo[v] = 0

        return memo[v]

    print(max(dfs(i) for i in range(N)))


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    x = [int()] * (M)  # type: "List[int]"
    y = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, M, x, y)


if __name__ == '__main__':
    main()
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6 + 100)
n, m = map(int, input().split())

memo = [-1] * (10 ** 6 + 100)

g = [[] for i in range(n + 1)]

for i in range(m):
    x, y = map(int, input().split())
    g[y].append(x)


def dfs(i):
    if memo[i] != -1:
        return memo[i]
    if not g[i]:
        return 0
    else:
        memo[i] = max(dfs(v) for v in g[i]) + 1
        return memo[i]


for i in range(1, n+1):
    dfs(i)

print(max(memo))

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

memo = [-1] * (10 ** 6 + 100)

g = [[] for i in range(n + 1)]

for i in range(m):
    x, y = map(int, input().split())
    g[y].append(x)


def dfs(i):
    if memo[i] != -1:
        return memo[i]
    if not g[i]:
        return 0
    else:
        memo[i] = max(dfs(v) for v in g[i]) + 1
        return memo[i]


for i in range(1, n+1):
    dfs(i)

print(max(memo))
Problem p03437 (python)

Fixed submission:
inp = input().split()

i = 1
x = 0

while i <= pow(10,18):
	if inp[0] == "1" and inp[1] == "1":
		print(-1)
		x = 1
		break
	if i % int(inp[0])  == 0 and i % int(inp[1]) != 0:
		print(i)
		x = 1
		break
	i *= int(inp[0])

if x == 0:
	print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
numbersA = input().split()
numbersB = input().split()
diff = []
plusTotal = 0
minousTotal = 0

for i in range(0,n):
	diff.append((int(numbersB[i]) - int(numbersA[i])))
	if diff[i] < 0:
		minousTotal += diff[i]
	else:
		plusTotal += diff[i] // 2


print(plusTotal)

if plusTotal >= abs(minousTotal):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
numbersA = input().split()
numbersB = input().split()
diff = []
plusTotal = 0
minousTotal = 0

for i in range(0,n):
	diff.append((int(numbersB[i]) - int(numbersA[i])))
	if diff[i] < 0:
		minousTotal += diff[i]
	else:
		plusTotal += diff[i] / 2


if plusTotal >= abs(minousTotal):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
numbersA = input().split()
numbersB = input().split()
diff = []
plusTotal = 0
minousTotal = 0

for i in range(0,n):
	diff.append((int(numbersB[i]) - int(numbersA[i])))
	if diff[i] < 0:
		minousTotal += diff[i]
	else:
		plusTotal += diff[i] / 2


if plusTotal >= abs(minousTotal):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
inp = input().split()

i = 1
x = 0
while i <= pow(10,18):
	if i % int(inp[0])  == 0 and i % int(inp[1]) != 0:
		print(i)
                x = 1
		break
	i *= int(inp[0])


if x == 0:
	print(-1)
Problem p03438 (python)

Fixed submission:
n = int(input())
numbersA = input().split()
numbersB = input().split()
diff = []
plusTotal = 0
minousTotal = 0

for i in range(0,n):
	diff.append((int(numbersB[i]) - int(numbersA[i])))
	if diff[i] < 0:
		minousTotal += diff[i]
	else:
		plusTotal += diff[i] // 2



if plusTotal >= abs(minousTotal):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
numbersA = input().split()
numbersB = input().split()
sumA = 0
sumB = 0
diffNum = 0

for i in range(0,n):
	if numbersA[i] != numbersB[i]:
		diffNum += 1
	sumA += int(numbersA[i])
	sumB += int(numbersB[i])	

if (sumA <= sumB) and (diffNum <= sumB - sumA) and ((sumB - sumA) % diffNum) % 2 == 0:
	print("Yes")
else:
	print("No")

# 14 20
Problem p03556 (python)

Fixed submission:
import math
n = int(input())
while True:
  if math.sqrt(n) == math.floor(math.sqrt(n)):
    print(n)
    break
    
  n -= 1

Buggy submission (verdict: Runtime Error):
using namespace std;

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <limits>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <numeric>
typedef long long ll;
typedef pair<int,int> p;

int main()
{
  long double n;
  cin >> n;
  while (true)
  {
    if (pow(n,0.5) == floor(pow(n,0.5)))
    {
      cout << n << endl;
      return 0;
    }
    n--;
  }

}
Problem p03605 (python)

Fixed submission:
n = int(input())
if n / 10 == 9 or n % 10 == 9 or n >= 90:
  print("Yes")
else :
  print("No")

Buggy submission (verdict: Runtime Error):
import collections

num = int(input())
inps = []
for x in range(0,num):
  # inp[x] = int(input())
  inp = int(input())
  inps.append(inp)

# print(inps)
count = collections.Counter(inps)
# print(count.keys())

ans = 1

for x in range(0,int(len(count))):
  if int(count[x]) % 2 == 1:
  	ans += 1

print(ans)
Problem p02856 (python)

Fixed submission:
m = int(input())
count = 0
sum1 = 0
for i in range(m):
    d,c = map(int,input().split())
    sum1 += d*c
    count += c
if (sum1%9 == 0):
    print(sum1//9 - 1 + count - 1)
else:
    print(sum1//9 + count - 1)

Buggy submission (verdict: Runtime Error):
m = int(input())
count = 0
sum1 = 0
for i in range(m):
    d,c = map(int,input().split())
    sum1 += d*c
    count += c
if (sum1%9 == 0) print(sum1//9 - 1 + count - 1)
else print(sum1//9 + count -1)
Problem p02866 (python)

Fixed submission:
n = int(input())
d = [int(i) for i in input().split()]
out = 0
if d[0]:
    out = 1
d.sort()
k = [0]*100005
for i in d:
    k[i] += 1
c = 1
for i in range(d[n-1]):
    for j in range(k[i+1]):
        c *= k[i]
        c %= 998244353
if (k[0] >= 2 or out):
    print(0)
else:
    print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = [int(i) for i in input().split()]
d.sort()
k = [0]*10005
for i in d:
    k[i] += 1
c = 1
for i in range(d[-1]):
    for j in range(k[i+1]):
        c *= k[i]
        c %= 998244353
if (k[0] >= 2):
    print(0)
else:
    print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = [int(i) for i in input().split()]
d.sort()
k = [0]*10005
for i in d:
    k[i] += 1
c = 1
for i in range(d[-1]):
    c *= k[i]**k[i+1]
    c %= 998244353
if (k[0] >= 2):
    print(0)
else:
    print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = [int(i) for i in input().split()]
d.sort()
k = [1]*10005
out = 0
if d[0] != 0:
    out = 1
now = 1
for i in range(2,n):
    if d[i-1] == d[i]:
        k[now] += 1
    else:
        now += 1
c = 1
for i in range(now):
    c *= k[i]**k[i+1]
    c %= 998244353
if out:
    print(0)
else:
    print(c)
Problem p02983 (python)

Fixed submission:
import sys
L,R = map(int,input().split())
for i in range(L,R+1):
    if i%2019 == 0:
        print(0)
        sys.exit()
l = L%2019
r = R%2019
c = []
for i in range(l,r):
    for j in range(i+1,r+1):
            a = (i*j)%2019
            c.append(a)
print(min(c))

Buggy submission (verdict: Runtime Error):
import sys
L,R = map(int,input().split())
for i in range(L,R+1):
    if i%2019 = 0:
        print(0)
        sys.exit()
for i in range(l,r):
    for j in range(i+1,r+1):
            a = (i*j)%2019
            c.append(a)
print(min(c))
Problem p03035 (python)

Fixed submission:
a,b = map(int,input().split())
if a >= 13:
  print(b)
elif 12 >= a >= 6:
  print(int(b/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
list_l = []
list_R = []
ID,gate = map(int,input().split())
s = 0
for i in range(gate):
  l,r = map(int,input().split())
  list_l.append(l)
  list_R.append(r)
a = max(list_l)
b = min(list_R)

for i in range(ID+1):
  if a <= i <= b:
    s += 1
  else:
    None
print(s)
Problem p03399 (python)

Fixed submission:
k = []
for i in range(4):
    k.append(int(input()))
a = min(k[0],k[1]) + min(k[2],k[3])
print(a)

Buggy submission (verdict: Runtime Error):
k = []
for i in range(4):
    k.append(int(input()))
print(min(k[0],k[1])+min(k[2]+k[3]))
Problem p02555 (python)

Fixed submission:
S = int(input())
m = (10**9)+7
l = [1,1]
for i in range(2,S+1) :
    l.append(l[-1]*i)

ans = 0
for i in range(S//3) :
    kou = i+1
    maru = S - 3*kou
    shikiri = i
    ans += l[maru+shikiri] // (l[maru]*l[shikiri])

print(int((ans%m)))

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

l = [1,1]
for i in range(2,S+1) :
    l.append(l[-1]*i)

ans = 0
for i in range(S//3) :
    kou = i+1
    maru = S - 3*kou
    shikiri = i
    ans += l[maru+shikiri] / (l[maru]*l[shikiri])

print(int(ans%((10**9)+7)))
Problem p02600 (python)

Fixed submission:
x = int(input())

if 400 <= x <= 599 :
    print(8)
elif 600 <= x <= 799 :
    print(7)
elif 800 <= x <= 999 :
    print(6)
elif 1000 <= x <= 1199 :
    print(5)
elif 1200 <= x <= 1399 :
    print(4)
elif 1400 <= x <= 1599 :
    print(3)
elif 1600 <= x <= 1799 :
    print(2)
elif 1800 <= x <= 1999 :
    print(1)

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

if 400 <= x <= 599 :
    print(8)
elif 600 <= x <= 799 :
    print(7)
elif 800 <= x <= 999 :
    print(6)
elif 1000 <= x <= 1199 :
    print(5)
elif 1200 <= x <= 1399 :
    print(4)
elif 1400 <= x <= 1599 :
    print(3)
elif 1600 <= x <= 1799 :
    print(2)
elif 1800 <= x <= 1999 :
    prnit(1)
Problem p02713 (python)

Fixed submission:
from math import gcd
k=int(input())
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        ans_=gcd(i,j)
        for l in range(1,k+1):
            ans+=gcd(ans_,l)
print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd
k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        sub += gcd(i,j)
        for l in range(1,k+1):
            ans += gcd(sub,l)
print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd
k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        n = math.gcd(i,j)
        for m in range(1,k+1):
            a = math.gcd(n,m)
            ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
k = int(input())
from math import gcd
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        n = math.gcd(i,j)
        for m in range(1,k+1):
            a = math.gcd(n,m)
            ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
k = int(input())
from math import gcd
ans = 0
for i in range(k+1):
    for j in range(k+1):
        n = math.gcd(i,j)
        for m in range(k+1):
            a = math.gcd(n,m)
            ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
k = int(input())
import math import gcd
ans = 0
for i in range(k+1):
    for j in range(k+1):
        n = math.gcd(i,j)
        for m in range(k+1):
            a = math.gcd(n,m)
            ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
k = int(input())
import math import gcd
ans = 0
for i in range(k+1):
    for j in range(k+1):
        n = math.gcd(i,j)
        for m in range(k+1):
            a = math.gcd(n,m)
            list.append(int(a))

ans = sum(list)
print(ans)

Buggy submission (verdict: Runtime Error):
k = int(input())
list=[]
import math import gcd

for i in range(k+1):
    for j in range(k+1):
        for m in range(k+1):
            n = math.gcd(i,j)
            a = math.gcd(n,m)
            list.append(int(a))

ans = sum(list)
print(ans)

Buggy submission (verdict: Runtime Error):
k = int(input())
list=[]
import math import gcs

for i in range(k+1):
    for j in range(k+1):
        for m in range(k+1):
            n = math.gcd(i,j)
            a = math.gcd(n,m)
            list.append(int(a))

ans = sum(list)
print(ans)

Buggy submission (verdict: Runtime Error):
k = int(input())
list=[]
import math

for i in range(k+1):
    for j in range(k+1):
        for m in range(k+1):
            n = math.gcd(i,j)
            a = math.gcd(n,m)
            list.append(int(a)

ans = sum(list)
print(ans)
Problem p02761 (python)

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

ans = [-1] * N

for i in range(M):
    s,c = map(int,input().split())
    if ans[s-1] != -1 and ans[s-1] != c :
        print(-1)
        exit()
    ans[s-1] = c

if N != 1 :
    if ans[0] == 0 :
        print(-1)
        exit()
    if ans[0] == -1 :
        ans[0] = 1
    for i in range(N):
        if ans[i] == -1:
            ans[i] = 0
else :
    if ans[0] == -1 :
        ans[0] = 0

print(*ans,sep='')

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

ans = [-1] * N

for i in range(M):
    s,c = map(int,input().split())
    if ans[s-1] != -1 and ans[s-1] != c :
        print(-1)
        exit()
    t[s-1] = c

if N != 1 :
    if ans[0] == 0 :
        print(-1)
        exit()
    if ans[0] == -1 :
        ans[0] = 1
    for i in range(N):
        if ans[i] == -1:
            ans[i] = 0
else :
    if ans[0] == -1 :
        ans[0] = 0

print(*ans,sep='')
Problem p02765 (python)

Fixed submission:
n, r = map(int, input().split())

if n >= 10 :
    ans = r
else :
    ans = r + 100 * (10 - n)

print(ans)

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

if n >= 10 :
    ans = r
else :
    ans = r + 100 * (10 - n)

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

if n >= 10 :
    ans = r
else :
    ans = r - 100 * (10 - n)

Buggy submission (verdict: Runtime Error):
n, r = int(input())

if n >= 10 :
    ans = r
else :
    ans = r - 100 * (10 - n)
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())

if H % A == 0 :
    ans = H / A
else :
    ans = H // A + 1

print(round(ans))

Buggy submission (verdict: Runtime Error):
H, A = map(int, input().split())
ans = H // A + (H % A)/(H % A) * 1
print(round(ans))

Buggy submission (verdict: Runtime Error):
H, A = map(int, input().split())

ans = H // A + (H % A)/(H % A) * 1

print(ans)
Problem p02861 (python)

Fixed submission:
n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]

from itertools import permutations
import math
m = math.factorial(n)
per = permutations(xy,n)

d = 0
c = 0
for j in per :
    for i in range(n-1):
        d += ((j[i+1][0]-j[i][0])**2 + (j[i+1][1]-j[i][1])**2) ** 0.5

print(d/m)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]

sum = 0
for i in range(n):
    for j in range(n):
        if i != j:
            sum += sqrt((l[i][0] - l[j][0]) * (l[i][0] - l[j][0]) + (l[i][1] - l[j][1]) * (l[i][1] - l[j][1]))
print(sum / n)
Problem p02909 (python)

Fixed submission:
s = input()

if s == "Sunny" :
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else :
    print("Sunny")

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

if s == "Sunny" :
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
elif :
    print("Sunny")

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

if s == "Sunny" :
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
elif s == "Rainy"
    print("Sunny")
Problem p02917 (python)

Fixed submission:
n = int(input())
b = list(map(int,input().split()))

dp = [10**8]*n

for i in range(n-1):
    if dp[i] > b[i] :
        dp[i] = b[i]
    if dp[i+1] > b[i] :
        dp[i+1] = b[i]

print(sum(dp))

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

dp = [10**8]*# NOTE:

for i in range(n-1):
    if dp[i] > b[i] :
        dp[i] = b[i]
    if dp[i+1] > b[i] :
        dp[i+1] = b[i]

print(sum(dp))
Problem p02945 (python)

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

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

print(max(a+b, a-b, a*b))
Problem p02952 (python)

Fixed submission:
n = int(input())
c = 0
for i in range(1,n+1):
    if len(str(i)) % 2 == 1 :
        c += 1

print(c)

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

if n == 100000 :
    ans = 101009
elif 10000 <= n <= 99999 :
    ans = n - 10000 + 1 + 1000 + 9
elif 1000 <= n <= 9999 :
    ans = 1009
elif 100 <= n <= 999 :
    ans = n - 100 + 1 + 9
elif 10 <= n < 99 :
    ans = 9 
elif 1 <= n <= 9 :
    ans = n

print(ans)
Problem p02957 (python)

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

if (a+b)%2 == 0 :
    print((a+b)//2)
else :
    print("IMPOSSIBLE")

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

if (a+b)%2 == 0 :
    print((a+b)/2))
else :
    print("IMPOSSIBLE")

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

if (a+b)%2 == 0 :
    print(a+b)/2))
else :
    print("IMPOSSIBLE")
Problem p03000 (python)

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

ans = 1
d = 0
for x in L:
    d = d + x
    if d <= X :
        ans += 1

print(ans)

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

c = 1
d = 0
for x in L:
    d = d + x
    if d <= X :
        ans += 1

print(ans)
Problem p03037 (python)

Fixed submission:
n,m = map(int,input().split())
lr = [list(map(int,input().split())) for i in range(m)]

max = 0
min = n+1
for i in range(m):
    if lr[i][0] > max :
        max = lr[i][0]
    if lr[i][1] < min :
        min = lr[i][1]

if min-max >= 0:
    print(min-max+1)
else :
    print(0)

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

max = 0
min = n+1
for i in range(m):
    if lr[i][0] > max :
        max = lr[i][0]
    if lr[i][1] < min :
        min = lr[i][1]

print(min-max+1)
Problem p03071 (python)

Fixed submission:
a,b = map(int,input().split())
if a != b :
    print(max(a,b)*2 -1)
else :
    print(a*2)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
print(max(a,b)*2 -1)
Problem p03076 (python)

Fixed submission:
l = []
for i in range(5):
    l.append(int(input()))
amari = []
for i in range(5):
    if 10-l[i]%10 == 10 :
        amari.append(0)
    else :
        amari.append(10-l[i]%10)
jikan = []
for i in range(5):
    if amari[i] == 10:
        jikan.append(l[i])
    else :
        jikan.append(l[i] + amari[i])

print(sum(jikan)-max(amari))

Buggy submission (verdict: Runtime Error):
l = []
for i in range(5):
    l.append(int(input()))
amari = []
for i in range(5):
    amari.append(10-l[i]%10)
jikan = []
for i in range(5):
    jikan.append(l[i] + amari[i])
print(sum[jikan]-max(amari))
Problem p03086 (python)

Fixed submission:
S = input()

c = 0
m = 0

for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" :
        c += 1
        m = max(c,m)
    elif S[i] == "G" or S[i] == "T" :
        c += 1
        m = max(c,m)
    else :
        m = max(c,m)
        c = 0

print(m)

Buggy submission (verdict: Runtime Error):
S = input()

c = 0
l = []
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" :
        c += 1
    elif S[i] == "G" or S[i] == "T" :
        c += 1
    else :
        l.append(c)
        c = 0

print(max(l))
Problem p03607 (python)

Fixed submission:
n = int(input())
kami = set()

for i in range(n) :
    a = int(input())
    if a in kami :
        kami.remove(a)
    else :
        kami.add(a)

print(len(kami))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = set(int(input()) for i in range(n))
kami = []
a.sort()
for i in range(n) :
    if i in kami :
        kami.remove(i)
    else :
        kami.add(i)

print(len(kami))
Problem p04001 (python)

Fixed submission:
s = input()
n = len(s)

ans = 0
for i in range(2**(n-1)) :
    wa = 0
    kou = s[0]
    for j in range(n-1):
        if i>>j & 1 :
            wa += int(kou)
            kou = s[j+1]
        else :
            kou += s[j+1]
        if j == n-2 :
            wa += int(kou)
    ans += wa
if n == 1 :
    print(int(s))
else :
    print(ans)

Buggy submission (verdict: Runtime Error):
s = list(input())
n = len(s)

ans = 0
for i in range(2**(n-1)) :
    wa = 0
    kou = s[0]
    for j in range(n-1):
        if i>>j & 1 :
            wa += int(kou)
            kou = s[j+1]
        else :
            kou += s[j+1]
        if j == n-2 :
            wa += int(kou)
    ans += wa
if n == 1 :
    print(int(s))
else :
    print(ans)