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

Fixed submission:
from decimal import *
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]
def li4():return [float(i) for i in input().rstrip('\n').split(' ')]

n = val()
l = li4()
mihe = n//2 + 1


curr = 1
for i in l:curr *= (1 - i)
dp = [0 for i in range(n + 1)]
dp[0] = 1

for i in range(n):

    for j in range(i + 1,-1,-1):
        if not j:dp[j] *= 1 - l[i]
        else:dp[j] = dp[j-1] * l[i] + dp[j] *(1 - l[i])

ans = 0
for i in dp[-mihe:]:
    ans += i

print(round(ans,10))

Buggy submission (verdict: Runtime Error):
from decimal import *
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]
def li4():return [float(i) for i in input().rstrip('\n').split(' ')]

n = val()
l = li4()
mihe = n//2 + 1


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

for i in range(n-1,-1,-1):

    for j in range(i,n,1):
        sumarray[j] += ( l[i] / (1 - l[i]) ) * sumarray[j + 1]


curr = 1
for i in l:curr *= (1 - i)
ans = 0
for i in sumarray[:-mihe]:
    ans += i * curr
# if 'e' in str(ans):
temp = str(ans).index('e')
print((str(ans)[:temp + 1] + '0'*20)[:12])
# else:print(ans)
Problem p03180 (python)

Fixed submission:
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop,heapify
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

from itertools import accumulate, combinations
from functools import lru_cache

M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]




n = val()
l = []

for i in range(n):
    l.append(li())


ans = [-float('inf') for i in range(2 ** n)]

ans[0] = 0

for i in range(1, 2 ** n):


    curr = 0
    for j in range(n):
        for k in range(n):
            if (i >> j) & 1 == (i >> k) & 1 == 1:curr += l[j][k]
    
    curr //= 2

    ind = i & (i - 1)

    while ind:
        curr = max(curr, ans[ind] + ans[ind ^ i])
        ind = (ind - 1) & i
    
    ans[i] = curr

print(max(ans))

Buggy submission (verdict: Runtime Error):
from decimal import *
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
M = mod = 10**9 + 7
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]
def li4():return [float(i) for i in input().rstrip('\n').split(' ')]

def givevalue(p):
    global l
    tot = 0
    for s in p:
        for i in s:
            for j in s:
                tot += l[i][j]
    # print('tot : ',tot//2)
    return tot//2

ans = 0
def currentvalue(ind,p):
    global l,ans
    if ind == len(l):
        #print(p)
        ans += 1
        currentvalue.ma = max(currentvalue.ma,givevalue(p))
    maxind = 0
    while maxind < len(l) - 1 and len(p[maxind + 1]):maxind += 1
    for j in range(min(len(p),maxind + 1)):
        p[j].add(ind)
        currentvalue(ind + 1,p.copy())
        p[j].remove(ind)


n = val()
l = []
for i in range(n):l.append(li())



p = [set() for i in range(n)]

currentvalue.ma = 0
currentvalue(0,p)
print(currentvalue.ma)
# print('total counts : ',ans)
Problem p02730 (python)

Fixed submission:
S = input()
N = len(S)

def palind(word):
  word = word.lower()
  return word[::-1] ==word

num1 = int((N-1)/2)
num2 = int((N+3)/2)

text1 =S[0::num1]
text2 =S[num2-1::]

if palind(S) == True and palind(text1) == True and palind(text2) == True:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
def palind(word):
  word = word.lower()
  return word[::-1] ==word

num1 = int((N-1)/2)
num2 = int((N+3)/2)

text1 =S[0::num1]
text2 =S[num2-1::]

if palind(S) == True and palind(text1) == True and palind(text2) == True:
  print("Yes")
else:
  print("No")
Problem p02755 (python)

Fixed submission:
from math import ceil,floor

numA,numB = map(int,input().split())
for i in range(10000):
  testA = floor(i * 0.08)
  testB = floor(i * 0.10)
  if testA == numA and testB == numB:
    print(i)
    break
else:
  print("-1")

Buggy submission (verdict: Runtime Error):
from math import ceil,floor
out = []

numA,numB = map(int,input().split())
for i in range(101):
  testA = floor(i * 0.08)
  testB = floor(i * 0.10)
  if testA == numA and testB == numB:
    out.append(i)

