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

Fixed submission:
import math, sys
 
a, b = map(str, input().split())
input = int(a + b)

for i in range(1000):
  if input == i**2 :
    print('Yes')
    sys.exit(0)

print('No')

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

for i in range(1000):
  if input == i**2 :
  	print('Yes')
    break

print('No')

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

for i in range(1000):
  if input == i**2 :
  	print('Yes')
    break   

print('No')

Buggy submission (verdict: Runtime Error):
import math

a, b = map(input().split())
input = int(a + b)

if input == math.sqrt(input)**2 :
  print('Yes')
else: 
  print('No')
Problem p03565 (python)

Fixed submission:
import copy
Sd = list(input())
T = list(input())
S = copy.deepcopy(Sd)
ans = []
for i in range(len(Sd)-len(T)+1):
    for j in range(len(T)):
        if Sd[i+j] != '?' and Sd[i+j] != T[j]:
            Sd = copy.deepcopy(S)
            break
        elif Sd[i+j] == '?':
            Sd[i+j] = T[j]
        if j == len(T)-1:
            l = ['a' if i =='?' else i for i in Sd]
            ans.append(''.join(l))
            Sd = copy.deepcopy(S)
if len(ans) == 0:
    print('UNRESTORABLE')
else:
    print(min(ans))

Buggy submission (verdict: Runtime Error):
import copy
Sd = list(input())
T = list(input())
S = copy.deepcopy(Sd)
flag = 0
for i in range(len(Sd)-len(T)+1):
    if flag == 1:
        break
    for j in range(len(T)):
        if Sd[i+j] != '?' and Sd[i+j] != T[j]:
            Sd = S
            flag = 0
            break
        elif Sd[i+j] == '?':
            Sd[i+j] = T[j]
        if j == len(T)-1:
            flag = 1
if flag == 1:
    l = ['a' if i =='?' else i for i in Sd]
    print(''.join(l))
else:
    print('UNRESTORABLE')
import copy
Sd = list(input())
T = list(input())
S = copy.deepcopy(Sd)
flag = 0
for i in range(len(Sd)-len(T)+1):
    if flag == 1:
        break
    for j in range(len(T)):
        if Sd[i+j] != '?' and Sd[i+j] != T[j]:
            Sd = S
            flag = 0
            break
        elif Sd[i+j] == '?':
            Sd[i+j] = T[j]
        if j == len(T)-1:
            flag = 1
if flag == 1:
    l = ['a' if i =='?' else i for i in Sd]
    print(''.join(l))
else:
    print('UNRESTORABLE')
Problem p03623 (python)

Fixed submission:
x, a, b = map(int, input().split())
if abs(a-x) < abs(b-x):
  print('A')
else:
  print('B')

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
if abs(a-x) < abs(b-x):
  print('A')
elif:
  print('B')
Problem p03624 (python)

Fixed submission:
S = input()
alpha = [chr(ord('a') + i) for i in range(26)]
n=0
c=-1
while c == -1 and n < 26:
  if not alpha[n] in S:
    c = n
    break
  n+=1
if c == -1:
  print('None')
else:
  print(alpha[n])

Buggy submission (verdict: Runtime Error):
S = input()
alpha = [chr(ord('a') + i) for i in range(26)]
n=0
c=0
while c == 0 or n < 26:
  if alpha[n] in S:
    c = n
  n+=1
if c == 0:
  print('None')
else:
  print(alpha[n])
Problem p03720 (python)

Fixed submission:
N, M = map(int, input().split())
a = []
b = []
for i in range(M):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)

for i in range(N):
    r = 0
    r += a.count(i+1)
    r += b.count(i+1)
    print(r)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = []
b = []
for i in range(M):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)

for i in range(N):
    r = 0
    r += a.count(i+1)
    r += b.count(i+1)
	print(r)
Problem p03760 (python)

Fixed submission:
O = input()
E = input()

ans = ''
for i in range(len(O)+len(E)):
  if i%2 == 0:
    ans+=O[int(i/2)]
  else:
    ans+=E[int(i/2)]
print(ans)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()

ans = ''
for i in range(len(O)+len(E)):
  if i%2 == 0:
    ans+=O[i/2]
  else:
    ans+=E[i/2]
print(ans)
Problem p03844 (python)

Fixed submission:
A, op, B = map(str, input().split())
if op == '+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
A, op, B = map(str, input().split())
if op == '+':
  print(int(A)+int(b))
else:
  print(int(A)-int(b))
Problem p02687 (python)

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


