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

Fixed submission:
def gcd(x,y):
	return gcd(y,x%y) if y else x
n,a,b,c=int(input()),list(map(int,input().split())),[],[]
for i in range(n):
	b.append(gcd(b[i-1],a[i-1]) if i else 0)
	c.append(gcd(c[i-1],a[n-i]) if i else 0)
print(max([gcd(b[i],c[n-i-1]) for i in range(n)]))

Buggy submission (verdict: Runtime Error):
import math as m
n,a=int(input()),list(map(int,input().split()))
b,c=[],[]
for i in range(n):
	b.append(m.gcd(b[i-1],a[i-1]) if i else 0)
	c.append(m.gcd(c[i-1],a[n-i]) if i else 0)
print(max([m.gcd(b[i],c[n-i-1]) for i in range(n)]))
Problem p03251 (python)

Fixed submission:
print("No War" if (lambda a:max(a[2],max(list(map(int,input().split()))))<min(a[3],min(list(map(int,input().split())))))(list(map(int,input().split()))) else "War")

Buggy submission (verdict: Runtime Error):
print("No War" if (lambda a:max(a[0][2],max(a[1]))<min(a[0][3],min(a[2])))([int(j) for j in input().split()] for i in range(3)]) else "War")
Problem p03261 (python)

Fixed submission:
n=int(input())
w=[input() for i in range(n)]
flag=True
for s in w:
    if w.count(s) > 1:
        flag = False
for i in range(1,n):
    if w[i][0] != w[i-1][-1]:
        flag = False
print("Yes" if flag else "No")

Buggy submission (verdict: Runtime Error):
n=int(input())
w=[input() for i in range(n)]
flag=True
for s in w:
    if w.count(s) > 1:
        flag = False
for i in range(1,n)
    if w[i][0] != w[i-1][len(w[i-1])-1]:
        flag = False
print("Yes" if flag else "No")

Buggy submission (verdict: Runtime Error):
n=int(input())
w=[input() for i in range(n)]
flag=True
for s in w:
    if w.count(s) > 1:
        flag = False
for i in range(1,n)
    if list(w[i])[0] != reversed(list(w[i-1]))[0]:
        flag = False
print("Yes" if flag else "No")
Problem p03283 (python)

Fixed submission:
n,m,q=map(int,input().split())
d=[[0 for j in range(n)] for i in range(n)]
for i in range(m):
	l,r=map(lambda x:int(x)-1,input().split())
	d[l][r]+=1
for l in range(n):
	for r in range(1,n):
		d[l][r]+=d[l][r-1]
for l in range(n-1,0,-1):
	for r in range(n):
		d[l-1][r]+=d[l][r]
for i in range(q):
	l,r=map(lambda x:int(x)-1,input().split())
	print(d[l][r])

Buggy submission (verdict: Runtime Error):
N,M,Q = map(int,input().split())
t,ans = [[0 for j in range(N+1)] for i in range(N+1)],[[-1 for j in range(N+1)] for i in range(N+1)]
def solve(x, y):
	global ans,N,t
	if x > N or y == 0:
		return 0
	elif ans[x][y] != -1:
		return ans[x][y]
	else:
		ans[x][y] = solve(x,y-1) + solve(x+1,y) - solve(x+1,y-1) + t[x][y]
		return ans[x][y]
for i in range(M):
	l,r = map(int,input().split())
	t[l][r] += 1
for i in range(Q):
	p,q = map(int,input().split())
	print(solve(p,q))
Problem p03284 (python)

Fixed submission:
n,k=map(int,input().split())
print(1 if n%k else 0)

