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

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

c = [[0 for i in range(a[0]+1)] for j in range(a[0]+1)]

for i in range(a[1]):
    n,m = map(int,input().split())
    c[n][m] += 1

d = [[0 for i in range(a[0]+4)] for j in range(a[0]+4)]

for i in range(a[0]+1):
    for j in range(a[0]+1):
        d[i][j+1] = d[i][j] + c[i][j]

for i in range(a[2]):
    n,m = map(int,input().split())
    s = 0
    for j in range(n,m+1):
        s += d[j][m+1] - d[j][j]
    print(s)

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
 
p = [list(map(int, input().split())) for i in range(M)]
q = [list(map(int, input().split())) for i in range(Q)]
 
res = [[0]*N for i in range(N)]
 
def lsadd(L,R):
    L-=1
    R-=1
    for i in range(0,L+1):  
        res[i][R] += 1
 
for l,r in p:
    lsadd(l,r)
 
for l,r in q:
    print(sum(res[l-1][:r]))

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

k = [0 for i in range(a[0])] for j in range(a[0])

for i in range(a[1]):
    m,n = map(int,input().split())
    k[m-1][n-1] += 1

for i in range(a[2]):
    p = 0
    m,n = map(int,input().split())
    for j in range(m-1,n):
        for l in range(j,n):
            p += k[j][l]
    print(p)

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

k = [0 for i in range(a[0])] for j in range(a[0])

for i in range(a[1]):
    m,n = map(int,input().split())
    k[m][n] += 1

for i in range(a[2]):
    p = 0
    for j in range(m):
        for k in range(n):
            p += k[m][n]
    print(p)
Problem p03287 (python)

Fixed submission:
import sys,collections as cl
import collections
Max = sys.maxsize
def l():
	return list(map(int,input().split()))
def m():
	return map(int,input().split())
def s(x):
	a = []
	aa = x[i]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a

n,m = m()

a = l()

aa = [a[0]]
aaa = []
for i in range(n-1):
	aa.append(aa[-1]+a[i+1])

for i in range(n):
	aaa.append(aa[i]%m)

k = collections.Counter()

for i in aaa:
	k[i] += 1

ans = 0
for i in range(n):
	if aaa[i] != 0:
		ans += max(k[aaa[i]]-1,0)
		k[aaa[i]] = k[aaa[i]]-1
	else:
		ans += k[aaa[i]]
		k[aaa[i]] -= 1
print(ans)

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

c = list(map(int,input().split()))

su = 0
for i in range(len(c)):
	if i == 0:
		c[i] %= 0
	else:
		c[i] += c[i-1]
		c[i] %= b

for i in range(a):
	for j in range(a-i):
		d = sum(c[i:i+j])
		if d < 0:
			d += b+d
		if d % b == 0:
			su += 1

print(su)
Problem p03290 (python)

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

c = []

for i in range(a):
	c.append(list(map(int,input().split())))

ans = float('inf')

for i in range(1<<a):
	sc = 0
	co = 0
	for j in range(a):
		if i & (1<<j):
			sc += c[j][0]*(j+1)*100 + c[j][1]
			co += c[j][0]
	if sc >= b:
		ans = min(ans,co)
	else:
		for j in range(a)[::-1]:
			if i &(1<<j):
				continue
			else:
				for k in range(c[j][0]):
					sc += 100*(j+1)
					co += 1
					if sc >= b:
						break
				if sc >= b:
					break
		ans = min(ans,co)

print(ans)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
b = []
for i in range(a[0]):
	n,m = map(int,input().split())
	b.append([n,n*100*(i+1),m])
