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

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

N, K = map(int, input().split())
A = list(map(int, input().split()))
"""
N, K = map(int, input().split())
A = [int(x) for x in input().split()]
max_A = max(A)
bit = bin(K)
if max_A > K:
    bit = bin(max_A)"""
max_f = 0
#for d in range(1,len(bit))[::-1]:
for d in range(41,-2,-1):
    #d=d-2
    if (d != -1 and not (K & 1 << d)):
        continue
    f=0
    #for e in range(2,len(bit))[::-1]:
    for e in range(41,-1,-1):
        #e=e-2
        mask = 1<<e
        num=0
        for a in A:
            if a&mask:
                num+=1
        n_num = N - num
        if e>d:
            if K&mask:
                f += mask*n_num
            else:
                f += mask*num
        elif e==d:
            f += mask*num
        else:
            f += mask*max(n_num,num)
    max_f = max(f,max_f)
print(max_f)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
A = [int(x) for x in input().split()]
bit_K = bin(K)
max_f = 0
for index in range(41,-2,-1):#range(1,len(bit_K))[::-1]:
   #d-bit目まではKと同じ
   #XがKより大きくならないように、上位ビットをKに合わせる。
    d=index-2
    if (d != -1 and not (K & 1 << d)):
        continue
    f=0
    for e in range(41,-1,-1):#range(2,len(bit_K))[::-1]:
        e=e-2
        mask = 1<<e
        num=0
        for a in A:#e-bit目が立っているA[i]を数える
            if a&mask:
                num+=1
        n_num = N - num
        #A[i]のe-bit目が立っていれば、XORの計算上0になるので、e-bit目が立っていないA[i]が加算
        if e>d:#dビット目より上はKに合わせる
            #以下、e-bit目だけ計算したf(x)
            if K&mask:
                f += mask*n_num
            else:
                f += mask*num
        elif e==d:
            f += mask*num
        else:#どうせ後から計算するからなんでもよい？
            f += mask*max(n_num,num)
    max_f = max(f,max_f)
print(max_f)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,K = map(int, input().split())
A = [int(input(a)) for a in input().split()]
bit_K = bin(K)
max_f = 0
for index in range(2,len(bit_K))[::-1]:
    #d-bit目まではKと同じ
    #XがKより大きくならないように、上位ビットをKに合わせる。
    d=index-2
    f=0
    for e in range(2,len(bit_K))[::-1]:
        e=e-2
        mask = 1<<e
        num=0
        for a in A:#e-bit目が立っているA[i]を数える
            if a&mask:
                num+=1
        n_num = N - num
        #A[i]のe-bit目が立っていれば、XORの計算上0になるので、e-bit目が立っていないA[i]が加算
        if e>d:#dビット目より上はKに合わせる
            #以下、e-bit目だけ計算したf(x)
            if K&mask:
                f += mask*n_num
            else:
                f += mask*num
        elif e==d:
            f += mask*num
        else:#どうせ後から計算するからなんでもよい？
            f += mask*max(n_num,num)
    max_f = max(f,max_f)
print(max_f)

Buggy submission (verdict: Runtime Error):
import numpy as np
def f(X,A):
    temp_f = np.array([X^A[i] for i in range(len(A))])
    return np.sum(temp_f)
def calc_max_f(A,K):
    temp_max_f = np.array([f(k,A) for k in range(0,K+1)])
    return np.max(temp_max_f)
N,K = map(int, input().split())
A = [int(input()) for _ in range(N)]
print(calc_max_f(A,K))
Problem p03145 (python)

Fixed submission:
AB,BC,CA = map(int, input().split())
print(int(AB*BC/2))

Buggy submission (verdict: Runtime Error):
def calc_range_num(h,height,max_height,ans):#各階層にいくつ区間があるか
    for i in range(len(h)):
        if h[i]>=height and height != 0:
            if i+1<len(h) and h[i]>h[i+1] and h[i+1] <=height:
            #基本的には、高さが下がったところでインクリメント
                ans+=1
            elif i==len(h)-1 and h[i]>height:
                ans+=1
    height+=1
    if height>max_height:
        return ans
    else:
        ans = calc_range_num(h,height,max_height,ans)
    return ans
            