Buggy submission (verdict: Runtime Error):
print((int(input())%int(input())+99)//100)

Buggy submission (verdict: Runtime Error):
print((int(input())%int(input())+99)/100)
Problem p03294 (python)

Fixed submission:
print((lambda a,b:sum(b)-int(a))(input(),list(map(int,input().split()))))

Buggy submission (verdict: Runtime Error):
print((lambda a,b:sum(b)-a)(input(),list(map(int,input().split()))))
Problem p03304 (python)

Fixed submission:
n,m,d=map(float,input().split())
print((m-1)*(n-d)*([1,2][d>0])/n**2);

Buggy submission (verdict: Runtime Error):
n,m,d=map(float,input().split())
print((m-1.0)*(n-d)*((d>0.0)?2.0:1.0)/(n*n));

Buggy submission (verdict: Runtime Error):
n,m,d=map(float,input().split())
print((m-1.0)*(n-d)*((d)?2.0:1.0)/(n*n));

Buggy submission (verdict: Runtime Error):
n,m,d=map(float,input().split())
print((m-1)*(n-d)*((d)?2:1)/(n*n));
Problem p03316 (python)

Fixed submission:
n=input()
print(["Yes","No"][int(n)%sum(list(map(int,list(n))))>0])

Buggy submission (verdict: Runtime Error):
n=input()
print(["Yes","No"][int(n)%sum(list(map(int,list(n))))])
Problem p03331 (python)

Fixed submission:
def f(x):
    return x%10+f(x//10) if x else 0
n = int(input())
print(min([f(i)+f(n-i) for i in range(1,n)]))

Buggy submission (verdict: Runtime Error):
n = int(input())
def f(x):
    x%10+f(x//10) if x else 0
print(min([f(i)+f(n-i) for i in range(0,n+1)]))
Problem p03359 (python)

Fixed submission:
a,b = map(int,input().split())
print(a-1 if a > b else a)

Buggy submission (verdict: Runtime Error):
def isPrime(x):
	for i in range(2,min(x,236)):
		if x%i == 0:
			return False
	return True
n,a,p = int(input()),[],2
while n > 0:
	if isPrime(p):
		a.append(str(p))
		n -= 1
	p += 5
print(" ".join(a))
Problem p03360 (python)

Fixed submission:
a,k = list(map(int,input().split())),int(input())
print(sum(a)+max(a)*2**k-max(a))

Buggy submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split()),int(input())
print(max(a**k+b+c,a+b**k+c,a+b+c**k))
Problem p03370 (python)

Fixed submission:
n,x = map(int,input().split())
m = [int(input()) for i in range(n)]
print(n+(x-sum(m))//min(m))

Buggy submission (verdict: Runtime Error):
n,x,m = map(int,input().split()),[int(input()) for i in range(n)]
print(n+(x-sum(m))//min(m))
Problem p03408 (python)

Fixed submission:
n,s = int(input()),[]
for i in range(n):
	s.append(input())
m,t = int(input()),[]
for i in range(m):
	t.append(input())
ans = []
for i in range(n):
	ans.append(0)
	for j in range(n):
		if s[i] == s[j]:
			ans[i] += 1
	for j in range(m):
		if s[i] == t[j]:
			ans[i] -= 1
ans.append(0)
print(max(ans))

Buggy submission (verdict: Runtime Error):
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<ll, P> E;
#define MOD (1000000007ll)
#define l_ength size
#define PI 3.14159265358979

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

int main(void){
	int n,m,i,j,ans=0,tmp;
	string s[123],t[123];
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> s[i];
	}
	cin >> m;
	for(j=0; j<m; ++j){
		cin >> t[j];
	}
	for(i=0; i<n; ++i){
		tmp = 0;
		for(j=0; j<n; ++j){
			if(s[i] == s[j]){
				++tmp;
			}
		}
		for(j=0; j<m; ++j){
			if(s[i] == t[j]){
				--tmp;
			}
		}
		ans = max(ans,tmp);
	}
	cout << ans << endl;
	return 0;
}
Problem p03545 (python)

Fixed submission:
a=input()
op=list("+-")
flag = False
for i in op:
    for j in op:
        for k in op:
            s = a[0]+i+a[1]+j+a[2]+k+a[3]
            if eval(s) == 7:
                flag = True
                break
        if flag:
            break
    if flag:
        break
print(s+"=7")

Buggy submission (verdict: Runtime Error):
a=input()
op=list("+-")
flag = False
for i in range(op):
    for j in range(op):
        for k in range(op):
            s = a[0]+i+a[1]+j+a[2]+k+a[3]
            flag = True
            if eval(s) == 7:
                break
        if flag:
            break
    if flag:
        break
print(s+"=7")
Problem p03838 (python)

Fixed submission:
x,y = map(int,input().split())
def f(a):
	m = float('inf')
	for i in a:
		if i >= 0:
			m = min(i,m)
	return m
print(f([y-x,y+x+1,-x-y+1,x-y+2]))

Buggy submission (verdict: Runtime Error):
def f(x,y):
	if x*y < 0:
		return min(f(-x,y),f(y,-x))
	else:
		return x-y+2 if x>y else x-y
print(f(x,y=map(int,input().split())))

Buggy submission (verdict: Runtime Error):
def f(x,y):
	if x*y < 0:
		return min(f(-x,y),f(y,-x))
	else:
		return x-y+2 if x>y else x-y
print(f(map(int,input().split())))

Buggy submission (verdict: Runtime Error):
def f(x,y):
	if x*y < 0:
		return min(f(-x,y),f(y,-x))
	else:
		return x-y+2 if x>y else x-y
print(f(list(map(int,input().split()))))
Problem p02574 (python)

Fixed submission:
def resolve():
    import math
    n = int(input())
    a = list(set(map(int, input().split())))
    maxa = max(a)

    ggcd = a[0]
    for i in range(1, len(a)):
        ggcd = math.gcd(ggcd, a[i])
        if ggcd == 1:
            break

    pair = False

    c = [0] * (10**6+ 1)
    for i in a:
        c[i] += 1

    for i in range(2, maxa+1):
        cnt = 0
        for j in range(i, maxa+1, i):

            cnt += c[j]
        if cnt > 1:
            pair = True

    if ggcd != 1:
        print("not coprime")
    else:
        if pair:
            print("setwise coprime")
        else:
            print("pairwise coprime")
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import math
    n = int(input())
    a = list(map(int, input().split()))
    a = list(set(a))
    a = sorted(a)
    for i in range(1, len(a)):
        ggcd = math.gcd(ggcd, a[i])
        if ggcd == 1:
            break
    if ggcd != 1:
        print("not coprime")
    else:
      print("test")
resolve()
Problem p02618 (python)

Fixed submission:
def resolve():
    D = int(input())
    cost = list(map(int, input().split()))
    sat = [list((map(int, input().split()))) for _ in range(D)]
    last = [0]*26

    for i in range(D):
        maxcost = 0
        ans = 0
        for j in range(26):
            if maxcost <= sat[i][j]:
                ans = j+1
                maxcost = sat[i][j]
        print(ans)
resolve()

Buggy submission (verdict: Runtime Error):
d = int(input())
_ = list((map(int, input().split())))
sat = [list((map(int, input().split()))) for _ in range(365)]
for i in range(365):
    if i % 3 != 0:
        print(i%26 + 1)
    else:
        ans = 0
        cost = 0
        for j in range(26):
            if cost < sat[i][j]:
                ans = j+1
                cost = sat[i][j]
        print(ans)
resolve()
Problem p02642 (python)

Fixed submission:
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    a1 = {}
    for i in range(len(a)):
        if a[i] in a1:
            a1[a[i]] += 1
        else:
            a1[a[i]] = 1
    a = sorted(list(a1.keys()))
    ans = [1] * a[-1]

    for i in a:
        if ans[i-1] == 1:
            for j in range(i-1, len(ans), i):
                ans[j] = 0
            ans[i-1] =1
    ans1 = 0
    for i in a:
        if a1[i] == 1:
            ans1 += ans[i-1]
    print(ans1)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import bisect
    import math
    n = int(input())
    a = list(map(int, input().split()))
    a1 = {}
    for i in range(len(a)):
        if a[i] in a1:
            a1[a[i]] += 1
        else:
            a1[a[i]] = 1
    a = sorted(list(a1.keys()))
    ans = [1]*len(a)

    if len(a) != 1:
        for i in range(len(a)):
            if a[i] > a[-1]/a[0]:
                break
            if ans[i] == 1:
                for j in range(i+1, n):
                    if a[j] % a[i] == 0:
                        ans[j] = 0
    ans1 = 0
    for j in range(len(a)):
        if ans[j] == 1 and a1[a[j]] == 1:
            ans1 += 1
    print(ans1)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import bisect
    import math
    n = int(input())
    a = list(map(int, input().split()))
    a = sorted(a)
    maxa = a[-1]
    maxi = bisect.bisect_right(a, math.ceil(maxa**0.5))

    ans = [1]*n
    for i in range(0, maxi+1):
        if ans[i] == 1:
            for j in range(i+1, n):
                if ans[j] == 0:
                    continue
                if a[j] == a[i]:
                    ans[i] = 0
                if a[j] % a[i] ==0:
                    ans[j] = 0
    print(sum(ans))
resolve()
Problem p02662 (python)

Fixed submission:
def resolve():
    n, s = map(int, input().split())
    a = list(map(int,input().split()))
    dp = [[0]*(s+10) for _ in range(n+10)]
    dp[0][0] = 1
    mod = 998244353
    for i in range(1,n+1):
        nexta = a[i-1]
        for j in range(0, s+1):
            dp[i][j] += (2 * dp[i - 1][j])% mod
            if j + nexta > s:
                continue
            else:
                dp[i][j+nexta] += (dp[i-1][j])%mod
    print((dp[n][s])%mod)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n, s = map(int, input().split())
    a = list(map(int,input().split()))
    dp = [[0]*(s+10) for _ in range(n+10)]
    dp[0][0] = 1
    mod = 998244353
    for i in range(1,n+1):
        nexta = a[i-1]
        for j in range(0, s+1):
            dp[i][j] += (2 * dp[i - 1][j])% mod
            if j + nexta > s:
                continue
            else:
                dp[i][j+nexta] += (dp[i-1][j])%mod
    print((dp[n][s])%mod)
resolve(()
Problem p02675 (python)

Fixed submission:
def resolve():
    n = int(input())
    n = n%10
    if n == 3:
        print("bon")
    elif n == 0 or n == 1 or n == 6 or n == 8:
        print("pon")
    else:
        print("hon")
resolve()

Buggy submission (verdict: Runtime Error):

def resolve():
    import math
    from fractions import Fraction
    mod = 10**9 + 7
    n = int(input())
    dic1 = {}
    dic1["all0"] = 0
    dic1["b0"] = 0
    dic1[Fraction(0,1)] = 0
    for i in range(n):
        a, b = map(int, input().split())
        if a == 0 and b == 0:
            dic1["all0"] += 1
        elif b == 0:
            dic1["b0"] += 1
        else:
            c = math.gcd(a,b)
            a = a//c
            b = b//c
            if Fraction(a,b) in dic1:
                dic1[Fraction(a,b)] += 1
            else:
                dic1[Fraction(a,b)] = 1

    ans = 1
    all0 = 0
    for i in dic1:
        if i == "all0":
            all0 = dic1["all0"]
            continue
        elif i == "b0":
            counter = Fraction(0, 1)
            ans *= (2 ** dic1[i] + 2 ** dic1[counter] - 1)
            ans %= mod
            dic1[i] = 0
            dic1[counter] = 0
        elif i == Fraction(0,1):
            counter = "b0"
            ans *= (2 ** dic1[i] + 2 ** dic1[counter] - 1)
            ans %= mod
            dic1[i] = 0
            dic1[counter] = 0

        elif -1 * (Fraction(1,i)) in dic1:
            counter = -1 * (Fraction(1,i))
            ans *= (2**dic1[i]+2**dic1[counter]-1)
            ans %= mod
            dic1[i] = 0
            dic1[counter] = 0
        else:
            ans *= (dic1[i]+1)
            ans %= mod
    ans += all0
    print(ans%mod-1)
resolve()
Problem p02705 (python)

Fixed submission:
def resolve():
    import math
    r = int(input())
    print(r*2*math.pi)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import math
    r = int(input())
    print(r*2*math.pi)
resolve(9
Problem p02731 (python)

Fixed submission:
def resolve():
    l = int(input())
    print((l/3)**3)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    l = int(input())
    print((l/3)**3)
resolve(9
Problem p02780 (python)

Fixed submission:
def resolve():
    import sys
    input = sys.stdin.readline
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    p1 = list(map(lambda x: (x+1)/2, p))
    ans = 0
    if k==1:
        print(max(p1))
        exit()
    else:
        initial = sum(p1[0:k])
        if ans <= initial:
            ans = initial
            cal = initial
        for i in range(n-k):
            cal = cal-p1[i]+p1[i+k]
            if ans <= cal:
                ans = cal
    print(ans)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import sys
    input = sys.stdin.readline
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    p1 = list(map(lambda x: (x+1)/2, p))
    ans = 0
    if k==1:
        print(max(p1))
        exit()
    else:
        initial = sum(p1[0:k])
        for i in range(n-k+1):
            cal = initial-p1[i]+p1[i+k]
            if ans <= cal:
                ans = cal
    print(ans)
resolve()
Problem p02786 (python)

Fixed submission:
def resolve():
    import math
    h = int(input())
    logh = int(math.log(h,2))
    rlist = []
    cum = 1
    for i in range(40):
        rlist.append(cum)
        cum = cum*2+1
    print(rlist[logh])
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    i = sorted(h, reverse=True)

    if k==0:
        print(sum(i))
        exit()
    else:
        j = i[k:]
        print(sum(j))
resolve()
Problem p02802 (python)

Fixed submission:
def resolve():
    import sys
    input = sys.stdin.readline
    n, m = map(int, input().split())
    if m == 0:
        print("{} {}".format(0, 0))
        exit()

    a = list(input().split() for _ in range(m))
    flag = [[0] * n for i in range(2)]
    miss = 0
    correct = 0
    for i in range(m):
        if flag[0][int(a[i][0]) - 1] == 0:
            if a[i][1] == "WA":
                flag[1][int(a[i][0]) - 1] += 1
            elif a[i][1] == "AC":
                correct += 1
                miss += flag[1][int(a[i][0]) - 1]
                flag[0][int(a[i][0]) - 1] = 1
    print("{} {}".format(correct, miss))
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
	import sys
    input = sys.stdin.readline
    n, m = map(int, input().split())
    a = list(input().split() for _ in range(m))
    flag = [0]*2*n
    if m == 0:
        print("{} {}".format(0, 0))
        exit()
    miss = 0
    correct = 0
    for i in range(m):
        if flag[int(a[i][0])] == 0:
            if a[i][1] == "WA":
                miss += 1
            elif a[i][1] == "AC":
                correct += 1
                flag[int(a[i][0])] = 1
    print("{} {}".format(correct, miss))
resolve()

Buggy submission (verdict: Runtime Error):
def resolve()
	import sys
    input = sys.stdin.readline
    n, m = map(int, input().split())
    a = list(input().split() for _ in range(m))
    flag = [0]*2*n
    if m == 0:
        print("{} {}".format(0, 0))
        exit()
    miss = 0
    correct = 0
    for i in range(m):
        if flag[int(a[i][0])] == 0:
            if a[i][1] == "WA":
                miss += 1
            elif a[i][1] == "AC":
                correct += 1
                flag[int(a[i][0])] = 1
    print("{} {}".format(correct, miss))
resolve()

Buggy submission (verdict: Runtime Error):
    import sys
    input = sys.stdin.readline
    n, m = map(int, input().split())
    a = list(input().split() for _ in range(m))
    flag = [0]*2*n
    if m == 0:
        print("{} {}".format(0, 0))
        exit()
    miss = 0
    correct = 0
    for i in range(m):
        if flag[int(a[i][0])] == 0:
            if a[i][1] == "WA":
                miss += 1
            elif a[i][1] == "AC":
                correct += 1
                flag[int(a[i][0])] = 1
    print("{} {}".format(correct, miss))
resolve()
Problem p02882 (python)

Fixed submission:
def resolve():
    import math
    a,b,x = map(int, input().split())
    area = x/a
    height = x/(a**2)
    if height == b:
        print(0)
    elif area >= (a*b/2):
        c = b-height
        angle = math.degrees(math.atan(a/(2*c)))
        print(90-angle)
    else:
        d = area*2/b
        angle = math.degrees(math.atan(d/b))
        print(90-angle)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import math
    a,b,x = map(int, input().split())
    area = x/a
    height = x/(a**2)
    if area >= (a*b/2):
        c = b-height
        angle = math.degrees(math.atan(a/(2*c)))
        print(90-angle)
    else:
        d = area*2/b
        angle = math.degrees(math.atan(d/b))
        print(90-angle)
resolve()
Problem p02911 (python)

Fixed submission:
def resolve():
    n,k,q = map(int, input().split())
    a = [int(input()) for i in range(q)]
    point = [0]*n
    for i in range(q):
        point[a[i]-1] += 1
    for j in range(n):
        if k-q+point[j] > 0:
            print("Yes")
        else:
            print("No")
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    from collections import deque
    n, m = map(int, input().split())
    a = deque(map(int, input().split()))

    for i in range(m):
        a = deque(sorted(a))
        maxa = a.pop()
        maxa //= 2
        a.appendleft(maxa)
    print(sum(a))
resolve()
Problem p02947 (python)

Fixed submission:
def resolve():
    n = int(input())
    s = [",".join(sorted(input())) for i in range(n)]
    ans = {}
    count = 0
    for i in range(n):
        if s[i] in ans:
            count += ans[s[i]]
            ans[s[i]] += 1
        else:
            ans[s[i]] = 1
    print(count)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    dict = {}
    for i in range(n):
        s = "".join(sorted(input()))
        if s[i] in dict.keys():
            dict[s] += 1
        else:
            dict[s] =1
    alist = list (dict.values())
    ans = 0
    for i in range(len(alist)):
        ct = alist[i]
        ans += (ct*(ct-1))//2
    print(ans)
resolve()
Problem p03014 (python)

Fixed submission:
def resolve():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    hs = [[0]*w for _ in range(h)]
    ws = [[0]*w for _ in range(h)]

    for i in range(h):
        cums = 0
        for j in range(w):
            if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
        for j in reversed(range(w-1)):
            if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

    for i in range(w):
        cums = 0
        for j in range(h):
            if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
        for j in reversed(range(h-1)):
            if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, ws[i][j] + hs[i][j])
    print(ans-1)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import numpy as np
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    hs = [[0]*w for _ in range(h)]
    ws = [[0]*w for _ in range(h)]

    for i in range(h):
        cums = 0
        for j in range(w):
            if s[i][j] == "#":
                cums = 0
                ws[i][j] = 0
            else:
                cums += 1
                ws[i][j] = cums
        for j in reversed(range(w-1)):
            if ws[i][j+1] != 0 and ws[i][j] != 0:
                ws[i][j] = ws[i][j+1]

    for i in range(w):
        cums = 0
        for j in range(h):
            if s[j][i] == "#":
                cums = 0
                hs[j][i] = 0
            else:
                cums += 1
                hs[j][i] = cums
        for j in reversed(range(h-1)):
            if hs[j+1][i] != 0 and hs[j][i] != 0:
                hs[j][i] = hs[j+1][i]

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, ws[i][j] + hs[i][j])
    print(ans-1)
resolve()
Problem p03076 (python)

Fixed submission:
def resolve():
    import math
    a = [int(input()) for _ in range(5)]
    b = []
    for i in range(5):
        if a[i]%10 != 0:
            b.append(a[i]%10)
    if len(b) == 0:
        amin = 10
    else:
        amin = min(b)
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
    print(ans-10+amin)

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import math
    a = [int(input()) for _ in range(5)]
    b = []
    for i in range(5):
        if a[i]%10 != 0:
            b.append(a[i]%10)
    if b == []
        amin = 0
    else:
        amin = min(b)
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
    print(ans-10+amin)

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    import math
    a = [int(input()) for _ in range(5)]
    b = []
    for i in range(5):
        if a[i]%10 != 0:
            b.append(a[i]%10)
    amin = min(b)
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
    print(ans-10+amin)

resolve()