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

Fixed submission:
n = raw_input()
a = [i for i in raw_input().split()]
l = len(list(set(a)))
if l == 3:
  print("Three")
if l == 4:
  print("Four")

Buggy submission (verdict: Runtime Error):
n = raw_input()
a = [i for i in raw_input().split()]
l = len(list(set(a)))
if l == 3:
  print("Three")
else if l== 4:
  print("Four")
Problem p02640 (python)

Fixed submission:
num = list(map(int, input().split()))
X= num[0]
Y =num[1]

ans = "No"
for i in range(X+1):
  if 4*X - 2*i == Y:
    ans = "Yes"
    break;
print(ans)

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

X= num[0]
Y =num[1]
ans = "No"
for i in range(X+1):
  if 4*X - 2*i == Y:
    ans = "Yes"
    braek;
print(ans)

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

X= num[0]
Y =num[1]

for i in range(X+1):
  if 4*X - 2*i == Y:
    print("Yes")
    braek;
  else:
    print("No")
    break;

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

X= num[0]
Y =num[1]

for i in range(X):
  if 4*X - 2*i == Y:
    print("Yes")
    braek;
  else:
    print("No")
    break;
Problem p02645 (python)

Fixed submission:
s = input()
print(s[0:3])

Buggy submission (verdict: Runtime Error):
A = input().split()
A_pos = int(A[0])
A_v = int(A[1])
B = input().split()
B_pos = int(B[0])
B_v = int(B[1])

T = int(input())

if(A_pos>B_pos):
  if(A_v >= B_v):
    print("NO")
  else:
    dif_v = B_v - A_v
    if(dif_v * T >= A_pos - B_pos):
      print("YES")
    else:
      print("NO")
else:
  if(B_v >= A_v):
    print("NO")
  else:
    dif_v = A_v - B_v
    if(dif_v * T >= B_pos - A_pos):
      print("YES")
    else:
      print("NO")
Problem p02657 (python)

Fixed submission:
i = list(map(int, input().split()))
print(i[0]*i[1])

Buggy submission (verdict: Runtime Error):
N = int(input()) #1行目のNを取得する
i = list(map(int, input().split()))

result = 1
flag = 0
for x in range(N):
  result *= i[x]
  if(result>pow(10,18)):
    result = -1
    flag = 1
    break

if(flag==0):
  print(result)
else:
  print('-1')
Problem p02675 (python)

Fixed submission:
num = input()
one_num = len(num) - 1
if (num[one_num] == "3"):
  print("bon")