N = int(input())
h = list(map(int, input().split()))
max_height=max(h)
ans=0
print(calc_range_num(h,1,max_height,ans))

Buggy submission (verdict: Runtime Error):
def calc_range_num(h,height,max_height,ans):#各階層にいくつ区間があるか
    for i in range(len(h)):
        if h[i]>=height and height != 0:
            if i+1<len(h) and h[i]>h[i+1] and h[i+1] <=height:
            #基本的には、高さが下がったところでインクリメント
                ans+=1
            elif i==len(h)-1 and h[i]>height:
                ans+=1
    height+=1
    if height>max_height:
        return ans
    else:
        ans = calc_range_num(h,height,max_height,ans)
    return ans
            
N = int(input())
h = list(map(int, input().split()))
max_height=max(h)
ans=0
print(calc_range_num(h,1,max_height,ans))
Problem p03147 (python)

Fixed submission:
def calc_range_num(h,height,max_height,ans):#各階層にいくつ区間があるか
    for i in range(len(h)):
        if h[i]>height:
            if i+1<len(h) and h[i]>h[i+1] and h[i+1] <=height:
            #基本的には、高さが下がったところでインクリメント
                #print(i,h[i],ans+1,height)
                ans+=1
            elif i==len(h)-1:
                #print(i,h[i],ans+1,height)
                ans+=1
    height+=1
    if height>=max_height:
        return ans
    else:
        ans = calc_range_num(h,height,max_height,ans)
    return ans
N = int(input())
h = list(map(int, input().split()))
max_height=max(h)
ans=0
print(calc_range_num(h,0,max_height,ans))

Buggy submission (verdict: Runtime Error):
def calc_range_num(h,height,max_height,ans):#各階層にいくつ区間があるか
    for i in range(len(h)):
        if h[i]>height:
            if i+1<len(h) and h[i]>h[i+1] and h[i+1] <=height:
            #基本的には、高さが下がったところでインクリメント
                #print(i,h[i],ans+1,height)
                ans+=1
            elif i==len(h)-1 and h[i]>height:
                #print(i,h[i],ans+1,height)
                ans+=1
    height+=1
    if height==max_height:
        return ans
    else:
        ans = calc_range_num(h,height,max_height,ans)
    return ans
N = int(input())
h = list(map(int, input().split()))
max_height=max(h)
ans=0
print(calc_range_num(h,0,max_height,ans))
Problem p02999 (python)

Fixed submission:
X, A = map(int, input().split())
if X >= A:
    print(10)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(N):
    sum = 0
    while i < N:
        sum += a[i]
        i += 1
        if sum >= K:
            count += N-1-i
            break

print(count)
Problem p02848 (python)

Fixed submission:
az = [chr(i) for i in range(65, 65+26)]
n  = int(input())

result = []
for l in list(input()):
  c = n + az.index(l)
  if c > 25:
    c = c - 25 - 1
  result.append(az[c])

print(''.join(result))

Buggy submission (verdict: Runtime Error):
import sys

"""[A-Z]"""
az = [chr(i) for i in range(65, 65+26)]

"""inputs"""
lines  = sys.stdin.readlines()
s_num  = int(lines[0])
s_list = list(lines[1])

result = []

"""logic"""
for l in s_list:
  num = az.index(l)
  c = s_num + num
  if c > 25:
    c = c - 25 - 1
  
  result.append(az[c])

"""result"""
print(''.join(result))
Problem p02982 (python)

Fixed submission:
N, d = map(int, input().split())
P = [list(map(int,input().split())) for i in range(N)]

import numpy as np
p1 = np.array(P)
tmp_index = np.arange(p1.shape[0])
xx, yy = np.meshgrid(tmp_index, tmp_index)
distances = np.linalg.norm(p1[xx]-p1[yy], axis=2)
results = np.reshape(np.tril(distances), (1, N**2))