def solve(S: str):
    print("ABC" if S == "ARC" else "ARC")
    return


# 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()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(n: int, A: int, B: int, C: int, s: "List[str]"):
    S = {}
    S[(A,B,C)] = ""
    for i in range(n):
        N = {}
        d = s[i]
        for a,b,c in S:
            path = S[(a,b,c)]
            if d == "AB":
                if b > 0:
                    # A+1,B-1
                    N[(min(n,a+1),b-1,c)] = path + "A"
                if a > 0:
                    N[(a-1,min(n,b+1),c)] = path + "B"
            elif d == "BC":
                if c > 0:
                    # b +1,c -1
                    N[(a, min(n,b + 1), c-1)] = path + "B"
                if b > 0:
                    N[(a, b -1, min(n,c+1))] = path + "C"
            else:
                if c > 0:
                    N[(min(n,a+1),b,c-1)] = path + "A"
                if a > 0:
                    N[(a-1,b,min(n,c+1))] = path + "C"
        if len(N) == 0:
            print(NO)
            exit()
        S = N
    print(YES)
    for a,b,c in S:
        p = S[(a,b,c)]
        for i in p:
            print(i)
        break

    return


# 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
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(N)]  # type: "List[str]"
    solve(N, A, B, C, s)

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

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


def solve(N: int, K: int, C: int, S: str):
    # 最善だったら何ケースか
    work = 0
    rest = 0
    startWork = -1
    leftIndices = set()
    rightIndices = set()
    for i in range(N):
        if S[i] == "o" and rest <= 0:
            rest = C
            work += 1
            leftIndices.add(i)
        else:
            rest -= 1
    if work != K:
        print("")
        exit()
    work = 0
    rest = 0
    for i in range(N-1, -1, -1):
        if S[i] == "o" and rest <= 0:
            rest = C
            work += 1
            rightIndices.add(i)
        else:
            rest -= 1
    for i in sorted(list(leftIndices.intersection(rightIndices))):
        print(i+1)
    # print(rightIndices)
    # rest = -1
    # startWork = -1
    # for i in range(N-1, -1, -1):
    #     if S[i] == "o" and rest <= 0:
    #         rest = C
    #         startWork = i
    #         girigiriIndices.append(i)
    #         print(f"i{i},{rest}")
    #     else:
    #         rest -= 1

    # if work != K:
    #     print("")
    #     # print(work)
    #     exit()
    # for i in girigiriIndices:
    #     print(i+1)
    return


# 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
    K = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, K, C, S)


if __name__ == '__main__':
    main()

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


def solve(N: int, K: int, C: int, S: str):
    # 最善だったら何ケースか
    work = 0
    rest = 0
    startWork = -1
    girigiriIndices = []
    for i in range(N):
        if i == 15:
            print(f"i=15{rest}")
        if S[i] == "o" and rest <= 0:
            rest = C
            work += 1
            startWork = i
        else:
            rest -= 1
    rest = -1
    startWork = -1
    for i in range(N-1, -1, -1):
        if S[i] == "o" and rest <= 0:
            rest = C
            startWork = i
            girigiriIndices.append(i)
            print(f"i{i},{rest}")
        else:
            rest -= 1

    if work != K:
        print("")
        # print(work)
        exit()
    for i in girigiriIndices:
        print(i+1)
    return


# 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
    K = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, K, C, S)


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

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, M: int):
    print(YES if N == M else NO)
    return


# 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
    solve(N, M)


if __name__ == '__main__':
    main()

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