elif (num[one_num] == "0" or num[one_num] == "1" or num[one_num] == "6" or num[one_num] == "8"):
  print("pon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
limit = int(input())
original = input()
if(int(len(original))>limit):
  print(original[0:limit]+ "..." )
else:
  print(original)
Problem p02681 (python)

Fixed submission:
a = [input() for i in range(2)]
flag = 0
for i in range(len(a[0])):
  if(a[0][i]==a[1][i]):
    flag = flag+1
if(flag==len(a[0])):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
X = list(map(int,input().split()))
A = X[0]
B = X[1]
C = X[2]
K = X[3]
score=[1,0,-1]
max_score = 0
nums = []

if (K>=A):
  max_score += 1*A
if (K-A>=B):
  max_score += 2*B
if (K-A-B>0):
  max_score += (-1)*(K-A-B)
print(max_score)
Problem p02687 (python)

Fixed submission:
S = input()
if(S[1]=="B"):
    result = S.replace("B","R")
else:
    result = S.replace("R","B")
print(result)

Buggy submission (verdict: Runtime Error):
if(S[1]=="B"):
    result = S.replace("B","R")
else:
    result = S.replace("R","B")
print(result)
Problem p03455 (python)

Fixed submission:
def choise(a,b):
    if(a*b%2 == 0):return "Even"
    else:return "Odd"




if __name__ == "__main__":
    i1, i2 = map(int, input().split())
    print(choise(i1, i2))

Buggy submission (verdict: Runtime Error):
def func(x,y):
  if (x*y % 2 == 0): return("Even")
  else: return ("Odd")
a,b = input.split()
func(x,y)
Problem p03493 (python)

Fixed submission:
def choise(s):
  return len(list(filter(lambda x:x=='1',s)))

if __name__ == "__main__":
    i1 = input()
    print(choise(i1))

Buggy submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
#２の倍数かどうかを調べる関数　引数:4→True,5→False

def isAllEVEN(A):
    return (not (False in (list(map(lambda x:x%2==0,A)))))

i = 0
while(isAllEVEN(A)):
	A = list(map(lambda x:x/2,A))
    i++;
print(i)

Buggy submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
#２の倍数かどうかを調べる関数　引数:4→True,5→False

def isAllEVEN(A):
    return (not (False in (list(map(lambda x:x%2==0,A)))))

i = 0
while(isAllEVEN(A)):
A = list(map(lambda x:x/2,A))
    i++;
print(i)
Problem p03494 (python)

Fixed submission:
def choise(n,s):
    k = 0
    lis = s.split()
    lis = list(map(lambda x: int(x), lis))
    while (len(lis) == int(n)):
        lis = list(filter(lambda x: x % 2 == 0, lis))
        if (len(lis) == int(n)): k += 1
        lis = list(map(lambda x: x / 2, lis))
    return k

if __name__ == "__main__":
    n = input()
    s = input()

    print(choise(n,s))

Buggy submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
#２の倍数かどうかを調べる関数　引数:4→True,5→False

def isAllEVEN(A):
    return (not (False in (list(map(lambda x:x%2==0,A)))))

i = 0
while(isAllEVEN(A)):
	A = list(map(lambda x:x/2,A))
    i++;
print(i)

Buggy submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
#２の倍数かどうかを調べる関数　引数:4→True,5→False

def isAllEVEN(A):
    return (not (False in (list(map(lambda x:x%2==0,A)))))

i = 0
while(isAllEVEN(A)):
A = list(map(lambda x:x/2,A))
    i++;
Problem p02621 (python)

Fixed submission:
a = int(input())
x = a + a**2 + a**3
print(x)

Buggy submission (verdict: Runtime Error):
a = int(a)
x = a + a**2 + a**3
print(x)

Buggy submission (verdict: Runtime Error):
a = int(a)
x = int(x)
x = a + a**2 + a**3
print(x)
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())

# 全部亀でもならない合計足数に足りない
if y > x * 4:
    print('No')
# 全部鶴でも合計足数をはみ出す
elif y < x * 2:
    print('No')
# 足が奇数
elif y % 2 == 1:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
# 全部亀でもならない合計足数に足りない
if y > x * 4:
    print('No')
# 全部鶴でも合計足数をはみ出す
elif y < x * 2:
    print('No')
# 足が奇数
elif y % 2 == 1:
    print('No')
else:
    print('Yes')
Problem p02658 (python)

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

if 0 in li:
    print(0)
    exit(0)

ans = 1
for i in li:
    ans *= i
    if ans > 10 ** 18:
        print(-1)
        exit(0)

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

n = input()
li = list(map(float, input().split()))
result = np.prod(li)

if float(result) >= 1000000000000000001:
    print(-1)
else:
    print(int(result))
Problem p02957 (python)

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

if (a + b) % 2 != 0:
    print("IMPOSSIBLE")
else:
    print(int((a + b) / 2))

Buggy submission (verdict: Runtime Error):
num = int(input())
ls = list(map(str, input().split(" ")))

diff = 0
for i in range(num):
    if (ls[i] != i+1):
        diff += 1

if diff == 2 or diff == 0:
    print("YES")
else:
    print("NO")
Problem p02882 (python)

Fixed submission:
import math
a, b, x = list(map(float, input().split()))
if x <= 0.5 * a * a * b:
    res = math.degrees(math.atan(2 * x / (a * b * b)))
elif x < a * a * b:
    res = math.degrees(math.atan(a / (2 * (b - x / a ** 2))))
else:
    res = 90.0
print(f'{90 - res:.7f}')

Buggy submission (verdict: Runtime Error):
import math
a, b, x = list(map(float, input().split()))
if x <= 0.5 * a * a * b:
    res = math.atan(2 * x / (a * b * b))
