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

Fixed submission:
n,c,k=map(int,input().split())
t=[0]*n
for i in range(n):
    t[i]=int(input())
t.sort()
s=0
lt=0
ln=0

if c==1:
    print(n)
    exit()
for i in range(n):

    if i==0:
       lt=i
       ln+=1

    else:
        if t[i]-t[lt]>k:
            s+=1
            lt=i
            ln=0

        ln+=1
        if ln==c:
            s+=1
            lt=i+1
            ln=0

        #print(i, s, lt, ln)


    
if ln>0:
    s+=1

print(s)

Buggy submission (verdict: Runtime Error):
import math
n,c,k=map(int,input().split())
t=[0]*n
s=0
a=0
for i in range(n):
	t[i]=int(input())
    if i>0 and a>0:
      if t[i]-t[i-1]<=k:
        s+=(a+n)//c
        a=(a+n)%c
      else:
      	s+=math.ceil((a+n)/c)
        a=0
print(s)
Problem p02712 (python)

Fixed submission:
def main():
    N = int(input())
    sum = 0
    for i in range(N):
        i = i+1
        if i%3 == 0 or i%5 == 0 or i%15 == 0:
            continue
        else:
            sum = sum + i

    print(sum)




if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = input()
    sum = 0
    for i in range(N):
        i = i+1
        if i%3 ==0 or i%5 ==0 or i%15 ==0:
            continue
        else:
            sum = sum + i

    print(sum)




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

Fixed submission:
s = str(raw_input())
a = s[::2].count('0') + s[1::2].count('1')
b = s[::2].count('1') + s[1::2].count('0')
print(min(a, b))

Buggy submission (verdict: Runtime Error):
s = input()
a = s[::2].count('0') + s[1::2].count('1')
b = s[::2].count('1') + s[1::2].count('0')
print(min(a, b))

Buggy submission (verdict: Runtime Error):
s = input()
a = s[::2].count('0') + s[1::2].count('1')
b = s[::2].count('1') + s[1::2].count('0')
print(min(a, b))
Problem p02712 (python)

Fixed submission:
N = int(input())
list = []
 
for i in range(N):
  if (i+1) % 3 == 0:
    pass
  elif (i+1) % 5 == 0:
    pass
  else:
    list.append(i+1)
    
print(sum(list))

Buggy submission (verdict: Runtime Error):
N = int(input())
list = []

for i in range(N):
	if (i+1) % 3 == 0:
	
	elif (i+1) % 5 == 0:
	
	else:
		list.append(i+1)

print(sum(list))
Problem p02759 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# 割り算の商
a = N // 2
# 割り算のあまり
b = N % 2
# 余りが計算
if b == 0 :
  #出力
  print(a)
else:
  print(a + 1)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# 割り算の商
a = N // 2
# 割り算のあまり
b = N % 2
# 余りが計算
if b = 0 :
  #出力
  print(a)
else:
  print(a + 1)
Problem p02659 (python)

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

from decimal import Decimal

a = int(a)
b = Decimal(b)

print(int(a*b))

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

print(int(a*b))
Problem p02729 (python)

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

import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if n == 0:
    base1 = 0
elif n == 1:
    base1 = 0
else:
    base1 = comb(n,2)

if m == 0:
    base2 = 0
elif m == 1:
    base2 = 0
else:
    base2 = comb(m,2)

print(base1 + base2)

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

import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
if n <= 1 and m <= 1:
    print(0)
elif n == 1 and m <= 1:
    print(comb(m,2))
elif n <= 1 and m == 1:
    print(comb(n,2))
else:
    print(comb(n,2) + comb(m,2))

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
 
import math
 
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
if n == 1 and m == 1:
    print(0)
elif n == 1 and m != 1:
    print(comb(m,2))
elif n != 1 and m == 1:
    print(comb(n,2))
else:
    print(comb(n,2) + comb(m,2))

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

import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
if n == 1 and m == 1:
    print(0)
elif n == 1 and m != 1:
    print(comb(m,2))
elif n != 1 and m == 1:
    print(comb(n,2))
else:
    print(comb(n,2) + comb(m,2))
Problem p02759 (python)

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

mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)

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

mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)

Buggy submission (verdict: Runtime Error):
mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)

Buggy submission (verdict: Runtime Error):
mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
Problem p02771 (python)

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

if a == b:
    if b == c:
        print('No')
    else:
        print('Yes')
elif b == c:
    print('Yes')
elif c == a:
    print('Yes')
else:
    print('No')

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

f a == b:
    if b == c:
        print('No')
    else:
        print('Yes')