MOD = 1000000007  # type: int


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def solve(N: int, A: "List[int]"):
    m = lcm(*A)

    def sumup(x, y):
        return (x + m // y) % MOD
    print(reduce(sumup, A, 0))
    return


# 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
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


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

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


def solve(N: int, M: int, A: "List[int]"):
    costs = [10**18, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    cand = [(i, costs[i]) for i in A]
    cand.sort(reverse=True)
    digits = [-1 * 10**16 for i in range(N+1)]
    digits[0] = 0
    for i in range(1, N+1):
        r = -1 * 10**16
        for c in cand:
            if i - c[1] >= 0:
                r = max(r, digits[i - c[1]] + 1)
        digits[i] = r
    digit = digits[N]
    lastCost = N
    result = 0
    # print(digits)
    for i in range(digit):
        for c in cand:
            if lastCost - c[1] >= 0 and digits[lastCost - c[1]] == digits[lastCost] - 1:
                result = result*10 + c[0]
                lastCost = lastCost - c[1]
                # print(f"lastCost:{lastCost} result:{c[0]} cost:{c[1]}")
                break
    print(result)
    return


# Generated by 1.1.3 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
    A = [int(next(tokens)) for _ in range(M)]  # type: "List[int]"
    solve(N, M, A)


if __name__ == '__main__':
    main()

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


def hadEnd(dp):
    lastCol = dp[len(dp) - 1]
    for c in lastCol:
        if c != 0:
            return False
    return True


def dfs(cand, N, c):
    nextBase = c * 10
    result = 0
    for can in cand:
        next = nextBase + can[0]
        if(N - can[1] == 0):
            result = max(result, next)
            continue
        elif(N - can[1] < 0):
            result = max(result, -1)
            continue
        result = max(result, dfs(cand, N - can[1], next))
    return result


def solve(N: int, M: int, A: "List[int]"):
    costs = [10**18, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    cand = [(i, costs[i]) for i in A]
    print(dfs(cand, N, 0))
    return


# Generated by 1.1.3 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
    A = [int(next(tokens)) for _ in range(M)]  # type: "List[int]"
    solve(N, M, A)


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

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


def solve(N: int, X: int, x: "List[int]"):
    x.sort()
    gMax = None
    last = None
    begin = 0
    if abs(X - x[0]) > 0:
        last = abs(X-x[0])
        gMax = last
    else:
        begin = 1
        last = x[1]-x[0]
        gMax = last
    for i in range(begin, N-1):
        next = x[i+1] - x[i]
        gMax = fractions.gcd(gMax, next)
    print(gMax)
    return


# Generated by 1.1.4 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
    X = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, X, x)


if __name__ == '__main__':
    main()

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


def solve(N: int, X: int, x: "List[int]"):
    x.sort()
    gMax = None
    last = None
    begin = 0
    if abs(X - x[0]) > 0:
        last = abs(X-x[0])
        gMax = last
    else:
        begin = 1
        last = x[1]-x[0]
        gMax = last
    for i in range(begin, N-1):
        next = x[i+1] - x[i]
        gMax = math.gcd(gMax, next)
    print(gMax)
    return


# Generated by 1.1.4 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
    X = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, X, x)


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

Fixed submission:
l,r,k=map(int,input().split())
ans=0
for i in range(l,r+1):
  if i%k==0:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
l,r,k=map(int,input().split())
ans=0
for i inrange(l,r+1):
  if i//k==0:
    ans+=1
print(ans)
Problem p02608 (python)

Fixed submission:
n=int(input())
ls=[0]*n
x=1
y=1
z=1
p=6
m=int(n**0.5)
for x in range(1,m+3):
  for y in range(1,x+1):
    for z in range(1,y+1):
      k=6
      if x==y or y==z:
        k=3
        if x==z:
          k=1
      j=x*x+y*y+z*z+x*y+y*z+x*z
      if j<=n:
        ls[j-1]+=k
      else:
        break
for i in ls:
  print(i)

Buggy submission (verdict: Runtime Error):
n=int(input())
ls=[0]*n
xyz=[1,1,1]
p=6
cnt=0
while p<=n:
  if x==y and x==z:
    ls[p-1]=1
  else:
    ls[p-1]=3
  xyz[cnt%3]+=1
  p=xyz[0]**2+xyz[1]**2+xyz[2]**2+xyz[0]*xyz[1]+xyz[1]*xyz[2]+xyz[0]*xyz[2]
for i in ls:
  print(i)
Problem p02615 (python)

Fixed submission:
n=int(input())
ls=list(map(int,input().split()))
ls.sort(reverse=True)
ans=ls[0]
pls=[ls.pop(0),ls.pop(0)]#入った人を突っ込む
cnt=0#plsの隣使いきりカウント
scnt=0#2人行けるからそこのカウント

for i in ls:
  pls.append(i)
  ans+=pls[cnt+1]
  if scnt==0:
    scnt=1
  else:
    scnt=0
    cnt+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ls=list(map(int,input().split()))
ls.sort(reserved=True)
ans=ls[0]
pls=[ls.pop(0),ls.pop(0)]#入った人を突っ込む
cnt=0#plsの隣使いきりカウント
scnt=0#2人行けるからそこのカウント

for i in ls:
  pls.append(i)
  ans+=pls[cnt+1]
  if scnt==0:
    scnt=1
  else:
    scnt=0
    cnt+=1
print(ans)
Problem p02664 (python)

Fixed submission:
s=input()
ll=list(s.split("?"))
l=[]
cnt=0
for i in range(len(s)):
  if s[i]=="?":
    c=""
    if i+1<len(s):
      if s[i+1]=="D":
        c="P"
    if i>0:
      if s[i-1]=="P":
        c="D"
    if c=="":
      c="D"
    l.append(ll[cnt])
    l.append(c)
    cnt+=1
l.append(ll[-1])
print("".join(l))

Buggy submission (verdict: Runtime Error):
s=input()
ll=list(input().split())
l=[]
cnt=0
for i in range(len(s)):
  if s[i]=="?":
    c=""
    if i+1<len(s):
      if s[i+1]=="D":
        c="P"
    if i>0:
      if s[i-1]=="P":
        c="D"
    if c=="":
      c="D"
    l.append(ll[cnt])
    l.append(c)
    cnt+=1
l.append(ll[-1])
print("".join(l))
Problem p02677 (python)

Fixed submission:
import math
j,f,h,m=map(int,input().split())
df=6*m
dh=m/2+30*h
d=0
if df>dh:
  d=df-dh
else:
  d=dh-df
l=(j**2+f**2-2*j*f*math.cos(math.radians(d)))**0.5
print(l)

Buggy submission (verdict: Runtime Error):
j,f,h,m=map(int,input().split())
df=6*m
dh=m/2+30*h
d=0
if df>dh:
  d=df-dh
else:
  d=dh-df
l=(j**2+f**2-2*j*f*math.cos(math.radians(d)))
print(l)
Problem p02683 (python)

Fixed submission:
import itertools
n,m,x=map(int,input().split())
l=[[0]]*n
ln=[0]*m
kan=0
for i in range(n):
  l[i]=list(map(int,input().split()))
  for j in range(m+1):
    if j==0:
      kan+=l[i][j]
    else:
      ln[j-1]+=l[i][j]
if sorted(ln)[0]<x:
  print(-1)
else:
  mkan=-1
  for i in range(n+1):
    itr=itertools.combinations(range(n),i)
    for comb in itr:
      kan=0
      ln=[0]*m
      for j in comb:
        kan+=l[int(j)][0]
        for ii in range(m):
          ln[ii]+=l[int(j)][ii+1]
      if sorted(ln)[0]>=x:
        if mkan==-1 or mkan>kan:
          mkan=kan
  print(mkan)

Buggy submission (verdict: Runtime Error):
import itertools
n,m,x=map(int,input().split())
l=[[0]]*n
ln=[0]*m
kan=0
for i in range(n):
  l[i]=list(map(int,input().split()))
  for j in range(m+1):
    if j==0:
      kan+=l[i][j]
    else:
      ln[j-1]+=l[i][j]
if sorted(ln)[0]<x:
  print(-1)
else:
  mkan=-1
  for i in range(n):
    itr=itertools.combinations(range(n),i)
    for comb in itr:
      kan=0
      ln=[0]*m
      for j in comb:
        kan+=l[int(j)][0]
        for ii in range(m):
          ln[ii]+=l[int(j)][ii+1]
      if sorted(ln)>=x:
        if mkan==-1 or mkan>kan:
          mkan=kan
  print(mkan)
Problem p02732 (python)

Fixed submission:
import collections

n=int(input())
As=list(map(int,input().split()))
ls=collections.Counter(As)
subd={}
an=ls.values()
ans=0
for k in an:
  ans+=k*(k-1)//2
sans=ans

for i in As:
  ans=sans+1-ls[i]
  print(ans)

Buggy submission (verdict: Runtime Error):
import collections

n=int(input())
As=list(map(int,input().split()))
ls=collections.Counter(As)
subd={}
an=ls.values()
for k in l:
  ans+=k*(k-1)//2
sans=ans

for i in As:
  ans=sans+1-ls[i]
  print(ans)
Problem p02760 (python)

Fixed submission:
l=[[]]*3
for k in range(3):
  l[k]=list(map(int,input().split()))
n=int(input())
ll=[[0]*3 for i in range(3)]
for k in range(n):
  i=int(input())
  for j in range(3):
    if i in l[j]:
      ll[j][l[j].index(i)]=1
a=0
if ll[0][0]==1:
  if ll[0][1]==1 and ll[0][2]==1:
    a=1
  if ll[1][1]==1 and ll[2][2]==1:
    a=1
  if ll[1][0]==1 and ll[2][0]==1:
    a=1
if ll[0][1]==1 and ll[1][1]==1 and ll[2][1]==1:
  a=1
if ll[0][2]==1:
  if ll[1][1]==1 and ll[2][0]==1:
    a=1
  if ll[1][2]==1 and ll[2][2]==1:
    a=1
if ll[1][0]==1:
  if ll[1][1]==1 and ll[1][2]==1:
    a=1
if ll[2][0]==1:
  if ll[2][1]==1 and ll[2][2]==1:
    a=1
if a==0:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
l=[[]]*3
for k in range(3):
  l[k]=list(map(int,input().split()))
n=int(input())
ll=[[0,0,0]]*3
for k in range(n):
  i=int(input())
  for j in range(3):
    if i in l[j]:
      ll[j][l.index(i)]=1
a=0
if ll[0][0]==1:
  if ll[0][1]==1 and ll[0][2]==1:
    print("Yes")
    a=1
  elif ll[1][1]==1 and ll[2][2]==1:
    print("Yes")
    a=1
  elif ll[1][0]==1 and ll[2][0]==1:
    print("Yes")
    a=1
elif ll[0][1]==1 and ll[1][1]==1 and ll[2][1]==1:
  print("Yes")
  a=1
elif ll[0][2]==1:
  if ll[1][1]==1 and ll[2][0]==1:
    print("Yes")
    a=1
  elif ll[1][2]==1 and ll[2][2]==1:
    print("Yes")
    a=1
elif ll[1][0]==1:
  if ll[1][1]==1 and ll[1][2]==1:
    print("Yes")
    a=1
elif ll[2][0]==1:
  if ll[2][1]==1 and ll[2][2]==1:
    print("Yes")
    a=1
if a==0:
  print("No")
Problem p02780 (python)

Fixed submission:
n,k=map(int,input().split())
i=list(map(int,input().split()))
l=[0]*(n-k)
for j in range(n-k):
  l[j]=i[j+k]-i[j]
place=0
plus=0
for j in range(n-k):
  plus=plus+l[j]
  if plus>0:
    place=j+1
    plus=0
a=0.0
for j in range(k):
  a+=float(i[j+place]+1)/2
print(a)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split()))
i=list(map(int,input().split()))
l=[0]*(n-k)
for j in range(n-k):
  l[j]=i[j+k]-i[j]