print(min(out))

Buggy submission (verdict: Runtime Error):
from math import ceil,floor
out = []

numA,numB = map(int,input().split())
for i in range(101):
  testA = floor(i * 0.08)
  testB = floor(i * 0.10)
  if testA == numA and testB == numB:
    out.append(i)

print(min(out))
Problem p02811 (python)

Fixed submission:
A,B = map(int,input().split())
if A * 500 >= B:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B = map(int,input())
if A * 500 >= B:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B = map(int,input())
If A * 500 >= B:
  print("Yes")
else:
  print("No")
Problem p02848 (python)

Fixed submission:
N =int( input())
S = input()

## empty list ##
out = []

for i in S:
  ## make code num ##
  num = ord(i)
  num = num + N
  if num > 90:
    num = num - 26
  ## make list ##
  out.append(chr(num))

## output ##
out = "".join(out)
print(out)

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
out = ""
for i in S:
  num = ord(i)
  num = num + N
  print(num)
  out.append(chr(num))

print(out)
Problem p02760 (python)

Fixed submission:
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = int(input())
b = [(int(input())) for _ in range(N)]

bingo1 =[0,0,0]
bingo2 =[0,0,0]
bingo3 =[0,0,0]
for i in range(3):
    for j in range(N):
        if A1[i]==b[j]:
            bingo1[i]=1
        elif A2[i]==b[j]:
            bingo2[i]=1
        elif A3[i]==b[j]:
            bingo3[i]=1    


            
if bingo1[0] == bingo1[1] == bingo1[2] == 1:
    print("Yes")
elif bingo2[0] == bingo2[1] == bingo2[2] == 1:
    print("Yes")
elif bingo3[0] == bingo3[1] == bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == bingo2[0] == bingo3[0] == 1:
    print("Yes")
elif bingo1[1] == bingo2[1] == bingo3[1] == 1:
    print("Yes")
elif bingo1[2] == bingo2[2] == bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == bingo2[1] == bingo3[2] == 1:
    print("Yes")
elif bingo1[2] == bingo2[1] == bingo3[0] == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = int(input())
b = []
for _ in range(N):
    b.append(input())

bingo1 =[0,0,0]
bingo2 =[0,0,0]
bingo3 =[0,0,0]
for i in range(3):
    for j in range(N):
        if A1[i]=b[j]:
            bingo1[i]+=1
        if A2[i]=b[j]:
            bingo2[i]+=1
        if A3[i]=b[j]:
            bingo3[i]+=1
if bingo1[0] == 1 and bingo1[1] == 1 and bingo1[2] == 1:
    print("Yes")
elif bingo2[0] == 1 and bingo2[1] == 1 and bingo2[2] == 1:
    print("Yes")
elif bingo3[0] == 1 and bingo3[1] == 1 and bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == 1 and bingo2[0] == 1 and bingo3[0] == 1:
    print("Yes")
elif bingo1[1] == 1 and bingo2[1] == 1 and bingo3[1] == 1:
    print("Yes")
elif bingo1[2] == 1 and bingo2[2] == 1 and bingo3[2] == 1:
    print("Yes")
elif bingo1[1] == 1 and bingo2[2] == 1 and bingo3[3] == 1:
    print("Yes")
elif bingo1[3] == 1 and bingo2[2] == 1 and bingo3[1] == 1:
    print("Yes")
else:
    print("No")
Problem p03000 (python)

Fixed submission:
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = 0
count = 1
for i in L:
    D+=i
    if D<=X:
        count+=1
    else:
        break
print(count)

Buggy submission (verdict: Runtime Error):
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = 0
count = 1
for i in L:
    D+=L
    if D<=X:
        count+=1
    else:
        break
print(count)
Problem p02842 (python)

Fixed submission:
import math