else:
    res = math.atan(a / (2 * (b - x / a ** 2)))
print(f'{90 - res * 180 / math.pi:.7f}')
Problem p02975 (python)

Fixed submission:
import sys
from collections import Counter
N = int(input())
C = Counter(list(map(int, input().split())))
if len(C) == 1 and C[0] == N:
    print('Yes')
elif len(C) == 2 and N % 3 == 0 and C[0] == N // 3 and N - C[0] == 2 * N // 3:
    print('Yes')
elif len(C) == 3 and N % 3 == 0:
    b = 0
    for c in C.most_common():
        if c[1] != N // 3:
            print('No')
            sys.exit()
        b ^= c[0]
    if b == 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
from collections import Counter
N = int(input())
C = Counter(list(map(int, input().split())))
if len(C) == 1 and C[0] == N:
    print('Yes')
elif len(C) == 2 and N % 3 == 0 and C[0] == N // 3 and N - [0] == 2 * N // 3:
    print('Yes')
elif len(C) == 3 and N % 3 == 0:
    b = 0
    for c in C.most_common():
        if c[1] != N // 3:
            print('No')
            sys.exit()
        b ^= c[0]
    if b == 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')
Problem p03477 (python)

Fixed submission:
I = input().split()
A, B, C, D = [int(i) for i in I]

if A + B > C + D:
    print('Left')
elif A + B < C + D:
    print('Right')
else:
    print('Balanced')

Buggy submission (verdict: Runtime Error):
I = input().split()
A, B, C, D = [int(i) for i in I]