su = 10000
s = 0
sss = 0
ma = 0
m = 0
co = 0
c = 0
while a[1] > 0:
	for i in range(len(b)):
		if b[i][1] >= a[1]:
			ma = b[i][1]
			su = min(su,b[i][0] - (b[i][1] - a[1])//100//(i+1))
			co = i
		elif b[i][1]+b[i][2] >= a[1]:
			ma = b[i][1]+b[i][2]
			su = min(su,b[i][0])
			co = i
		m = max(m,b[i][1]+b[i][2])
		if m == b[i][1]+b[i][2]:
			s = b[i][0]
			c = i
	if ma != 0:
		sss += su
		break
	else:
		sss += s
		b.pop(c)
		a[1] -= m
	ma = 0
	su = 10000
print(sss)
Problem p03292 (python)

Fixed submission:
a = list(map(int,input().split()))
 
a.sort()

print(abs(a[0]-a[1])+abs(a[1]-a[2]))

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
b = [0]*a[0]
 
for i in range(a[1]):
	m,n = map(int,input().split())
 
	b[m-1] += 1
	b[n-1] -= 1
ma = b[0]
for i in range(1,a[0]):
	b[i] += b[i-1]
	if b[i] >= ma:
		ma = b[i]
		k = i
 
print(a[1] - ma+1)

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

k = max(abs(a[0]-a[1]),abs(a[1]-a[2]),abs(a[2]-a[1]))

print(abs(a[0]-a[1])+abs(a[1]-a[2])+abs(a[2]-a[0])-k
Problem p03302 (python)

Fixed submission:
a,b = map(int,input().split())
if (a+b) == 15:
  print("+")
elif (a*b) == 15:
  print("*")
else:
  print("x")

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

if (a+b) == 15:
  print("+")
elif (a*b)==15:
  print("*")
else:
  print("x")
Problem p03316 (python)

Fixed submission:
a = list(input())
su = 0
s = 0
k = 0
for i in a:
  s += int(i)
a.reverse()
for i in a:
  su += int(i)*pow(10,k)
  k += 1
  
if su % s == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = list(input())
su = 0
s = 0
k = 0
for i in a:
  s += int(i)
a.reverse()
for i in a:
  su += i*pow(10,k)
  k += 1
  
if su % s == 0:
  print("Yes")
else:
  print("No")
Problem p03342 (python)

Fixed submission:
import sys,collections as cl
Max = sys.maxsize
def l():
	return list(map(int,input().split()))
def m():
	return map(int,input().split())
def s(x):
	a = []
	aa = x[i]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a

n = int(input())

a = l()

ans = 0
l = 0
r = 0
su = 0
for i in range(n):
	while(r < n and (su^a[r]) == (su + a[r])):
		su += a[r]
		r += 1
	ans += r - i
	if r == i:
		r += 1
	else:
		su -= a[i]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys,collections as cl
Max = sys.maxsize
def l():
	return list(map(int,input().split()))
def m():
	return map(int,input().split())
def s(x):
	a = []
	aa = x[i]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a

n = int(input())

a = l()

ans = 0
l = 0
r = 0
su = 0
for i in range(N):
	while(r < N and (su^a[r]) == (su + a[r])):
		su += a[r]
		r += 1
	ans += r -i
	if r == i:
		r += 1
	else:
		su -= a[l]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(_) for _ in input().split()]
 
i = 0
j = 0
x = 0
 
result = 0
 
while i < N or j < N:
    while j < N and x & A[j] == 0:
        x |= A[j]
        j += 1
    result += j - i
    x &= ~A[i]
    i += 1
    
print(result)
N = int(input())
A = [int(_) for _ in input().split()]

i = 0
j = 0
x = 0

result = 0

while i < N or j < N:
    while j < N and x & A[j] == 0:
        x |= A[j]
        j += 1
    result += j - i
    x &= ~A[i]
    i += 1
    
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(_) for _ in input().split()]
 
i = 0
j = 0
x = 0
 
result = 0
 
while i < N or j < N:
    while j < N and x & A[j] == 0:
        x |= A[j]
        j += 1
    result += j - i
    x &= ~A[i]
    i += 1
    
print(result)
N = int(input())
A = [int(_) for _ in input().split()]

i = 0
j = 0
x = 0

result = 0

while i < N or j < N:
    while j < N and x & A[j] == 0:
        x |= A[j]
        j += 1
    result += j - i
    x &= ~A[i]
    i += 1
    
print(result)
提出情報
Problem p03351 (python)