def resolve():
    N = int(input())
    x = int(N // 1.08)
    if math.floor(x * 1.08) == N:
        print(x)
    elif math.floor((x + 1) * 1.08) == N:
        print(x + 1)
    else:
        print(":(")


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    x = int(N // 1.08)
    if math.floor(x * 1.08) == N:
        print(x)
    elif math.floor((x + 1) * 1.08) == N:
        print(x + 1)
    else:
        print(":(")


if __name__ == "__main__":
    resolve()
Problem p03161 (python)

Fixed submission:
def resolve():
    N, K = map(int, input().split())
    h = [int(i) for i in input().split()]

    dp = [0, abs(h[1] - h[0])]
    for i in range(2, N):
        dp.append(
            min(dp[i - j] + abs(h[i] - h[i - j]) for j in range(1, min(K + 1, i + 1)))
        )
    print(dp[N - 1])


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N, K = map(int, input().split())
    h = [int(i) for i in input().split()]

    dp = [0, abs(h[1] - h[0])]
    for i in range(2, N):
        dp.append(min(dp[i - j] + abs(h[i] - h[i - j]) for j in range(1, K + 1)))
    print(dp[N - 1])


if __name__ == "__main__":
    resolve()
Problem p04046 (python)

Fixed submission:
mod = 10 ** 9 + 7
fac_table = [1 for i in range(200001)]
inv_table = [1 for i in range(200001)]


def make_table(h, w):

    for i in range(1, h + w - 1):
        fac_table[i] = fac_table[i - 1] * i % mod
        inv_table[i] = pow(fac_table[i], mod - 2, mod)


def comb(n, r):
    return fac_table[n] * inv_table[n - r] % mod * inv_table[r] % mod


def resolve():
    H, W, A, B = map(int, input().split())
    make_table(H, W)
    print(
        sum(
            [
                comb(H - A - 1 + i, i) * comb(A - 1 + W - i - 1, A - 1) % mod
                for i in range(B, W)
            ]
        )
        % mod
    )

if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
# 解説を見て解いた。解説PDFの「B≦i≦Wを満たす全てのiについて」のWはW-1の間違い。
def make_table(h, w):

    for i in range(1, h + w - 1):
        fac_table.append(fac_table[-1] * i % mod)  # i! mod 10**9+7
        inv_table.append(pow(fac_table[-1], mod - 2, mod))  # (i!)^(-1) mod 10**9+7.


def comb(n, r):
    return fac_table[n] * inv_table[n - r] * inv_table[r] % mod


def resolve():
    H, W, A, B = map(int, input().split())
    make_table(H, W)
    _sum = 0
    print(
        sum(
            [
                comb(H - A - 1 + i, i) * comb(A - 1 + W - i - 1, A - 1) % mod
                for i in range(B, W)
            ]
        )
        % mod
    )


if __name__ == "__main__":
    resolve()
Problem p02765 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline


def main():
    n, r = map(int, input().split())
    if n <= 10:
        # r = x - (100 * (10 - n))
        print(r + 100 * (10 - n))

    else:
        print(r)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
import math
from decimal import Decimal
from scipy.special import comb
input = sys.stdin.readline


def main():
    n, r = map(int, input().split())
    if n <= 10:
        # r = x - (100 * (10 - n))
        print(r + 100 * (10 - n))

    else:
        print(r)


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

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力


def main():
    n = int(input())
    h = list(map(int, input().split()))

    if n == 1:
        print(0)
        return

    result = []
    count = 0
    for i in range(n - 1):
        if h[i] < h[i + 1]:
            result.append(count)
            count = 0
            continue

        count += 1
        if i == n - 2:
            result.append(count)

    print(max(result))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力


def main():
    n = int(input())
    h = list(map(int, input().split()))

    result = []
    count = 0
    for i in range(n - 1):
        if h[i] < h[i + 1]:
            result.append(count)
            count = 0
            continue

        count += 1
        if i == n - 2:
            result.append(count)

    print(max(result))


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

Fixed submission:
a = int(input())/3
print(a*a*a)

Buggy submission (verdict: Runtime Error):
print(int(input)/3)
Problem p02999 (python)

Fixed submission:
x,a = [int(i) for i in input().split()]

if x < a:
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
x,a = [int(i) for i in input().split()]

if x < a:
    print(0)
else:
Problem p03086 (python)

Fixed submission:
s = input()
possible_answers = [0]
possible_answer = 0
acgt = ['A', 'C', 'G', 'T']

for i in range(len(s)):
    if s[i] in acgt:
        possible_answer += 1
    else:
        possible_answers.append(possible_answer)
        possible_answer = 0

possible_answers.append(possible_answer)
print(max(possible_answers))

Buggy submission (verdict: Runtime Error):
s = input()
possible_answers = []
possible_answer = 0
acgt = ['A', 'C', 'G', 'T']

for i in range(len(s)):
    if s[i] in acgt:
        possible_answer += 1
    else:
        possible_answers.append(possible_answer)
        possible_answer = 0

print(max(possible_answers))
Problem p03262 (python)

Fixed submission:
import fractions

N,X = map(int,input().split())
x = [int(i) for i in input().split()]
x.append(X)
x.sort()
y = [0]*N
for i in range(N):
    y[i] = x[i+1]-x[i]

if len(y) == 1:
    print(y[0])
else:
    answer = fractions.gcd(y[0],y[1])
    for i in range(2,N):
        answer = fractions.gcd(answer,y[i])
    print(answer)

Buggy submission (verdict: Runtime Error):
import fractions

N,X = map(int,input().split())
x = [int(i) for i in input().split()]
x.append(X)
x.sort()
y = [0]*N
for i in range(N):
    y[i] = x[i+1]-x[i]

answer = fractions.gcd(y[0],y[1])
for i in range(2,N):
    answer = fractions.gcd(answer,y[i])

print(answer)

Buggy submission (verdict: Runtime Error):
import fractions

N,X = map(int,input().split())
x = [int(input()) for i in range(N)]
x.append(X)
x.sort()
y = [0]*N
for i in range(N):
    y[i] = x[i+1]-x[i]

answer = fractions.gcd(y[0],y[1])
for i in range(2,N):
    answer = fractions.gcd(answer,y[i])

print(answer)
Problem p02717 (python)

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

a, b, c = list(map(int, input().split()))
x = a
a = b
b = x

x = a
a = c
c = x

print(a, b, c)

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

a, b, c = list(map(int, input().split()))
x = a
a = b
b = x

x = a
a = c
c = x

print(a, b, c)
Problem p02947 (python)

Fixed submission:

def combain(X, Y):
    return int(( X * (X - 1)) / Y)

N = int(input())
S = []

ans = 0

for i in range(N):
    S.append(sorted(input()))

S.sort()

ans = 0

X = 1
for i in range(N-1):
    if S[i] == S[i+1]:
        X += 1
    elif X > 1:
        C = combain(X, 2)
        X = 1
        ans += C

if X > 1:
    C = combain(X, 2)
    X = 1
    ans += C
    
print(ans)

Buggy submission (verdict: Runtime Error):

import math

def combain(X, Y):
    return int(math.factorial(X) / math.factorial(Y))

N = int(input())
S = []

ans = 0

for i in range(N):
    S.append(sorted(input()))

S.sort()

ans = 0

X = 1
for i in range(N-1):
    if S[i] == S[i+1]:
        X += 1
    elif X > 1:
        C = combain(X, 2)
        X = 1
        ans += C

if X > 1:
    C = combain(X, 2)
    X = 1
    ans += C

print(ans)
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split(" "))

ans = 2019
for i in range(L, min(R, L + 2019 * 10)):
    for j in range(i + 1, min(R+1, L + 2019 * 10)):
        ans = min(ans, (i * j) % 2019)
        if ans == 0:
            break

print(ans)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split(" "))