place=0
plus=0
for j in range(n-k):
  plus=plus+l[j]
  if plus>0:
    place=j+1
    plus=0
a=0
for j in range(k):
  a+=(i[j+place]+1)//2
print(a)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split()))
i=list(map(int,input().split()))
l=[0]*(n-k)
for j in range(n-k):
  l[j]=i[j+k]-i[j]
place=0
plus=0
for j in range(n-k):
  plus=plus+l(j)
  if plus>0:
    place=j+1
    plus=0
a=0
for j in range(k):
  a+=(i[j+place]+1)//2
print(a)
Problem p02806 (python)

Fixed submission:
n=int(input())
t=[""]*n
sec=[0]*n
for k in range(n):
  s=input().split()
  t[k]=s[0]
  sec[k]=int(s[1])
x=input()
p=t.index(x)
a=0
if p!=n:
  for l in range(p+1,n):
    a+=sec[l]
print(str(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
t=[]*n
sec=[]*n
for k in range(n):
  s=input().split()
  t[k]=s[0]
  sec[k]=int(s[1])
x=input()
p=t.index(x)
a=0
if p!=n:
  for l in range(p+1,n):
    a+=sec[l]
print(str(a))
Problem p02813 (python)

Fixed submission:
import itertools
n=int(input())
p=tuple(map(int,input().split()))
q=tuple(map(int,input().split()))

l=list(range(1,n+1))
ll=list(itertools.permutations(l,n))
pp=ll.index(p)
qq=ll.index(q)
a=pp-qq
if a<0:
  a=a*(-1)
print(str(a))

Buggy submission (verdict: Runtime Error):
import itertools
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))

l=list(range(1,n+1))
ll=itertools.permutations(l,n)
pp=ll.index(p)
qq=ll.index(q)
a=pp-qq
if a<0:
  a=a*(-1)
print(str(a))
Problem p02818 (python)

Fixed submission:
s=input().split()
i=int(s[0])
j=int(s[1])
k=int(s[2])
if k>=i:
  j=j-(k-i)
  i=0
  if j<0:
    j=0
else:
  i=i-k
print(str(i)+" "+str(j))

Buggy submission (verdict: Runtime Error):
s=input().split()
i=int(s[0])
j=int(s[1])
k=int(s[2])
if k>=i:
  i=0
  j=j-k+i
else:
  i=i-k
print(str(i)+" "str(j))