a = 0
for i in range(0, N**2):
  if(results[0][i]!=0 and results[0][i] == np.int64(results[0][i])):
    a += 1
print(a)

Buggy submission (verdict: Runtime Error):
N, d = map(int, input().split())
P = [list(map(int,input().split())) for i in range(N)]

import numpy as np
p1 = np.array(P)
tmp_index = np.arange(p1.shape[0])
xx, yy = np.meshgrid(tmp_index, tmp_index)
distances = np.linalg.norm(p1[xx]-p1[yy], axis=2)
results = np.reshape(np.tril(distances), (1, N**2))


a = 0
for i in range(0, N**2):
  if(results[0][i]!=0 & results[0][i] == np.int(results[0][i])):
    a += 1
print(a)
Problem p02885 (python)

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

print(max(0,int(a)-(int(b)*2)))

Buggy submission (verdict: Runtime Error):



N = int(input())

line = input()
#N = 3
#line = '2 1 2'
lines = line.split(' ')


dic = {}
for item in lines:
    n = int(item)

    if n in dic.keys():
        dic[n] += 1
    else:
        dic[n] = 1

lis = []
for item in dic.keys():
    lis += [dic[item]]


lis.sort(reverse=True)


sublis = []
sublis = lis[:]

def cal(k,lis):
    ans = 0
    if (len(lis)<k): return 0
    while True:
        for k_i in range(k):
            if lis[k_i] == 0:
                return ans
            else:
                lis[k_i] -= 1
        else:
            ans = ans + 1

        lis.sort(reverse=True)

    

for i in range(N):

    k = i + 1

    print(cal(k,lis))
Problem p02885 (python)

Fixed submission:
a,b=map(int,input().split())
if a>=2*b:
  print(a-2*b)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
a=len(L)
#print(L)
for i in range(a-2):
  count1=0
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
        count1+=1
        break
    if count1==1:
         break
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
a=len(L)
#print(L)
for i in range(a-2):
  count1=0
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
        count1+=1
        break
    if count1==1:
         break
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
count1=0
a=len(L)
#print(L)
for i in range(a-2):
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
         break

print(count)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>=2*b:
  print(a-2*b)
else:
  print(0)
Problem p02923 (python)

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
now=0
max=0
count=0
while now<N-1:
  if H[now]>=H[now+1]:
    count+=1
    now+=1
  else:
    now+=1
    if count>max:
      max=count
    count=0
if count>max:
    max=count
print(max)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
now=0
max=0
count=0
while now>len(N)-1:
  if H[now]>=H[now+1]:
    count+=1
    now+=1
  else:
    now+=1
    if count>max:
      max=count
    count=0
print(max)
Problem p02924 (python)

