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

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
g = a[0]
for i in range(1, n):
    g = gcd(g, a[i])
print(g)

Buggy submission (verdict: Runtime Error):
from math import gcd
n = int(input())
a = list(map(int, input().split()))
g = a[0]
for i in range(1, n):
    g = gcd(g, a[i])
print(g)
Problem p03272 (python)

Fixed submission:
n, i = map(int, input().split())
print(n - i + 1)

Buggy submission (verdict: Runtime Error):
n, i = map(int, input())
print(n - i + 1)
Problem p02707 (python)

Fixed submission:
size = int(input())
li = list(map(int,input().split()))
from collections import Counter
c1 = Counter(li)
ans2 = [0] * size
for i,j in c1.items():
    ans2[i-1] = j
for i in ans2:
    print(i)

Buggy submission (verdict: Runtime Error):
from sys import stdin,stdout
size = int(stdin.readline())
li = list(map(int,stdin.readline().split()))
"""ans = [0]*size
for i in li:
    if i not in ans:
        ans[i-1] = 1
    else:
        ans[i-1] += 1
for i in ans:
    print(i)
"""
from collections import Counter
c1 = Counter(li)
ans2 = [0] * size
for i,j in c1.items():
    ans2[i-1] = j
for i in ans2:
    stdout.write(i)
Problem p02831 (python)

Fixed submission:
def gcd(a,b): 
    if a == 0: 
        return b 
    return gcd(b % a, a) 

def lcm(a,b): 
    return (a*b) / gcd(a,b) 
a,b = list(map(int,input().split()))
print(int(lcm(a,b)))

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

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

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

Buggy submission (verdict: Runtime Error):
from fractions import gcd
def lcm(a, b):
    return abs(a*b) // math.gcd(a, b)
a,b = list(map(int,input().split()))
print(lcm(a,b))
Problem p02860 (python)