if int(A + B > C + D:
    print('Left')
elif A + B < C + D:
    print('Right')
else:
    print('Balanced')
Problem p03699 (python)

Fixed submission:
import sys
N = int(input())
S = [int(input()) for _ in range(N)]
S.sort()
t = sum(S)
if t % 10 != 0:
    print(t)
    sys.exit()

for s in S:
    if (t - s) % 10 != 0:
        print(t - s)
        sys.exit()
print(0)

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
S = [int(input()) for _ in range(N)]
S.sort()
t = sum(S)
if t % 10 != 0:
    print(t)
    sys.exit()

for s in range(S):
    if (t - s) % 10 != 0:
        print(t - s)
        sys.exit()
print(0)
Problem p02657 (python)

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

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

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

print(a*b)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
print("Even" if a*b % 2 == 0 else "Odd")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a*b % 2 == 0:
  print("Even")
  
 else:
  print("Odd")

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

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

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

c=a*b

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

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

c=a*b

if c%2==0:
  print("Even")
 else:
  print("odd")
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
count = 0

for n in range(3):
    if S[n] == T[n]:
        count += 1

print(count)

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

print(int((n-1)*n/2))

Buggy submission (verdict: Runtime Error):
import math

A,B = [int(x) for x in input().split()]
print(math.ceil(B/A))
Problem p02923 (python)

Fixed submission:
N = int(input())
H = [int(x) for x in input().split()]
L = []
count = 0
L.append(0)

for n in range(len(H)-1):
    if H[n]-H[n+1]>=0:
        count += 1
        L.append(count)
    else:
        count = 0

print(max(L))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = [int(x) for x in input().split()]
L = []
count = 1

for n in range(len(H)-1):
    if H[n]-H[n+1]>=0:
        count += 1
        L.append(count)
    else:
        count = 1

print(max(L))
Problem p03401 (python)

Fixed submission:
N = int(input())
X = [int(x) for x in input().split()]
sum = 0
X.insert(0,0)
X.append(0)

for n in range(N+1):
    sum += abs(X[n] - X[n+1])


for n in range(N):
    l = abs(X[n] - X[n+1])
    r = abs(X[n+1] - X[n+2])

    if X[n] < X[n+1] and X[n+1] < X[n+2]:
        print(sum)
    elif X[n] > X[n+1] and X[n+1] > X[n+2]:
        print(sum)

    elif l < r:
        sep = 2*abs(X[n] - X[n+1])
        print(sum - sep)
    else:
        sep = 2*abs(X[n+2] - X[n+1])
        print(sum - sep)

Buggy submission (verdict: Runtime Error):
'''
Created on 2020/02/24

@author: fanta
'''
N = int(input())
X = [int(x) for x in input().split()]
X.insert(0,0)
X.append(0)

for n in range(N+1):
    sum += abs(X[n] - X[n+1])


for n in range(N):
    l = abs(X[n] - X[n+1])
    r = abs(X[n+1] - X[n+2])

    if X[n] < X[n+1] and X[n+1] < X[n+2]:
        print(sum)
    elif X[n] > X[n+1] and X[n+1] > X[n+2]:
        print(sum)

    elif l < r:
        sep = 2*abs(X[n] - X[n+1])
        print(sum - sep)
    else:
        sep = 2*abs(X[n+2] - X[n+1])
        print(sum - sep)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
print('Yes') if S + T[-1] == T else print('No')

Buggy submission (verdict: Runtime Error):
gjgsidogse
Problem p02696 (python)

Fixed submission:
A,B,N = map(int, input().split())
if B == 1 or A == 1:
  floor = 0
else:
  if N < B:
    floor = int(A*N/B) - A*int(N/B)
  elif N == B:
    floor = int(A*(N-1)/B) - A*int((N-1)/B)
  else:
    floor = max([(int(A*(x-1)/B) - A*int((x-1)/B)) for x in range(B,N,B)])
    
print(floor)

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

if N < B:
  floor = int(A*N/B) - A*int(N/B)
else:
  floor = max([(int(A*(x-1)/B) - A*int((x-1)/B)) for x in range(B,N,B)])
print(floor)
Problem p02812 (python)

Fixed submission:
N = int(input())
S = input()
counter = 0
for i in range(0,N-2):
    if(S[i] == "A"):
        if(S[i+1] == "B"):
            if(S[i+2] == "C"):
                counter += 1
                
print(counter)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
counter = 0
for i in range(0,N):
    if(S[i] == "A"):
        if(S[i+1] == "B"):
            if(S[i+2] == "C"):
                counter += 1
                
print(counter)
Problem p03369 (python)

Fixed submission:
S = input()
S_c = S.count("o")
if(S_c==3):
    print("1000")
elif(S_c==2):
    print("900")
elif(S_c ==1):
    print("800")
else:
    print("700")

Buggy submission (verdict: Runtime Error):
A,B,C,X,Y = map(int,input().split())
min_ = min(X,Y)
max_ = max(X,Y)

res = A*X + B*Y

m = 2 * C * max(X, Y);

sum = C * 2* min_

if(C<=0.5 * A and C <= 0.5 * B):
    sum += 2*C*(max_-min_)

elif(max_==X):
    sum += (max_-min_)*A
else:
    sum += (max_-min_)*B
    
print(min(m,min(res,sum)))
Problem p03495 (python)

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

Ad = {x:0 for x in set(A)}
if len(set(A)) <= K:
    print(0)
else:
    count = 0
    for a in A:
        Ad[a] += 1
    Ad = sorted(Ad.items(), key=lambda x:x[1])
    for i in range(len(set(A))-K):
        count += Ad[i][1]
    print(count)

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

if(len(set(a)) <= k):
    print(0)
else:
    dic_a = {x:0 for x in set(A)}
    for i in a:
        dic_a[i] += 1
    sum = 0
    a = sorted(dic_a.items(), key=lambda x: x[0])
    for i in range(k,len(a)):
        sum += a[i][1]
    print(sum)
Problem p03502 (python)

Fixed submission:
n = int(input())
sum = 0

for i in str(n):
    sum += int(i)
    
if(n%sum==0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for i in str(n):
    sum += int(i)
if(N%sum==0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for i in str(n):
    sum += int(i)
if(N%sum==0):
    print("Yes")
else:
    print("No")
Problem p02982 (python)

Fixed submission:
import math

N, D = map(int, input().split())

array = [[0 for i in range(10)] for j in range(10)]

for i in range(N):
    x = list(map(int, input().split()))
    for j in range(0, D):
        array[i][j] = x[j];
sum_dis = 0
for i in range(0,N-1):
    for j in range(i+1,N):
        dis = 0
        for k in range(D):
            dis += (array[i][k] - array[j][k])**2
        dis = math.sqrt(dis)
        if(dis.is_integer()): sum_dis += 1
print(sum_dis)

Buggy submission (verdict: Runtime Error):
import math

N, D = map(int, input().split())

arr = [[0 for i in range(10)] for j in range(10)]

for i in range(N):
    x = list(map(int, input().split()))
    for j in range(0, D):
        array[i][j] = x[j];
sum_dis = 0
for i in range(0,N-1):
    for j in range(i+1,N):
        dis = 0
        for k in range(D):
            dis += (array[i][k] - array[j][k])**2
        dis = math.sqrt(dis)
        if(type(dis) == int): sum_dis += 1
print(sum_dis)

Buggy submission (verdict: Runtime Error):
import math

N, D = map(int, input().split())

array = [[0]*11]*11

for i in range(N):
    x = list(map(int, input().split()))
    for j in range(D):
        array[i][j] += x[j];
    
for i in range(0,N-1):
    for j in range(i+1,N):
        dis = 0
        for k in range(D):
            dis += (array[i][k] - array[i][k])**2
        dis = math.sqrt(dis)
        if(type(dis) == int): sum_dis += 1
print(sum_dis)

Buggy submission (verdict: Runtime Error):
import math

N, D = map(int, input().split())

array = []

for i in range(N):
    x = list(map(int, input().split()))
    array.append(X)
    
dis = 0
sum_dis = 0
for i in range(N-1):
    for j in range(i+1,N):
        for k in range(D):
            dis += (array[i][k] - array[i][k])**2
        dis = math.sqrt(dis)
        if(type(dis) == int): sum_dis += 1
print(sum_dis)

Buggy submission (verdict: Runtime Error):
import math

N = int(input()) 
D = int(input()) 

array = [[0]*10]*10
dis = 0
sum_dis = 0
for i in range(N-1):
    for j in range(i+1,N):
        for k in range(D):
            dis += (array[i][k] - array[i][k])**2
        dis = math.sqrt(dis)
        if(type(dis) == int): sum_dis += 1
print(sum_dis)
Problem p03471 (python)

Fixed submission:
n, y = map(int, input().split())
for i in range(n + 1):
    for j in range(n - i + 1):
        if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
            print(i, j, n - i - j)
            exit()
print("-1 -1 -1")

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

for i in range(N+1):
    for j in range(N-i+1):
        if i*10000 + j*5000 + (N-i-j)*1000 == Y:
            print(i, j, n-i-j)
            exit()
print("-1 -1 -1")
Problem p02621 (python)

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

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

a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for i in range(M):
b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
      j -= 1
ans = max(ans, i + j)
print(ans)

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

x = list(filter(lambda i:s[i] != t[i], range(len(s)) ))

print(len(x))
Problem p03543 (python)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    # 1 line 1 int
    return int(sys.stdin.readline().rstrip())
def LI():
    # 1 line n ints
    return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    # 1 line 1 string
    return sys.stdin.readline().rstrip()
def LS():
    # 1 line n strings
    return list(sys.stdin.readline().rstrip().split())

A = S()

if A[0] == A[1] == A[2] or A[1] == A[2] == A[3]:
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    # 1 line 1 int
    return int(sys.stdin.readline().rstrip())
def LI():
    # 1 line n ints
    return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    # 1 line 1 string
    return sys.stdin.readline().rstrip()
def LS():
    # 1 line n strings
    return list(sys.stdin.readline().rstrip().split())

A = S()

if A[0] == A[1] == A[2] or A[1] == A[2] == A[3]:
   print("Yes")
else
   print("No")

Buggy submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    # 1 line 1 int
    return int(sys.stdin.readline().rstrip())
def LI():
    # 1 line n ints
    return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    # 1 line 1 string
    return sys.stdin.readline().rstrip()
def LS():
    # 1 line n strings
    return list(sys.stdin.readline().rstrip().split())

A = S()

if A[0] == A[1] == A[2] or
   A[1] == A[2] == A[3]:
   print("Yes")
else
   print("No")
Problem p02732 (python)

Fixed submission:
n = input()
n = int(n)
lin = input().split()
# 要素の個数を求める
dic_s = {}
for c in lin:
  dic_s.setdefault(c, 0)
  dic_s[c] += 1
# ペアの総数
tot = 0
for key,value in dic_s.items():
  v = value
  tot += v * (v - 1) / 2
# print(int(tot))
# 指定位置のペアを除く
for c in lin:
  if tot > 0:
    v = dic_s[c]
    print(int(tot-(v-1)))
  else:
    print(0)

Buggy submission (verdict: Runtime Error):
n = input()
n = int(n)
lin = input().split()
# 要素の個数を求める
dic_s = {}
for c in lin:
  dic_s.setdefault(c, 0)
  dic_s[c] += 1
# 1つしかない要素は計算対象外
for key, value in dic_s.items():
  if value == 1:
    del dic_s[key]
dic_tot = {}
for c in lin:
  # 1度求めたら再計算しない
  # 同じ数字が多いと時間短縮
  if dic_tot.get(c):
    print(int(dic_tot[c]))
  else:
    # 指定数値を除いた2つを選ぶ
    tot = 0
    for key,value in dic_s.items():
      v = value
      if key == c:
        v -= 1
      if v > 1:
        tot += v * (v - 1) / 2
    dic_tot.setdefault(c,tot)
    print(int(tot))
Problem p02700 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
while True:
  c -= b
  if c <= 0:
    print("Yes")
    break
  elif c > 0:
    a -= d
    if a <= 0:
      print("No")
      break

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
while True:
	c -= b
    if c <= 0:
     	print("Yes")
    else:
      	a -= d
    	if a <= 0:
          print("No")
Problem p02898 (python)

Fixed submission:
n,k=map(int,input().split())
ans=0
hlist=list(map(int,input().split()))
for height in hlist:
  if height>=k:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=0
hlist=[int(input()) for i in range(n)]
for height in hlist:
  if height>=k:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=0
hlist=[int(input()) for i in range(n)]
for height in hlist:
  if height>=k:
    ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=0
for i in range(n):
  h=int(input())
  if h>=k:
    ans+1
print(ans)
Problem p02911 (python)

Fixed submission:
n, k, q = map(int, input().split())
alist = [int(input()) for i in range(q)]
ans = [k - q] * n

for Ai in alist:
    ans[Ai - 1] += 1

for Ai in ans:
    print('Yes') if Ai > 0 else print('No')

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
alist = [int(input()) for i in range(n)]

for i in range(1, n + 1):
    if n - alist.count(i) >= k:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
n, k, q = list(input())
alist = [int(input()) for i in range(n)]

for i in range(1, n + 1):
    if n - alist.count(i) >= k:
        print('No')
    else:
        print('Yes')
Problem p02923 (python)

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

counter, ans = 0, 0
for i in range(len(h)-1):
    if h[i] >= h[i+1]:
        counter += 1
    else:
        if ans <= counter:
            ans = counter
        counter = 0
ans = max(ans, counter)


print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
hlist = list(map(int, input().split()))
delta = [hlist[i + 1] - hlist[i] for i in range(len(hlist) - 1)]

counter = 0
for i in range(len(delta)):
    if delta[i] <= 0:
        counter += 1
    else:
        ans = counter
        counter = 0
ans = max(ans, counter)
print(ans)
Problem p02988 (python)

Fixed submission:
n = int(input())
plist = list(map(int, input().split()))
counter = 0

for i in range(1, n-1):
    a, b, c = plist[i-1:i+2]
    if a < b < c or c < b < a:
        counter += 1

print(counter)

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

for i in range(2, n):
    a = plist[i - 1]
    b = plist[i]
    c = plist[i+1]
    if a < b < c or c < b < a:
        counter += 1

print(counter)

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

for i in range(2, n):
    a, b, c = plist[i - 1:i + 2]
    if a < b < c or c < b < a:
        counter += 1

print(counter)