elif b == c:
    print('Yes')
elif c == a:
    print('Yes')
else:
    print('No')
Problem p02790 (python)

Fixed submission:
a,b = input().split()
 
a_ = a * int(b)
b_ = b * int(a)
 
moji = sorted([a_ ,b_])
 
print(moji[0])

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

a_ = a * int(a)
b_ = b * int(b)

moji = sorted([a_ ,b_])

print(mojj[0])
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())

if a*b ==2:
    print(3)
elif a*b ==3:
    print(2)
else:
    print(1)

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

if a*b ==2:
    print(3)
elif a*b ==3:
    print(2)
else:
    print(1)
Problem p02831 (python)

Fixed submission:
import fractions
A, B = map(int, input().split())
print(A*B//fractions.gcd(A, B))

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

import math
lcm = (a * b) / math.gcd(a, b)

lcm = int(lcm)

print(lcm)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
import math
lcm = a * b / math.gcd(a, b)

lcm = int(lcm)
print(lcm)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
import math
lcm = a * b / math.gcd(a, b)
print(int(lcm))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
 
import math
 
lcm = a * b / math.gcd(a, b)
 
print(int(lcm))

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

import math

lcm = a * b / math.gcd(a, b)

print(int(lcm))

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

if a < b:
    ttt = a
else:
    ttt = b
    
num_list = [1]
for i in range(2,ttt+1):
    mod_a = a % i
    mod_b = b % i
    if mod_a == 0 and mod_b == 0:
        c.append(i)

import numpy as np
if sum(c) == 1:
    print(a*b)
else:
    print(np.prod(np.array(c)))
Problem p03137 (python)

Fixed submission:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
import math
import string
import fractions
import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop

# from itertools import accumulate
# from collections import deque
import random




def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


def main():
    n,m = map(int, input().split())
    l = sorted(list(map(int, input().split())))
    
    l_diff = [(l[i+1] - l[i]) for i in range(len(l)-1)]
    # eprint(l)
    # eprint(l_diff)
    l_diff.sort()
    # eprint(l_diff)

    for i in range(min(n-1,len(l_diff))):
        l_diff.pop()
    print(sum(l_diff))
    # for i in range(0,n-1):
    #     sum += l[i+1] -l[i]

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
import math
import string
import fractions
import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop

# from itertools import accumulate
# from collections import deque
import random




def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


def main():
    n,m = map(int, input().split())
    l = sorted(list(map(int, input().split())))
    
    l_diff = [(l[i+1] - l[i]) for i in range(len(l)-1)]
    # eprint(l)
    # eprint(l_diff)
    l_diff.sort()
    # eprint(l_diff)

    for i in range(n-1):
        l_diff.pop()
    print(sum(l_diff))
    # for i in range(0,n-1):
    #     sum += l[i+1] -l[i]

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

Fixed submission:
n,m=map(int,input().split())
li = []
h=list(map(int,input().split()))
for i in range(m):
    a,b=map(int,input().split())
    if h[a-1]<h[b-1]:
        li.append(a)
    elif h[a-1]==h[b-1]:
        li.append(a)
        li.append(b)
    else:
        li.append(b)
print(n-len(set(li)))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
li = []
h=list(map(int,input().split()))
for i in range(m):
    a,b=map(int,input().split())
    if h[a-1]=<h[b-1]:
        li.append(a)
    else:
        li.append(b)
print(n-len(set(li)))
Problem p02571 (python)

Fixed submission:
S = input()
T = input()
c = 0
l = []
for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if (T[j] != S[i+j]):
            c += 1       
    l.append(c)
    c = 0
#print(l)
print(min(l))

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
c = 0
l = []
for i in range(len(S)-len(T)):
    for j in range(len(T)):
        if (T[j] != S[i+j]):
            c += 1       
    l.append(c)
    c = 0
print(min(l))
Problem p02623 (python)

Fixed submission:
n,m,k=map(int,input().split())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
acum1=[0]
for i in range(n): #累積和ai,bjを求める
 acum1.append(acum1[-1]+arr1[i])
acum2=[0]
for i in range(m):
 acum2.append(acum2[-1]+arr2[i])
ans=0
j=m
for i in range(n+1):
 if acum1[i]>k: #ai>Kであれば、どのようにjを選んでもai+bj<=Kとなることはないので探索を終了する
   break
 while acum2[j]>k-acum1[i] and j>0: #各iについて、bj<=K-aiを満たす最大のjを求める
   j-=1
 ans=max(ans,i+j)
print(ans)

Buggy submission (verdict: Runtime Error):

N, M, X = map(int, input().split())
C = []
A = []
for  i in range(N):
    t = list(map(int, input().split()))
    C.append(t[0])
    A.append(t[1:])
    
result = -1
"""
<< bit演算に関する演算子
左辺の値を右辺の値だけ左へシフトすることを意味する

https://www.javadrive.jp/python/num/index4.html

下記の場合、1からNまで2真数でシフトしていく感じ
"""

for i in range(1 << N):
    #初期化
    t = [0] * M
    c = 0
    #print(i)
    for j in range(N):
        #print(j)
        if(i >> j ) & 1 == 0 :
            continue
        c += C[j]
        for k in range(M):
            t[k] += A[j][k]
    if all(x >= X for x in t):
        if result == -1:
            result = c
        else:
            result = min(result, c)
print(result)

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

acum1=[0]

#それぞれの累積和(ai, bj)をもとめる
for i in range(n):
	acum1.append(acum[-1]+arr1[i])
    
acum2 = [0]

for i in range(m):
	acum2.append(acum2[-1]+arr2[i])

ans = 0
for i in range(n+1):
	if acum1[i] > k:
    	break
    while acum2[j]>k - acum1[i] and j>0:
    	j -= 1
        ans = max(ans, i+j)
print(ans)

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

acum1=[0]

#それぞれの累積和(ai, bj)をもとめる
for i in range(n):
	# accum[-1]で一番最後のリストの値を参照している
    # うしろからみている
	acum1.append(acum[-1]+arr1[i])
    
acum2 = [0]

for i in range(m):
	# accum[-1]で一番最後のリストの値を参照している
    # うしろからみている
	acum2.append(acum2[-1]+arr2[i])

ans = 0
for i in range(n+1):
	# ai > K ->どのようにjを選んでもai+bj<=Kとなることはない
    # 探索を終了する
	if acum1[i] > k:
    	break
    #各iについて、bj<=K-aiを満たす最大のjを求める
    #bj>K-aiの間、ループ。jを大きい方から順に調べていく
    #限界ギリギリを調べるのだから、後ろから調べた方がよいという感じかな
    while acum2[j]>k - acum1[i] and j>0:
    	j -= 1
        ans = max(ans, i+j)
print(ans)
Problem p02659 (python)

Fixed submission:
import decimal

a, b = input().split()
a = decimal.Decimal(a)
b = decimal.Decimal(b)
print(int(a*b))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
print(A * B)
Problem p02688 (python)

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

#お菓子を持っていない : 1
#お菓子を持っている   : 0
#持っていない人を最終的に導くから
S = [1] * N 

for i in range(K):
    d = int(input())
    t = map(int, input().split())
    for i in t:
        #i-1なのは添字と要素tが1ぶんずれているから
        S[i-1] = 0
print(sum(S))

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

S = [1] * N 

for i in range(K):
    d = int(input())
    t = map(int, input().split())
    for i in range(t):
        S[i-1] = 0
print(sum(S))

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

#お菓子を持っていない : 1
#お菓子を持っている   : 0
#持っていない人を最終的に導くから
S = [1] * N 

for i in range(K):
    d = int(input())
    t = map(int, input().split())
    for i in range(t):
        #i-1なのは添字と要素tが1ぶんずれているから
        S[i-1] = 1
print(sum(S))

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

#お菓子を持っていない : 1
#お菓子を持っている   : 0
#持っていない人を最終的に導くから
S = [1] * N 

for i in range(K):
    d = int(input())
    t = map(int, input().split())
    for i in range(t):
        #i-1なのは添字と要素tが1ぶんずれているから
        S[i-1] = 1
print(sum(S))
Problem p02693 (python)

Fixed submission:
import sys
K = int(input())
A, B = list(map(int, input().split()))
 
for i in range(A, B+1):
  if i%K == 0:
    print("OK")
    sys.exit( )
print("NG")

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

for i in range(A, B+1):
  if i％K == 0:
    print("OK")
    end
print("NG")
Problem p02695 (python)

Fixed submission:
from itertools import *
n, m, q = map(int, input().split())

aaa = []
for i in range(1, m+1):
    aaa.append(i)
l = []
for i in range(q):
    a = list(map(int, input().split()))
    l.append(a)
    
a = list(combinations_with_replacement(aaa, n))
ans = 0

for i in a:
    aa = 0
    for j in l:
        if i[j[1]-1] - i[j[0]-1] == j[2]:
            aa+=j[3]
        if aa > ans:
            ans = aa
print(ans)

Buggy submission (verdict: Runtime Error):
N, M, Q = map(int, input().split())
#下記の書き方応用できそうだ
arr = [list(map(int, input().split())) for _ in range(Q)]

ans = 0

"""
下記は問題の条件式をみて判断できる1<=M<=10
"""
for i1 in range(1, M+1):
    for i2 in range(i1, M+1):
        for i3 in range(i2, M+1):
            for i4 in range(i3, M+1):
                for i5 in range(i4, M+1):
                    for i6 in range(i5, M+1):
                        for i7 in range(i6, M+1):
                            for i8 in range(i7, M+1):
                                for i9 in range(i8, M+1):
                                    for i10 in range(i9, M+1):
                                        tmp = 0
                                        #添字の順番を合わせるために一つ目に0を代入している感じ。
                                        arrs = {0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10}
                                        for a, b, c, d in arr:
                                            if arrs[b] - arrs[a] == c:
                                                tmp += b
                                        ans = max(ans, tmp)
                            
print(ans)

Buggy submission (verdict: Runtime Error):
for i1 in range(1, M+1):
    for i2 in range(i1, M+1):
        for i3 in range(i2, M+1):
            for i4 in range(i3, M+1):
                for i5 in range(i4, M+1):
                    for i6 in range(i5, M+1):
                        for i7 in range(i6, M+1):
                            for i8 in range(i7, M+1):
                                for i9 in range(i8, M+1):
                                    for i10 in range(i9, M+1):
                                        tmp = 0
                                        #添字の順番を合わせるために一つ目に0を代入している感じ。
                                        arrs = {0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10}
                                        for a, b, c, d in arr:
                                            if arrs[b] - arrs[a] == c:
                                                tmp += b
                                        ans = max(ans, tmp)
                            
print(ans)

Buggy submission (verdict: Runtime Error):
N, M, Q = list(map(int, input().split()))
a = []
b = []
c = []
d = []
dd = 0
for i in range(Q):
    t = list(map(int, input().split()))
    a.append(t[0])
    b.append(t[1])
    c.append(t[2])
    d.append(t[3])
    if t[1] - t[0] == t[3]:
        dd += t[4]

print(dd)
Problem p02707 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
n = [0] * N
#A_2 A_3 ... A_N とA_1をのぞいて続くのでN-1となる
for i in range(N-1):
    n[A[i]-1] += 1

for j in range(N):
    print(n[j])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
n = [0] * N
for i in range(N):
    n[A[i]-1] += 1

for j in range(N):
    print(n[j])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
n = [0] * N
for i in range( N):
    n[A[i]-1] += 1

for j in range(N):
    print(n[j])
Problem p02773 (python)

Fixed submission:
n=int(input())
arr=[input() for _ in range(n)]
dic={}
for i in range(n): #各単語の出現回数を数える
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1
largest=max(dic.values()) #最大の出現回数を求める
ans=[]
for keys in dic.keys():
 if dic[keys]==largest: #出現回数が最も多い単語を集計する
   ans.append(keys)
ans=sorted(ans) #単語を辞書順に並べ替えて出力する
for words in ans:
 print(words)

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = {input() for _ in range(n)}
dic={}

#各単語の出現回数を数える
for i in range(n):
    if arr[i] not in dic:
        dic[arr[i]] = 1
    else:
        dic[arr[i]] += 1
#最大の出現回数を求める
largest = max(dic.values())
ans = []

for keys in dic.keys():
    if dic[keys] == largest:
        ans.append(keys)
#単語を辞書順に並べ替えて出力する
ans = sorted(ans)

for words in ans:
    print(words)

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = {input() for _ in range(n)}
dic={}

#各単語の出現回数を数える
for i in range(n):
    if arr[i] not in dic:
        dic[arr[i]] = 1
    else:
        dic[arr[i]] += 1
#最大の出現回数を求める
largest = max(dic.values())
ans = []

for keys in dic.keys():
    if dic[keys] == largest:
        ans.append(keys)
#単語を辞書順に並べ替えて出力する
ans = sorted(ans)

for words in ans:
    print(words)

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

ret = [letter for letter,count in S.most_common() if count == S.most_common()[0][1]]
print(ret)
Problem p02829 (python)

Fixed submission:
n1 = int(input())
n2 = int(input())
 
#print(n1)
#print(n2)
 
if n1 == 1:
  if n2 == 2:
    print("3")
  else:
    print("2")
elif n1 == 2:
  if n2 == 1:
    print("3")
  else:
    print("1")
elif n1 ==3:
  if n2 == 1:
    print("2")
  else:
    print("1")

Buggy submission (verdict: Runtime Error):
n1 = int(input())
n2 = int(input())
 
print(n1)
print(n2)
 
if n1 == 1:
  if n2 == 2:
    print("3")
  else:
    print("2")
else n1 == 2:
  if n2 == 1:
    print("3")
  else:
    print("1")
else n1 ==3:
  if n2 == 1:
    print("2"):
  else:
    print("1"):

Buggy submission (verdict: Runtime Error):
n1 = int(input())
n2 = int(input())
 
#print(n1)
#print(n2)
 
if n1 == 1:
  if n2 == 2:
    print("3")
  else:
    print("2")
else n1 == 2:
  if n2 == 1:
    print("3")
  else:
    print("1")
else n1 ==3:
  if n2 == 1:
    print("2")
  else:
    print("1")

Buggy submission (verdict: Runtime Error):
n1 = int(input())
n2 = int(input())

#print(n1)
#print(n2)

if n1 == 1:
  if n2 == 2:
    print("3")
  else:
    print("2")
else n1 == 2:
  if n2 == 1:
    print("3")
  else:
    print("1")
else n1 ==3:
  if n2 == 1:
    print("2"):
  else:
    print("1"):
Problem p02831 (python)

Fixed submission:
import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))