Fixed submission:
a = list(map(int,input().split()))
if (abs(a[0]-a[2]) <= a[3]) or ((abs(a[0] - a[1]) <= a[3]) and (abs(a[1] -a[2]) <= a[3])):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min(6,k-i+1)):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min(5,k-i)):
    p.append(d[i:i+j+1])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])
Problem p03353 (python)

Fixed submission:
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min({6,k-i+1})):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

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

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

su = 0

co = 0

for i in range(max(a)):
    for j in range(n):
        if a[j] > 0 and co == 0:
            co += 1
            su += 1
        if co  >=  1:
            if a[j] == 0:
                co = 0
            else:
                a[j] -= 1
    co = 0

print(su)

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min({6,k-i})):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min({5,k-i+1})):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min(5,k-i)):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min(5,k-i+1)):
    p.append(d[i:i+j+1])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min(5,k-i+1)):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  if i <= k-6:
    for j in range(5):
      if i + j + 1 <= k-1:
        p.append(d[i:i+j+1])
  else:
    for j in range(k - i):
      p.append(d[i:i+j+1])
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(5):
    if i + j + 1 <= k-1:
      p.append(d[i:i+j+1])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])

Buggy submission (verdict: Runtime Error):
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(k-i):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]

print(x[a-1])
Problem p03362 (python)

Fixed submission:
import numpy as np
import sys,collections as cl
def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

Max = sys.maxsize
def l():
	return list(map(int,input().split()))
def m():
	return map(int,input().split())
def s(x):
	a = []
	aa = x[i]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a

n = int(input())

a = seachPrimeNum(55555)
aa = []
for i in range(len(a)):
	if a[i] % 5 == 1:
		aa.append(a[i])

print(" ".join(map(str,aa[:n])))

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys,collections as cl
def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

Max = sys.maxsize
def l():
	return list(map(int,input().split()))
def m():
	return map(int,input().split())
def s(x):
	a = []
	aa = x[i]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a

n = int(input())

a = seachPrimeNum(55555)
aa = []
for i in range(len(a)):
	if a[i] % 5 == 1:
		aa.append(a[i])

print(" ".join(aa[:n]))
Problem p03379 (python)

Fixed submission:
n = int(input())
aa = list(map(int,input().split()))
a = [[] for i in range(n)]
for i in range(n):
    a[i].append(aa[i])
    a[i].append(i)

a.sort()