Fixed submission:
N=int(input())
print(N*(N-1)//2)

Buggy submission (verdict: Runtime Error):
ans=0
for i in range(N-1):
  ans=ans+i+2
print(ans)
Problem p02994 (python)

Fixed submission:
N, L = map(int, input().split())
arr = []
min = N+abs(L)
for i in range(1, N+1):
  if abs(L+i-1) < abs(min):
    min = L+i-1
  arr.append(L+i-1)

arr.remove(min)

print("{}".format(sum(arr)))

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
arr = []
min = N
for i in range(1, N+1):
  if abs(L+i-1) < abs(min):
    min = L+i-1
  arr.append(L+i-1)

arr.remove(min)

print("{}".format(sum(arr)))
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res=0
for  i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500*i + 100*j + 50*k == X:
                res += 1
print(res)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for a in A: 
    for b in B:
        for c in C:
            if 500*a + 100*b + 50*c == X:
                count += 1
    
print(count)
Problem p02995 (python)

Fixed submission:
def lcm(a,b):
    ab = a*b
    while b != 0:
        a, b = b, a%b
    return ab //a

def su(n,c,d):
    return n - n//c - n//d + n//lcm(c,d)
    
def main():
    a,b,c,d = map(int,input().split())
    print(su(b,c,d) - su(a-1,c,d))
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def lcm(a,b):
    return a*b//gcd(a,b)

def su(a,b,c,d):
    count = 0
    for _ in range(a//c, (b+1)//c):
        count += 1
    for _ in range(a//d, (b+1)//d):
        count += 1
    for _ in range(a//lcm(c,d), (b+1)//lcm(c,d)):
        count -= 1

    print(b+1-a-count)
    
def main():
    a,b,c,d = map(int,input().split())
    su(a,b,c,d)
    
if __name__ == '__main__':
    main()

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

def lcm(a,b):
    return a*b//gcd(a,b)

count = 0
for _ in range(a//c, (b+1)//c):
    count += 1

for _ in range(a//d, (b+1)//d):
    count += 1
for _ in range(a//lcm(c,d), (b+1)//lcm(c,d)):
    count -= 1

print(b+1-a-count)
Problem p03000 (python)

Fixed submission:
from collections import deque

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

l = deque(list(map(int,input().split())))
count = 0

if sum(l) <= x:
    print(n+1)
else:
    while count <= x:
        count += l.popleft()
        if len(l) == 0:
            break

    print(n-len(l))

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

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

l = deque(list(map(int,input().split())))
count = 0
while count <= x:
    count += l.popleft()

print(n-len(l))

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

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

l = deque(list(map(int,input().split())))
count = 0
while count < x:
    count += l.popleft()

print(n-len(l)+1)
Problem p02981 (python)

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

x = N*A
y = B

li = [x,y]
print(min(li))

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


li = [N*A,B]
print(min(li()))

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

x = N*A
y = B
li = [x,y]
print(min(li()))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
x = N * A
y = B

li = [x,y]
print(min(li()))

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

li = [N , A , B]
print(min(li()))

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

li[N*A,B]
print(str(min(li())))

Buggy submission (verdict: Runtime Error):
x = N * A
y = B

li = [x,y]
print(min(li))
Problem p02993 (python)

Fixed submission:
S = str(input())

if (S[0] == S[1] or S[1] == S[2] or S[2] == S[3]):
    print('Bad')
else:
    print('Good')

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

if (S[0] == S[1] or S[1] == S[2] or S[2] == S[3]):
    print('Bad')
else:
    print('Good')
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().split())
if A >= 13:
    print(B)
elif  A <= 5:
    print(0)
else:
    print(int(B/2))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A >== 13:
    print(B)
elif  A <== 5:
    print(0)
else:
    print(B/2)
Problem p02885 (python)

Fixed submission:
A, B = map(int, input().split())
print(max(A- 2*B, 0))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
print(max(A- 2*b, 0))
Problem p02886 (python)

Fixed submission:
n=int(input())
foods=list(map(int,input().split()))
ans = 0
sum_ans = 0
for i in range(0,n-1):
    for j in range(1,n):
        if i<j:
            ans = foods[i]*foods[j]
            sum_ans += ans
print(sum_ans)

Buggy submission (verdict: Runtime Error):
input()
foods=list(map(int,input().split()))
ans = 0
sum = 0
for i in foods:
    for j in foods:
        i<j
        ans= foods[i]*foods[j]
        sum += ans
print(sum)
Problem p02957 (python)

Fixed submission:
a,b = map(int,input().split())
if (a-b)%2==0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
n=int(input())
seqs =list(map(int,input().split()))
count = 0
for i in range(1,n+1):
    if i != seqs[i]:
        count += 1
if count <= 2:
    print("YES")
else:
    print("NO")
Problem p02958 (python)

Fixed submission:
n=int(input())
seqs =list(map(int,input().split()))
count = 0
for i in range(n):
    if i+1 != seqs[i]:
        count += 1
if count <= 2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
n=int(input())
seqs =list(map(int,input().split()))
count = 0
for i in range(1,n+1):
    if i != seqs[i]:
        count += 1
if count <= 2:
    print("YES")
else:
    print("NO")
Problem p02982 (python)

Fixed submission:
import math 
N,D = map(int,input().split())
X=[]
count=0
for i in range(N):
    x = list(map(int,input().split()))
    X.append(x)
for i in range(N-1):
    for j in range(i+1,N):
        s = 0
        for k in range(D):
            s += (X[i][k]-X[j][k])**2
        if math.sqrt(s).is_integer():
            count += 1
print(count)

Buggy submission (verdict: Runtime Error):
import math 
N,D = map(int,input().split())
X=[]
count=0
for i in range(N):
    x = list(map(int,input().split()))
    X.append(x)
for i in range(N-1):
    for j in range(i,N):
        s = 0
        for k in range(N):
            s += (X[i][k]-X[j][k])**2
            if math.sqrt(s).is_integer():
                count += 1
print(count)
Problem p03085 (python)

Fixed submission:
b=input()

if b=="A":
    print("T")
if b=="C":
    print("G")
if b=="G":
    print("C")
if b=="T":
    print("A")

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

if b=="A":
    print("T")
if b=="C":
    print("G")
if b=-G:
    print("C")
if b==T:
    print("A")
Problem p03101 (python)

Fixed submission:
a,b = map(int,input().split())
c,d = map(int,input().split())
print((a-c)*(b-d))

Buggy submission (verdict: Runtime Error):
H=input()
W=input()
h=input()
w=input()

H=int(H)
W=int(W)
h=int(h)
w=int(w)

print(H*W-w*H-h*W+w*h)

Buggy submission (verdict: Runtime Error):
H=input()
W=input()
h=input()
w=input()

H=int(H)
W=int(W)
h=int(h)
w=int(w)

print(HW-wH-hH-wh)
Problem p03109 (python)

Fixed submission:
s = input()
if int(s[5:7])<= 4:
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):
s = input()
s.strip("/")
s = int(s)
if s <= 20190430:
    print("Heisei")
else:
    print("TBD")
Problem p03455 (python)

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


if (a*b)%2==0:
    print("Even")
else:
    print("Odd")

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

if a*b%2==1:
    print("Odd")
else:
    print("Even")

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

if a*b%2==1:
    print("Odd")
else:
    print("Even")

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

c=a*b

if c%2==0:
    print("Even")
else:
    print("Odd")
Problem p02886 (python)

Fixed submission:
N = int(input())
d = list(map(int, input().split()))
cmb = int(N * (N - 1) / 2)
cnt = 0
for i in range(N):
    for j in range(i + 1, N):
        cnt = cnt + d[i] * d[j]
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split()))
cmb = int(N * (N - 1) / 2)
cnt = 0
for i in range(cmb):
    for j in range(i + 1, cmb):
        cnt = cnt + d[i] * d[j]
print(cnt)
Problem p02969 (python)

Fixed submission:
r=int(input())
print(3*(r**2))

Buggy submission (verdict: Runtime Error):
r=int(input())
return(3*r^2)
Problem p02999 (python)

Fixed submission:
N = list(map(int,input().split()))
if N[0]< N[1]:
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
X=list(map(int,input().split()))[1]
L=list(map(int,input().split()))
i=0
d=0
while True:
    if d>=X:
        break
    else:
        d+= L[i]
        i+= 1
print(i+1)
Problem p03067 (python)

Fixed submission:
b=[int(i) for i in input().split()]
if (b[0]<b[2] and b[2]<b[1]) or (b[0]>b[2] and b[2]>b[1]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
if (A<C and C<B) or (A>C and C>B):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
if (A<C and C<B) or (A>C and C>B):
    print("Yes")
else:
    print("No")
Problem p03089 (python)

Fixed submission:
N=int(input())
b=[int(i) for i in input().split()]
a=[]
try:
    while len(b)>0:
        a2=max([j for i,j in enumerate(b) if b[i]==i+1])
        a.insert(0,a2)
        x=b.pop(a2-1)
    for n in a:
        print(n)
except:
    print(-1)

Buggy submission (verdict: Runtime Error):
N=int(input())
b=[int(i) for i in input().split()]
import numpy as np
import math
def ordering(N,b):
    a=[]
    comb=math.factorial(N)
    x=[[]]*comb
    y=[[]]*comb
    for i in range(1,N):
        a=a+[i]
        for n,m in enumerate(a):
            x[n].insert(m-1,m)
            y[n].append(m)
    resnum=[x.index(i) for i in x if i==b]
    try:
        for i in y[resnum[0]]:
            print(i)
    except:
        return(-1)
ordering(N,b)

Buggy submission (verdict: Runtime Error):
N=int(input())
b=[int(i) for i in input().split()]
import numpy as np
import math
def ordering(N,b):
    a=[]
    comb=math.factorial(N)
    x=[[]]*comb
    y=[[]]*comb
    for i in range(1,N):
        a=a+[i]
        for n,m in enumerate(a):
            x[n].insert(m-1,m)
            y[n].append(m)
    resnum=[x.index(i) for i in x if i==b]
    try:
        for i in y[resnum[0]]:
            print(i)
    except:
        return(-1)
print(ordering(N,b))
Problem p03126 (python)

Fixed submission:
from collections import Counter
ctr = Counter()
N, M = map(int,input().split())
for _ in range(N):
  ctr.update(list(map(int,input().split()))[1:])
print(len([None for v in ctr.values() if v == N]))

Buggy submission (verdict: Runtime Error):
from collections import Counter
ctr = Counter()
N, M = map(int,input().split())
for _ in range(N):
  ctr.update(map(int,input().split())[1:])
print(len([None for v in ctr.values() if v == M]))
Problem p02848 (python)

Fixed submission:
def changeStr(num, charactor):
  sum = num + ord(charactor)
  if sum > 64 + 26 :
    return chr(sum - 26)
  else:
    return chr(sum)

inputStr = [input() for i in range(2)]
num = int(inputStr[0])
targetStr = inputStr[1]

for target in list(targetStr):
  print(changeStr(num, target), end="")

Buggy submission (verdict: Runtime Error):
in = [input() for i in range(2)]
num = str(in[0])
strCodePoint = ord(in[1])
sum = num + strCodePoint
if sum > 65 + 26 :
  print(char(sum - 26))
else:
  print(char(sum))
Problem p02909 (python)

Fixed submission:
weather_list = ['Sunny', 'Cloudy', 'Rainy']

today = input()

if today == 'Sunny':
  num = 1
elif today == 'Cloudy':
  num = 2
elif today == 'Rainy':
  num = 0

print(weather_list[num])

Buggy submission (verdict: Runtime Error):
S = ['Sunny', 'Cloudy', 'Rainy']
today = input('S')

if today == 'Sunny':
  num = 0
elif today == 'Cloudy':
  num = 1
elif today == 'Rainy':
  num = 2

print(S[num + 1])
Problem p02853 (python)

Fixed submission:
a = input().split()
#print(a)
x = a[0]
y = a[1]
def h(x,y):
    d = dict()
    d = {'1':300000,'2':200000,'3':100000}
    if x=='1' and y =='1':
        print(1000000)
        return
    res = 0
    res = d.get(x,0) + d.get(y,0)
    print(int(res))
h(x,y)

Buggy submission (verdict: Runtime Error):
a = input().split()
x = int(a[0])
y = int(a[1])
def h(x,y):
    d = {1:300000,2:200000,1:100000}
    if x==1 and y ==1:
        return 1000000
    print(d.get(x)+y.get(y))
h(x,y)
Problem p02922 (python)

Fixed submission:
cnm = input().split()
a = int(cnm[0])
b = int(cnm[1])
s = 1
c = 0
while s<b:
    s += a - 1
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
s = 1
c = 0
while s<b:
    s += a - 1
    c += 1
print(c)