Buggy submission (verdict: Runtime Error):
import fractions

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

print(A * B // fractions.gcd(a, b))
Problem p02860 (python)

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

if(N%2 == 0):
  #Pythonでは、//で整数の商、%で余り（剰余、mod）が算出
  n = N//2
  #[:n] 0~n-1 [n:] n~最後まで
  if(S[:n] == S[n:]):
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

if(N%2 == 0):
  n = N/2
  if(S[0:(n/2-1)] == S[n/2:N]):
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

if(S.len()%2 == 0):
  n = (S.len())/2
  if(S[0:(n/2-1)] == S[n/2:n]):
    print("Yes")
  else:
    print("No")
else:
  print("No")
Problem p02879 (python)

Fixed submission:
A, B = map(int, input().split())
if(A>9 or B>9):
  print("-1")
elif(A>10 and B>10):
  print("-1")
else:
  ans=A*B
  print(ans)

Buggy submission (verdict: Runtime Error):
A, B = int(input())
if(A>9 or B>9):
  print("-1")
elif(A>10 and B>10):
  print("-1")
else:
  ans=A*B
  print(ans)

Buggy submission (verdict: Runtime Error):
A, B = int(input())
if(A>9 or B>9):
  print("-1")
else:
  print(A*B)
Problem p02880 (python)

Fixed submission:
N = int(input())
for i in range(1,10):
    for j in range(1,10):
        ij = i * j
        if(N == i*j):
            print("Yes")
            exit(0)
print("No")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if(A>9 or B>9):
  print("-1")
elif(A>10 and B>10):
  print("-1")
else:
  ans=A*B
  print(ans)
Problem p02916 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
c = 0

pre = 0
for i in range(N):
    now = A[i] - 1
    c += B[now]
    if i != 0 and pre == now - 1:
        c += C[pre]
    pre = now
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
c = 0

for i in range(A-2):
    c += B[i]
print(c+B[N-1]+C[N-2])
Problem p02623 (python)

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

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

aa = [0]
bb = [0]

for i in range(n):
    aa.append(a[i] + aa[i])

for i in range(m):
    bb.append(b[i] + bb[i])

ans = 0
mstart = m
for i in range(n+1):
    if k - aa[i] < 0:
        break
    for j in range(mstart,-1,-1):
        if k - aa[i] - bb[j] >= 0:
            mstart = j
            break
    if ans < i + j :
        ans = i + j 

print(ans)

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

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

cnt = 0
n_a = 0
n_b = 0

while True:
    if n_a < n and n_b < m:
        if a[n_a] < b[n_b]:
            k = k-a[n_a]
            if k >= 0:
                n_a = n_a + 1
                cnt = cnt + 1
            else:
                print(cnt)
                exit()
        else:
            k = k - b[n_b]
            if k >= 0:
                n_b = n_b + 1
                cnt = cnt + 1
            else:
                print(cnt)
                exit()
    elif n_a < n:
        k = k - a[n_b]
        if k >= 0:
            n_a = n_a + 1
            cnt = cnt + 1
        else:
            print(cnt)
            exit()
    elif n_b < m:
        k = k - b[n_b]
        if k >= 0:
            n_b = n_b + 1
            cnt = cnt + 1
        else:
            print(cnt)
            exit()
    else:
        print(cnt)
        exit()