mm = a[n//2-1][0]
m = a[n//2][0]
for i in range(n):
    a[i].append(i)
a.sort(key = lambda x:x[1])

for i in range(n):
    if a[i][2] <= n//2 -1:
        print(m) 
    else:
        print(mm)

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

a = list(map(int,input().split()))
for i in range(n):
    a[i].append(i)

a.sort()

n = a[n//2-1][0]
m = a[n//2][0]
for i in range(n):
    a[i].append(i)

a.sort(key = lambda x:x[1])

for i in range(n):
    if a[i][2] <= n//2 -1:
        print(m) 
    else:
        print(n)
Problem p03382 (python)

Fixed submission:
input()
da = list(map(int,input().split()))
 
x = max(da)
y = x + 1
for i in da:
  if i == x:
    continue
  if abs(x/2 - i ) <= abs(x/2 - y):
    y = i
print(x,y)

Buggy submission (verdict: Runtime Error):
input()
da = list(map(int,input().split()))
 
x = max(da)
y = x + 1
for i in da:
	if i == x:
  		continue
    if abs(x/2 - i ) <= abs(x/2 - y):
		y = i
print(x,y)

Buggy submission (verdict: Runtime Error):
input()
da = list(map(int,input().split()))
 
x = max(da)
y = x + 1
for i in x:
	if i == x:
  		continue
    if abs(x/2 - i ) <= abs(x/2 - y):
		y = i
print(x,y)

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

x = max(da)
y = x + 1
for i in x
	if i == x:
  		continue
    if abs(x/2 - i ) <= (x/2 - y):
		y = i
print(x,y)
Problem p03385 (python)

Fixed submission:
a = list(input())
if "a" in a and "b" in a and "c" in a:
	print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
d = list(input())

for i in range(3):
  if d[i] == "a":
    a = 1
  if d[i] == "b":
    b = 1
  if d[i] == "c":
    c = 1
    
    
if a*b*c == 1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
d = list(input().split())

for i in range(3):
  if d[i] == "a":
    a = 1
  if d[i] == "b":
    b = 1
  if d[i] == "c":
    c = 1
    
    
if a*b*c == 1:
  print("Yes")
else:
  print("No")
Problem p03408 (python)

Fixed submission:
import collections
l = collections.Counter()
n = int(input())
for i in range(n):
    k = input()
    l[k] += 1
n = int(input())
for i in range(n):
    k = input()
    l[k] -= 1
l = l.most_common()
print(l[0][1] if l[0][1] >= 0 else 0)

Buggy submission (verdict: Runtime Error):
import collections
l = collections.Counter()
n = int(input())
for i in range(n):
    k = input()
    l[k] += 1
n = int(input())
for i in range(n):
    k = input()
    l[k] -= 1
l = l.most_common()
print(l[1])
Problem p03415 (python)

Fixed submission:
l = [list(input()) for i in range(3)]
print(l[0][0]+l[1][1]+l[2][2])

Buggy submission (verdict: Runtime Error):
l = [list(input()) for range(3)]
print(l[0][0]+l[1][1]+l[2][2])
Problem p03419 (python)

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

if b[0] == 1 and b[1] == 1:
	print(1)
elif b[0] == 1:
	print(b[1]-2)
elif b[1] == 1:
	print(b[0] -2)

else:
	print(b[0]*b[1] - 2*(b[0] + b[1] - 2))

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

if b[0] == 1 and b[1] == 1:
	print(1)
elif b[0] == 1:
	print(b[1]-2)
elif b[1] == 1:
	print(b[0] -2)

else:
	print(b[0]*b[1] - 2(b[0] + b[1] - 2))
Problem p03427 (python)

Fixed submission:
N = input()
t = N[0]
if N == t + "9"*(len(N)-1):
  print(int(t)+9*(len(N)-1))
else:
  print(int(t)-1+9*(len(N)-1))

Buggy submission (verdict: Runtime Error):
N = input()
t = N[0]
if N == t + "9"(len(N)-1):
  print(int(t)+9*(len(N)-1))
else:
  print(int(t)-1+9*(len(N)-1))
Problem p03434 (python)

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

a.sort(reverse = True)

su = 0

for i in range(n):
    if i % 2 == 0:
        su += a[i]
    else:
        su -= a[i]
print(su)

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

a.sort(reverse = True)

su = 0

for i in range(n:
    if i % 2 == 0:
        su += a[i]
    else:
        su -= a[i]
print(su)
Problem p03457 (python)

Fixed submission:
import sys
n = int(input())
a = [list(map(int,input().split())) for i in range(n)]

h,j,k = 0,0,0

for i in range(n):
    t = abs(h - a[i][0])
    dx = abs(j - a[i][1])
    dy = abs(k - a[i][2])
    if t >= dx + dy:
        if t % 2 != (dx + dy) % 2:
            print("No")
            sys.exit()
    else:
        print("No")
        sys.exit()
    h = a[i][0]
    j = a[i][1]
    k = a[i][2]
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
a = [list(map(int,input().split()))]

h,j,k = 0,0,0

for i in range(n):
    t = abs(h - a[i][0])
    dx = abs(j - a[i][1])
    dy = abs(k - a[i][2])
    if t >= dx + dy:
        if t % 2 != (dx + dy % 2):
            print("No")
            sys.exit()
    else:
        print("No")
        sys.exit()

print("Yes")
Problem p03474 (python)

Fixed submission:
a,b = map(int,input().split())
n = input()
co = 0
if len(n) == a+b+1:
  for i in range(a+b+1):
    if n[i] == "-":
      if i != a:
        print("No")
        exit()
      else:
        co = 1
  if co == 1:
    print("Yes")
  else:
    print("No")
    
else:
  print("No")
  exit()

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
n = input()
co = 0
if len(n) == a+b+1:
  for i in range(a+b+1):
    if n[i] == "-":
      if i != a:
        print("No")
        exit()
      else:
        co = 1
  if co == 1:
    print("Yes")
  else:
    print("No")
    
else:
  print("No")
  exit()
Problem p03478 (python)

Fixed submission:
n,a,b = map(int,input().split())
su = 0
co = 0
for i in range(1,n+1):
  ii = list(map(int,list(str(i))))
  for j in range(len(ii)):
    co += ii[j]
  if co <= b and co >= a:
    su += i
  co = 0
print(su)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input())
su = 0
co = 0
for i in range(1,n+1):
  ii = list(map(int,list(str(i))))
  for j in range(len(ii)):
    co += ii[j]
  if co <= b and co >= a:
    su += 1
  co = 0
print(su)
Problem p03504 (python)

Fixed submission:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n,c = m()

time = [[0 for i in range(31)] for j in range(10**5+2)]

popopo = [[] for i in range(30)]

for i in range(n):
    s,t,c = m()
    popopo[c-1].append([s,t])


for i in range(30):
    popopo[i].sort()
    
for i in range(30):
    for j in range(len(popopo[i])):
        s,t = popopo[i][j]
        if time[s][i+1] == 0:
            time[t][i+1] = 1
            time[s-1][0] += 1
            time[t][0] -= 1
        else:
            time[t][i+1] = 1
            time[s][0] += 1
            time[t][0] -= 1

ma = time[0][0]
for i in range(1,10**5+2):
    time[i][0] += time[i-1][0]
    ma = max(ma,time[i][0])
print(ma)

Buggy submission (verdict: Runtime Error):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n,c = m()

time = [[0 for i in range(31)] for j in range(10**5+1)]

for i in range(n):
    s,t,c = m()
    if time[s-1][c] == 0:
        time[t][c] = 1
        time[s][0] += 1    
        time[t+1][0] -= 1

    else:
        time[t][c] = 1
        time[s][0] += 1
        time[t+1][0] -= 1

ma = time[0][0]
for i in range(1,10**5+1):
    time[i][0] += time[i-1][0]
    ma = max(ma,time[i][0])
print(ma)
Problem p03549 (python)

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

print((1900*m + 100*(n-m))*(2**m) )

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

print((1990*m + 100(n-m))*2**m )
Problem p03565 (python)

Fixed submission:
s = input()
t = input()

l = []

for i in range(len(s)-len(t) + 1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
            break
    if f:
        a = s[:i] + t + s[i+len(t):]
        l.append(a.replace('?','a'))
if len(l)>0:
    print(min(l))
else:
    print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())

l = []

for i in range(len(s)-len(t) + 1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
            break
    if f:
        a = s[:i] + t + s[i+len(t):]
        l.append(a.replace('?','a'))
if len(l)>0:
    print(min(l))
else:
    print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())

l = []

for i in range(len(s)-len(t) - 1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
            break
    if f:
        a = s[:i] + t + s[i+len(t):]
        l.append(a.replace('?','a'))
if len(l)>0:
    print(min(l))
else:
    print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())

l = []

for i in range(len(s)-len(t) - 1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
            break
    if f:
        a = s[i:] + t + s[:i+len(t)]
        l.append(a.replace('?','a'))
if len(l)>0:
    print(min(l))
else:
    print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())

l = []

for i in range(len(s)-len(t) - 1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
            break
    if f:
        a = s[:i] + t + s[:i+len(t)]
        l.append(a.replace('?','a'))
if len(l)>0:
    print(min(l))
else:
    print('UNRESTORABLE')
Problem p03607 (python)

Fixed submission:
import collections

n = int(input())

co = collections.Counter([int(input()) for i in range(n)])

c =0

for i in co.values():
    if i % 2 != 0:
        c  +=1
print(c)

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())

co = collectiosn.Counter([int(input()) for i in range(n)])

c =0

for i in co.values():
    if i % 2 != 0:
        c  +=1
print(c)