Fixed submission:
size = int(input())
a = input()
if a[0:size//2] == a[size//2:]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
from collections import Counter
a = input()
c1 = Counter(a)
flag = False
for i,j in c1.items():
  if(len(set(j))==1:
     flag=True
  else:
     flag= False
if(flag):
     print('Yes')
else:
     print('No')
Problem p02881 (python)

Fixed submission:
n = int(input())
ans = []
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        ans.append(i-1+((n//i)-1))
print(min(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = []
for i in range(1,int(n**0.5)):
    if n%i==0:
        ans.append(i-1+((n//i)-1))
print(min(ans))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans = []
for i in range(1,int(math.sqrt(n))):
    if n%i==0:
        ans.append(i-1+((n//i)-1))
print(min(ans))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans = []
for i in range(1,int(math.sqrt(n))):
    if n%i==0:
        ans.append(i-1+((n//i)-1))
print(min(ans))
Problem p02623 (python)

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

a_sum = [0]
b_sum = [0]
for i in range(1, n+1):
  a_sum.append(a_sum[i-1] + an[i-1])
for j in range(1, m+1):
  b_sum.append(b_sum[j-1] + bn[j-1])

idx = len(bn)
ans = 0
for i in range(n+1):
  while a_sum[i] + b_sum[idx] > k:
    idx -= 1
    if idx == -1:
      break
  if idx == -1:
    break
  ans = max(ans, i + idx)

print(ans)

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

a_sum = [0]
b_sum = [0]
for i in range(1, n+1):
  a_sum.append(a_sum[i-1] + an[i-1])
for j in range(1, m+1):
  b_sum.append(b_sum[j-1] + bn[j-1])

ans = len(bn)
idx = len(bn)
for j in range(m+1):
  if k - b_sum[j] < 0:
    ans = j - 1
    idx = j - 1
    break
for i in range(1, n+1):
  if a_sum[i] + b_sum[idx] > k:
    idx -= 1
  else:
    ans += 1

print(ans)
Problem p02723 (python)

Fixed submission:
s = input()
if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
pn = list(map(int, input().split()))
qn = list(map(int, input().split()))
rn = list(map(int, input().split()))

pn.sort(reverse=True)
qn.sort(reverse=True)

pqr = pn[:x] + qn[:y] + rn
pqr.sort(reverse=True)
  
print(sum(pqr[:x+y]))
Problem p02759 (python)

Fixed submission:
n = int(input())

if n%2 == 0:
  print(int(n/2))
else:
  print(int((n+1)/2))

Buggy submission (verdict: Runtime Error):
import queue
q = queue.Queue()

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

friend = [[] for _ in range(n)]
for _ in range(m):
    a, b = map(int, input().split())
    friend[a-1].append(b-1)
    friend[b-1].append(a-1)

block = [[] for _ in range(n)]
for _ in range(k):
    c, d = map(int, input().split())
    block[c-1].append(d-1)
    block[d-1].append(c-1)
    
#print(friend)
#print(block)
c_list = []
for i in range(n):
    counter = 0
    seen = [i]
    for j in friend[i]:
        q.put(j)
        seen.append(j)
    while q.qsize() != 0:
        x = q.get()
        for k in friend[x]:
            if not k in seen and not k in block[i]:
                q.put(k)
                seen.append(k)
                counter += 1
    c_list.append(counter)
    
print(c_list)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
  
answer = [-1]*n

for i in range(m):
  s, c = map(int, input().split())
  if s == 1 and c == 0:
    if n == 1:
      print(0)
      exit()
    else:
      print(-1)
  if answer[s-1] == -1 or answer[s-1] == c:
    answer[s-1] = c
  else:
    print(-1)
    exit()

if answer[0] == -1:
  if n == 1:
    print(0)
    exit()
  else:
    answer[0] = 1
for j in range(n):
  if answer[j] == -1:
    answer[j] = 0
    
answer = [str(x) for x in answer] 

print(int(''.join(answer)))
Problem p02773 (python)

Fixed submission:
n = int(input())
s_dict = {}

for _ in range(n):
  s = input()
  if s_dict.get(s, -1) == -1:
    s_dict[s] = 1
  else:
    s_dict[s] += 1

if len(s_dict) == 1:
  print(list(s_dict.keys())[0])
  exit()
  
s_dict2 = sorted(s_dict.items(), key=lambda x:x[1], reverse=True)
s_list = []
i = 0

while s_dict2[i][1] == s_dict2[0][1]:
  s_list.append(s_dict2[i][0])
  i += 1
  if i == len(s_dict2):
    break

s_list.sort()
for i in range(len(s_list)):
  print(s_list[i])

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

for _ in range(n):
  s = input()
  if s_dict.get(s, -1) == -1:
    s_dict[s] = 1
  else:
    s_dict[s] += 1

if len(s_dict) == 1:
  print(s_dict.keys())
  exit()
  
s_dict2 = sorted(s_dict.items(), key=lambda x:x[1], reverse=True)
s_list = [s_dict2[0][0]]
i = 0
while s_dict2[i][1] == s_dict2[i+1][1]:
  s_list.append(s_dict2[i+1][0])
  i += 1
  
s_list.sort()
for i in range(len(s_list)):
  print(s_list[i])
Problem p03013 (python)

Fixed submission:
n, m = map(int, input().split())
an = [int(input()) for _ in range(m)]

dp = [0 for _ in range(n+1)]
dp[0] = 1
mod = 10**9 + 7

if m == 0:
    dp[0] = 1
    dp[1] = 1
    for i in range(2, n+1):
        dp[i] = (dp[i-1] + dp[i-2]) % mod
    print(dp[n])
    exit()

if an[0] == 1:
    dp[1] = 0
    a = 1
    if len(an) == 1:
        a = 0
else:
    dp[1] = 1
    a = 0

for i in range(2, n+1):
    if i == an[a]:
        dp[i] = 0
        a += 1
        if a == len(an):
            a -= 1
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod

print(dp[n])

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

dp = [0 for _ in range(n+1)]
dp[0] = 1
mod = 10**9 + 7

if m == 0:
    dp[0] = 1
    dp[1] = 1
    for i in range(2, n+1):
        dp[i] = (dp[i-1] + dp[i-2]) % mod
    print(dp[n])
    exit()

if an[0] == 1:
    dp[1] = 0
    a = 1
else:
    dp[1] = 1
    a = 0

if n >= 2:
    for i in range(2, n+1):
        if i == an[a]:
            dp[i] = 0
            a += 1
            if a == len(an):
                a -= 1
        else:
            dp[i] = (dp[i-1] + dp[i-2]) % mod

print(dp[n])

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

dp = [0 for _ in range(n+1)]
dp[0] = 1
mod = 10**9 + 7

if m == 0:
    dp[0] = 1
    dp[1] = 1
    for i in range(2, n+1):
        dp[i] = (dp[i-1] + dp[i-2]) % mod
    print(dp[n])
    exit()

if an[0] == 1:
    dp[1] = 0
    a = 1
else:
    dp[1] = 1
    a = 0

for i in range(2, n+1):
    if i == an[a]:
        dp[i] = 0
        a += 1
        if a == len(an):
            a -= 1
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod

print(dp[n])

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

dp = [0 for _ in range(n+1)]
dp[0] = 1
mod = 10**9 + 7

if an[0] == 1:
    dp[1] = 0
    a = 1
else:
    dp[1] = 1
    a = 0

for i in range(2, n+1):
    if i == an[a]:
        dp[i] = 0
        a += 1
        if a == len(an):
            a -= 1
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod

print(dp[n])
Problem p03315 (python)

Fixed submission:
S = input()
res = 0
for i in range(4):
    if S[i] == '+':
        res += 1
    else:
        res -= 1
print(res)

Buggy submission (verdict: Runtime Error):
N = input()
numN = int(N)
S =0
for i in range(len(N)):
    S += int(N[i])

if nunN % S == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input()
res = 0
for i in range(4):
    if S[i] == ‘+’:
        res += 1
    else:
        res -= 1
print(res)
Problem p02753 (python)

Fixed submission:
s = input()

if s == 'AAA' or s == 'BBB':
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
s=input()
if s=='AAA' or s=='BBB':
  print("No")
else:
print("Yes")
Problem p02897 (python)

Fixed submission:
n = int(input())
cnt = 0
if n % 2 == 0:
    cnt = n // 2
else:
    cnt = n // 2 + 1
print(cnt / n)

Buggy submission (verdict: Runtime Error):
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)


def prime_factorize(n):
    p = []
    while n % 2 == 0:
        if 2 not in p:
            p.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            if f not in p:
                p.append(f)
                n //= f
        else:
            f += 2
    if n != 1 and n not in p:
        p.append(n)
    return p


a, b = map(int, input().split())
q = prime_factorize(gcd(a, b))
# print(q)
print(len(q) + 1)
Problem p02990 (python)

Fixed submission:
import math

n, k = map(int, input().split())


def combinations_count(N, R):
    return math.factorial(N) // (math.factorial(N - R) * math.factorial(R))


for i in range(1, k + 1):
    # 注意！もし青玉の置く場所がiより少なかったら置くことができないので、0通り
    if n - k + 1 < i:
        print(0)
    else:
        answer = combinations_count(k - 1, i - 1) * combinations_count(n - k + 1, i)
        # print(combinations_count(i - 1 + k, i - 1), combinations_count(n - k + 1, i))
        print(answer % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
import math

n, k = map(int, input().split())


def combinations_count(N, R):
    return math.factorial(N) // (math.factorial(N - R) * math.factorial(R))


for i in range(1, k + 1):
    answer = combinations_count(k - 1, i - 1) * combinations_count(n - k + 1, i)
    # print(combinations_count(i - 1 + k, i - 1), combinations_count(n - k + 1, i))
    print(answer % (10 ** 9 + 7))

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


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


for i in range(1, k + 1):
    answer = combinations_count(k - 1, i - 1) * combinations_count(n - k + 1, i)
    # print(combinations_count(i - 1 + k, i - 1), combinations_count(n - k + 1, i))
    print(answer % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
import math

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

n, k = map(int, input().split())

for i in range(1, k + 1):
    answer = combinations_count(k-1, i - 1) * combinations_count(n - k + 1, i)
    # print(combinations_count(i - 1 + k, i - 1), combinations_count(n - k + 1, i))
    print(answer % (10 ** 9 + 7))
Problem p03012 (python)

Fixed submission:
n = int(input())
w = [int(i) for i in input().split()]
p = 100000
a = sum(w)
k = 0
for i in range(n - 1):
    k += w[i]
    p = min(p, abs(k - (a - k)))
print(p)

Buggy submission (verdict: Runtime Error):
n = int(input())
w = list(map(int, input().split()))
wa = 0
for i in range(len(w)):
    wa += w[i]
wa2 = 0
wa3 = 0
i = 0
while wa2 <= wa / 2:
    wa2 += w[i]
    i += 1
for j in range(i, len(w)+1):
    wa3 += w[j]
print(abs(wa2 - wa3))
exit()
Problem p03803 (python)

Fixed submission:
a,b=map(int,input().split())
J=0
if (a==1 and b!=1):
    J=1
elif (b==1 and a!=1):
    J=2
elif a<b:
    J=2
elif a>b:
    J=1
print("Alice" if J==1 else "Bob" if J==2 else "Draw")

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

ok=False
cf=[]
for i in range(n-m+1):
    for j in range(n-m+1):
        for l in range(m):
            cf.append(a[i+l][j:j+m])
            #print(cf)
    if cf==b:
        ok=True
    cf=[]
print("Yes"if ok else "No")
Problem p02860 (python)

Fixed submission:
n=int(input())
s=input()
if n%2==0:
    k=int(n/2)
    s_1=s[0:k]
    s_2=s[k:n]
    if s_1==s_2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
if n%2==0:
  s_1=s[0:n/2]
  s_2=s[n/2:n]
  if s_1==s_2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
if n%2==0:
  s_1=s[0:n/2]
  s_2=s[n/2:n]
  if s_1==s_2:
    print("Yes")
else:
  print("No")
Problem p02935 (python)

Fixed submission:
def  makabe(nam, co):
  ky=(nam+co)/2.0
  return ky



n=int(input())
g=list(map(int,input().split()))
g.sort()
ty=(g[0]+g[1])/2.0
for h in range(2,n):
  ty= makabe(ty,g[h])
  
print(ty)

Buggy submission (verdict: Runtime Error):
def  makabe((float)num, (float)ko):
  ky=(num+ko)/2
  return ky



n=int(input())
g=list(map(float,input().split()))
g.sort()
ty=(g[0]+g[1])/2
for h in range(2,n):
  ty= makabe(ty,g[h])
  
print(ty)
Problem p02970 (python)

Fixed submission:
n, d=input().split()
ni=int(n)
di=int(d)
cnt=1
while True:
  if (2*di+1)*cnt>=ni:
    print(cnt)
    break
  
  cnt+=1

Buggy submission (verdict: Runtime Error):
n, d=int(input().split())
cnt=1
while True:
  if (2*d+1)*cnt>=n:
    print(cnt)
    break
  
  cnt+=1
Problem p03012 (python)

Fixed submission:
n=int(input())
w=list(map(int, input().split()))
a=[]
for t in range(n):
    s1=sum(w[0:t+1])
    s2=sum(w[t+1:n])
    a.append(abs(s1-s2))
 
print(min(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
w=list(map(int, input().split()))
a[n]={}
for t in range(n):
  s1=sum(w[0:t+1])
  s2=sum(w[t+1:n])
  a[t]=abs(s1-s2)

print(min(a))
Problem p03242 (python)

Fixed submission:
s=input()
t=s.replace("9","2")
u=t.replace("1","3")
v=u.replace("2","1")
w=v.replace("3","9")

print(w)

Buggy submission (verdict: Runtime Error):
s=input()
for i in range(len(s)):
  if s[i]=="1":
    s[i]="9"
  elif s[i]=="9":
    s[i]="1"

print(s)
Problem p02773 (python)

Fixed submission:
n = int(input())
L = sorted(input() for _ in range(n))
s = sorted(set(L))
c = [0] * len(s)
prev = L[0]
cnt = 1
l = 0
for i in range(1, len(L)):
    if L[i] == prev:
        cnt += 1
    else:
        c[l] = cnt
        l += 1
        cnt = 1
        prev = L[i]
c[-1] = cnt
m = max(c)
for j in range(len(c)):
    if c[j] == m:
        print(s[j])

Buggy submission (verdict: Runtime Error):
n = int(input())
L = sorted(input() for _ in range(n))
s = sorted(set(L))
c = [0] * len(s)
prev = 0
cnt = 1
l = 0
for i in range(len(L)):
    if L[i] == prev:
        cnt += 1
    else:
        c[l] = cnt
        l += 1
        cnt = 1
m = max(c)
for j in range(len(c)):
    if c[j] == m:
        print(s[j])
Problem p03724 (python)

Fixed submission:
n, m = map(int, input().split())
d = {i: 0 for i in range(1, n+1)}
for _ in range(m):
    a, b = map(int, input().split())
    d[a] += 1
    d[b] += 1
for k, v in d.items():
    if v % 2:
        print('NO')
        break
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
d = {i: 0 for i in range(1, n+1)}
for _ in range(n):
    a, b = map(int, input().split())
    d[a] += 1
    d[b] += 1
for k, v in d.items():
    if v % 2:
        print('NO')
        break
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
d = {i: 0 for i in range(1, n)}
for _ in range(n):
    a, b = map(int, input().split())
    d[a] += 1
    d[b] += 1
for k, v in d.items():
    if v % 2:
        print('NO')
        break
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
d = {i: 0 for i in range(1, n)}
for _ in range(n):
    a, b = map(int, input().split())
    if a != 1:
        d[a] = 1 if a not in d else d[a] + 1
    if b != 1:
        d[b] = 1 if b not in d else d[b] + 1
for k, v in d.items():
    if v % 2:
        print('NO')
        break
else:
    print('YES')
Problem p03745 (python)

Fixed submission:
n = int(input())
L = list(map(int, input().split()))
cnt = 1
state = None
i = 1
while i < n:
    if state is None:
        if L[i] > L[i - 1]:
            state = 'up'
        elif L[i] < L[i - 1]:
            state = 'down'
        i += 1
    else:
        if state == 'up':
            while L[i] >= L[i - 1]:
                i += 1
                if i >= n - 1:
                    print(cnt)
                    exit()
            cnt += 1
            i += 1
            state = None
        else:
            while L[i] <= L[i - 1]:
                i += 1
                if i >= n - 1:
                    print(cnt)
                    exit()
            cnt += 1
            i += 1
            state = None
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
L = list(map(int, input().split()))
cnt = 1
state = None
i = 1
while i < n:
    if state is None:
        if L[i] > L[i - 1]:
            state = 'up'
        elif L[i] < L[i - 1]:
            state = 'down'
        i += 1
    else:
        if state == 'up':
            while L[i] >= L[i - 1]:
                i += 1
                if i == n - 1:
                    print(cnt)
                    exit()
            cnt += 1
            i += 1
            state = None
        else:
            while L[i] <= L[i - 1]:
                i += 1
                if i == n - 1:
                    print(cnt)
                    exit()
            cnt += 1
            i += 1
            state = None
print(cnt)
Problem p03775 (python)

Fixed submission:
n = int(input())
ans = float('inf')
for a in range(1, int(n ** 0.5) + 1):
    if n / a % 1 == 0:
        b = n // a
        ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)

Buggy submission (verdict: Runtime Error):
def pfact(n):
    d = {}
    while n % 2 == 0:
        d[2] = 1 if 2 not in d else d[2] + 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            d[f] = 1 if f not in d else d[f] + 1
            n //= f
        else:
            f += 2
    if n != 1:
        d[n] = 1 if n not in d else d[n] + 1
    return d

n = int(input())
d = pfact(n)
L = sorted(d, reverse=True)
a = L[0]
d[L[0]] -= 1
b = 1
for k in L:
    while d[k] > 0:
        if b > a:
            a, b = b, a
        b *= k
        d[k] -= 1
print(max(len(str(a)), len(str(b))))
Problem p02693 (python)

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

if(B//K-(A-1)//K>0):
  print("OK")
else:
  print("NG")

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

N=int(input())
a=list(map(int,input().split()))
u=[]
v=[]
road=[[] for i in range(N)]
for i in range(N-1):
  u1,v1=map(int,input().split())
  road[u1-1].append(v1-1)
  road[v1-1].append(u1-1)
  
#幅優先探索BFSか
ans=[0]*N
houmon=[0]*N
s=deque([])
s.append(0)
dp=[[] for i in range(N)]
dp[0].append(a[0])
while(s):
  v=s.popleft()
  for x in road[v]:#vから行ける場所x
    if(houmon[x]==0):
      dp[x].extend(dp[v])
      s.append(x)
      dp[x].append(a[x])
  houmon[v]=1
  #print(dp)
for i in range(N):
  seq=dp[i]
  #print(seq)
  LIS = [seq[0]]
  for i in range(len(seq)):
    if seq[i] > LIS[-1]:
      LIS.append(seq[i])
    else:
      LIS[bisect.bisect_left(LIS, seq[i])] = seq[i]
  print(len(LIS))
Problem p02711 (python)

Fixed submission:
N=input()
for i in range(len(N)):
  if(N[i]=="7"):
    print("Yes")
    exit()
print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
r=S.count("R")
g=S.count("G")
b=S.count("B")
ans=r*g*b
for i in range(N):
  x=S[i]
  for j in range(i+1,N):
    if(S[j]!=x):
      y=S[j]
      if(2*j-i>=0 and 2*j-i<N):
        if(S[2*j-i]!=x and S[2*j-i]!=y):
          ans-=1
print(ans)
Problem p02723 (python)

Fixed submission:
s=input()

if(s[2]==s[3]and s[4]==s[5]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))

p.sort()
q.sort()
p.reverse()
q.reverse()

a=p[:]
a.extend(q)
a.extend(r)
a.sort()
a.reverse()
b=q[:]
b.extend(r)
b.sort()
b.reverse()
c=p[:]
c.extend(r)
c.sort()
c.reverse()
red=0
green=0
sum=0
sum1=0
sum2=0
d=0
for i in range((X+Y)*2):
  if(a[i] in p):
    red+=1
  elif(a[i] in q):
    green+=1
  d+=a[i]
  if(red>X and i-X-Y+1+green==Y):
    break
  if(i<X):
      sum1+=p[i]
      sum2+=c[i]
  if(i<Y):
      sum1+=b[i]
      sum2+=q[i]
  if(i==X+Y and red<=X and green<=Y):
    print(sum)
    break
  if(red>X and i-X-Y+1+green==Y):
    print(sum1)
    break
  elif(green>Y and i-X-Y+1+red==X):
    print(sum2)
    break
Problem p02726 (python)

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

k=[0]*(N-1)
for i in range(N):
  for j in range(i+1,N):
    k[min(j-i,abs(j+1-Y)+1+abs(i+1-X))-1]+=1
    
for i in range(N-1):
  print(k[i])

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p.sort()
q.sort()
p.reverse()
q.reverse()
p=p[:X]
q=q[:Y]
r=r[:max(X,Y)]
 
a=p[:]
a.extend(q)
a.extend(r)
a.sort()
a.reverse()
b=q[:]
b.extend(r)
b.sort()
b.reverse()
c=p[:]
c.extend(r)
c.sort()
c.reverse()
red=0
green=0
sum=0
sum1=0
sum2=0
d=0
for i in range(X+Y):
  if(a[i] in p):
    red+=1
  elif(a[i] in q):
    green+=1
  d+=a[i]
 
  if(i<X):
      sum1+=p[i]
      sum2+=c[i]
  if(i<Y):
      sum1+=b[i]
      sum2+=q[i]
    
if(red<=X and green<=Y):
  print(d)
elif(red>X):
  print(sum1)
elif(green>Y):
  print(sum2)
Problem p02729 (python)

Fixed submission:
n,m=map(int,input().split())
 
print(n*(n-1)//2+m*(m-1)//2)

Buggy submission (verdict: Runtime Error):
L=int(input())
print((L/3)**3)

Buggy submission (verdict: Runtime Error):
L=int(input())
print((L/3)**3)

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

flag=True

for i in range(n):
  if(s[i]!=s[n-1-i]):
    flag=False

for i in range((n-1)/2):
  if(s[i]!=s[(n-1)/2-1-i]):
    flag=False
  if(s[(n-1)/2+1+i]!=s[n-1-i]):
    flag=False
    
if(flag):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
 
print(n(n-1)/2+m(m-1)/2)

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

print(n(n-1)/2+m(m-1)/2)

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

print(n+m)