ans = 2019
for i in range(L, min(R, (L + 2019 * 1000 )):
    ans = min(ans, (i * (i + 1)) % 2019)


print(ans)
Problem p03000 (python)

Fixed submission:

N, X = map(int, input().split(" "))
L = list(map(int, input().split(" ")))

ans = 1
cur_X = 0
pos_N = 0

for i in range(N):
    ans += 1
    cur_X += L[i]

    if cur_X > X:
        ans -= 1
        break

print(ans)

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

ans=0

cur_X = 0
pos_N = 0
while cur_X <= X and pos_N <= N:
    cur_X += L[pos_N]
    pos_N += 1
    ans += 1

print(ans)

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

ans=0

cur_X = 0
pos_N = 0
while cur_X <= X and pos_N <= N:
    cur_X += L[pos_N]
    pos_N += 1
    ans += 1

print(ans)
Problem p03037 (python)

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

maxL=0
minR=N

for i in range(M):
    L, R = map(int, input().split(" "))
    
    if minR < L or R < maxL:
        print("0")
        exit()
    
    maxL=max(maxL, L)
    minR=min(minR, R)


print(minR-maxL+1)

Buggy submission (verdict: Runtime Error):

from collections import deque

N, M = map(int, input().split())

cards = deque()

for i in range(N):
    cards.append(i+1)


for i in range(M):
    Li, Ri = map(int, input().split())
    L = cards.popleft()
    if Li <= L:
        cards.appendleft(L)
    else:
        while Li > L + 1 and len(cards) > 0:
            L = cards.popleft()

    R = cards.pop()
    if Ri >= R:
        cards.append(R)
    else:
        while Ri < R - 1 and len(cards) > 0:
            R = cards.pop()

print(len(cards))

Buggy submission (verdict: Runtime Error):

from collections import deque

N, M = map(int, input().split())

cards = deque()

for i in range(N):
    cards.append(i+1)


for i in range(M):
    Li, Ri = map(int, input().split())
    L = cards.popleft()
    if Li <= L:
        cards.appendleft(L)
    else:
        while Li > L + 1:
            L = cards.popleft()

    R = cards.pop()
    if Ri >= R:
        cards.append(R)
    else:
        while Ri < R - 1:
            R = cards.pop()

print(len(cards))
Problem p03061 (python)

Fixed submission:
from fractions import *
n = int(input())
a = [0]+list(map(int, input().split()))+[0]
b = [0]*(n+2)
c = [0]*(n+2)
for i in range(1, n+1):
	b[i] = gcd(b[i-1], a[i])
for i in range(n, 0, -1):
	c[i] = gcd(c[i+1], a[i])

ans=1
for i in range(1, n+1):
    x1 = b[i-1]
    x2 = c[i+1]
    ans=max(ans, gcd(x1, x2))

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque

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


import fractions
from functools import reduce

ans=0
GCD_target=gcd_list(A)
#print("GCD_target = {}".format(GCD_target))

for i in range(N):
   #copied_A = A[:]
   remove=A.popleft()
   proc=lambda x: reduce(fractions.gcd, x)
   GCD_current= proc(list(A)) #gcd_list(list(A))
   A.append(remove)
   #print(GCD_current)
   ans=max(ans,GCD_current)

print(ans)
Problem p03067 (python)

Fixed submission:
btn=input().split()
A=int(btn[0])
B=int(btn[1])
C=int(btn[2])
if A < C < B:
	print("Yes")
elif A > C > B:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
x = sum(1 if s[i] != "#" else 0 for i in range(n))
y = sum(0 if s[i] != "#" else 1 for i in range(n))
print(min(x, y))
Problem p03071 (python)

Fixed submission:
btns=input().split()
X=int(btns[0])
Y=int(btns[1])
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)

Buggy submission (verdict: Runtime Error):
btns=input().split()
X=btns[0]
Y=btns[1]
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)

Buggy submission (verdict: Runtime Error):
import sys
btns = sys.stdin.readline().split()
X=btns[0]
Y=btns[1]
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)

Buggy submission (verdict: Runtime Error):
import sys

btns = sys.stdin.readline().split()
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)
Problem p03817 (python)

Fixed submission:
x = int(input())
count = 0
q, mod = divmod(x, 11)
count += q*2
if mod > 0:
    if(mod <= 6):
        count += 1
    else:
        count += 2
print(count)

Buggy submission (verdict: Runtime Error):
x = int(input())
count = 0
q, mod = divmod(x, 11)
count += q*2
if mod > 0:
	if(mod <= 6):
    	count += 1
	else:
    	count += 2
print(count)
Problem p02947 (python)

Fixed submission:
N = int(input())
ana = {}
answer = 0

for i in range(N):
    s = sorted(input())
    new_str = ''.join(s)
    flag = 0

    if new_str in ana.keys():
        ana[new_str] += 1
        answer += ana[new_str]
        flag = 1

    if flag == 0:
        ana[new_str] = 0

print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
ana = {}
answer = 0

for i in range(N):
    s = sorted(input())
    new_str = ''.join(s)
    flag = 0

    try:
        k = ana.keys().index(new_str)y
        ana[k] += 1
        answer += ana[k]

    except:
        ana[new_str] = 0

print(answer)