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

Fixed submission:
N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]
maxp = 0
for i in s:
    pre = s.count(i)-t.count(i)
    maxp = max(maxp,pre)
print(maxp)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = sorted([input() for i in range(N)])
M = int(input())
t = sorted([input() for i in range(M)])
a = 0
for i in s:
    for j in t:
        if a <= (s.count(s[i]) - t.count(t[j])):
            a = s.count(s[i]) - t.count(t[j])
print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = sorted([input() for i in range(N)])
M = int(input())
t = sorted([input() for i in range(M)])
a = 0
for i in s:
    for j in t:
        if a < s.count(s[i])-t.count(j):
            a = s.count(s[i])-t.count(j)
print(a)
Problem p03416 (python)

Fixed submission:
A, B = map(int, input().split())
a = 0
for i in range(A, B+1):
    i = str(i)
    if i == i[::-1]:
        a += 1
print(a)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split()
count = 0
for i in range(A, B+1):
    if str(i) == str(i)[::-1]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split()
count = 0
for i in range(A, B+1):
    if i == i[::-1]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
A, B = int(input())
count = 0
for i in range(A, B+1):
    if i == i[::-1]:
        count += 1
print(count)
Problem p03434 (python)

Fixed submission:
#6
N = int(input())
a = sorted(list(map(int, input().split())))
Alice_list = []
Bob_list = []
for i in range(1, N+1):
    if i%2==1:     
        Alice_list.append(a[-i])
    else:
        Bob_list.append(a[-i])
print(sum(Alice_list)-sum(Bob_list))

Buggy submission (verdict: Runtime Error):
#6
N = int(input())
a = reversed(sorted(list(map(int, input().split()))))
Alice_list = []
Bob_list = []
for i in range(N):
    if i%2==0:     
        Alice_list.append(a[i])
    else:
        Bob_list.append(a[i])
print(sum(Alice_list)-sum(Bob_list))
Problem p03469 (python)

Fixed submission:
S = input()
print(S.replace("7","8",1))

Buggy submission (verdict: Runtime Error):
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
    break
print(*answer)

Buggy submission (verdict: Runtime Error):
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
      	else:
  	        continue
    break
print(*answer)
Problem p03470 (python)

Fixed submission:
#7
N = int(input())
d = [int(input()) for i in range(N)]
d.sort(reverse=True)
count = 1
for i in range(N-1):
    if d[i] > d[i+1]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for i in range(N)]
print(len8set(d))
Problem p03471 (python)

Fixed submission:
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
    else:
        continue
    break
print(*answer)

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())
ans = 0
a = 0
b = 0
c = 0
for a in range(N+1):
    for b in range(N-a+1):
        c = N - a - b
        if (a*10000 + b*5000 + c*1000) == Y:
            ans = 1
            x = a
            y = b
            z = c
            flag = True #フラグ変数で代用しても良い
            break
    if flag:
        break
if ans == 1:
    print(x,y,z)
else:
    print( '-1 -1 -1')

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())
x = 0
y = 0
z = 0
ans = 0
for i in range(1,N):
    for k in range(1,N):
        z = N - i - k
        if (i*10000 + k*5000 + z*1000 )== Y and:
            x = i
            y = k
            ans = 1
            break
if ans == 1:
    print(x,y,z)
else:
    print( '-1 -1 -1')
Problem p03473 (python)

Fixed submission:
M = int(input())
print(48 -M)

Buggy submission (verdict: Runtime Error):
print(48 - int(input())
Problem p03478 (python)

Fixed submission:
#9
N, A, B = map(int, input().split())
sum = 0
ans = 0
for i in range(1, N+1):
    i = str(i)
    for k in range(len(i)):
        sum += int(i[k])
    if A<=sum<=B:
        ans += int(i)
    sum = 0
print(ans)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
sum = 0
ans = 0
for i in range(1, N+1):
    for k in range(len(str(i))-1):
        i = str(i)
        sum += int(i[k])
    if A<=sum<=B:
        ans += int
    sum = 0
print(ans)
Problem p03486 (python)

Fixed submission:
s = sorted(list(str(input())))
t = reversed(sorted(list(str(input()))))
S = str()
T = str()
for i in s:
    S += i
for k in t:
    T += k
print('Yes' if S<T else 'No')

Buggy submission (verdict: Runtime Error):
s = sorted(input())
t = sorted(input()).reverse()
print('Yes' if s<t else 'No')

Buggy submission (verdict: Runtime Error):
s = sorted(input())
t = reversed(sorted(input()))
print('Yes' if s<t else 'No')

Buggy submission (verdict: Runtime Error):
s = sorted(list(str(input())))
t = reversed(sorted(list(str(input()))))
print('Yes' if s<t else 'No')
Problem p03563 (python)

Fixed submission:
R = int(input())
G = int(input())
print(2*G-R)

Buggy submission (verdict: Runtime Error):
R = int(input())
G = int(input())
print(2G - R)
Problem p03605 (python)

Fixed submission:
N = input()
print('Yes' if '9' in N else 'No')

Buggy submission (verdict: Runtime Error):
N = int(input())
print('Yes' if 9 in N else 'No')

Buggy submission (verdict: Runtime Error):
N = int(input())
print('Yes' if '9' in N else 'No')

Buggy submission (verdict: Runtime Error):
N = int(input())
print('Yes' if 9 in N else 'No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
B = 0
for i in A:
    if A.count(i) != 0:
        if A.count(i)%2 == 1: 
            B += 1
        else:
            while i in A:A.remove(i)
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
B=0
for i in A:
    #if A.count(i) >= 1:
    if A.count(i)%2 == 1: 
        B += 1
    else:
        A.remove(i)
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
B=0
for i in A:
    #if A.count(i) >= 1:
    if A.count(i)%2 == 0: 
        A.remove(i)
    else:
        B += 1
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
for i in A:
    #if A.count(i) >= 1:
    if A.count(i)%2 == 0: 
        A.remove(i)   
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
for i in A:
    #if A.count(i) >= 1:
        if A.count(i)%2 == 0: 
            A.remove(i)   
print(B)
Problem p03607 (python)

Fixed submission:
N = int(input())
list = set()
for i in range(N):
    i = int(input())
    if i not in list:
        list.add(i)
    elif i in list:
        list.remove(i)
print(len(list))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
for i in A:
    if A.count(i) >= 1:
        if A.count(i)%2 == 0: 
            A.remove(i)   
print(B)
Problem p03609 (python)

Fixed submission:
X, t = map(int, input().split())
print(X-t if X >=t else '0')

Buggy submission (verdict: Runtime Error):
X, t = map(int, inputa().split())
print(X-t if X >=t else '0')
Problem p03624 (python)

Fixed submission:
S = list(input())
minal = ord('z')
for i in range(ord('a'), ord('z')+1):
    if i < minal and chr(i) not in S:
        minal = i
list = set(S)
print(chr(minal) if len(list)!=26 else 'None')

Buggy submission (verdict: Runtime Error):
list = set(input())
lists = set([chr(i) for i in range(ord('a'), ord('z')+1)])
ans = lists-list
print(min(ans) if len(list(ans)) == 0 else 'None')

Buggy submission (verdict: Runtime Error):
S = input()
list = []
for i in range(len(S)):
    list.append(S[i])
list = set(list)
lists = set([chr(i) for i in range(ord('a'), ord('z')+1)])
print(min(lists-list))
Problem p03644 (python)

Fixed submission:
N = int(input())
a = 1
for i in range(7):
    if N >= 2**i:
        a = 2**i
print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 1
for i in range(7):
    if N >= 2**i
        ans = 2**i
print(ans)
Problem p03645 (python)

Fixed submission:
#真に大切なのは中間点となる要素
N, M = map(int, input().split())
an = set()
nb = set()
for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        an.add(b)
    elif b == N:
        nb.add(a)

print('IMPOSSIBLE' if len(an&nb)==0 else 'POSSIBLE')

Buggy submission (verdict: Runtime Error):
#真に大切なのは中間点となる要素
N, M = map(int, input().split())
an = set()
nb = set()
for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        an.append(b)
    elif b == N:
        nb.append(a)

print('IMPOSSIBLE' if len(an&nb)==0 else 'POSSIBLE')
Problem p03672 (python)

Fixed submission:
S = list(input())
while len(S)!=0:
    S.pop()
    if len(S)%2==0 and S[:int(len(S)/2)]==S[int(len(S)/2):]:
        print(len(S))
        exit()

Buggy submission (verdict: Runtime Error):
S = input
while len(S)!=0:
    S.pop()
    if len(S)%2==0 and S[0:len(S)/2]==S[len(S)/2:]:
        print(len(S))
        exit()
Problem p03693 (python)

Fixed submission:
r, g, b = input().split()
num = int(r + g + b)
print("YES" if num%4==0 else 'NO')

Buggy submission (verdict: Runtime Error):
r, g, b = input().split()
num = r + g + b
print("YES" if num%4==0 else 'NO')
Problem p03760 (python)

Fixed submission:
O = input()
E = input()
a = str()
if len(O)==len(E):
    for i in range(len(O)):
        a += O[i] + E[i]
else :
    for i in range(len(O)-1):
        a += O[i] + E[i]
    a += O[-1]
print(a)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()
a = str()
for i in range(len(O)):
    a += O[i] + E[i]
print(a)
Problem p03796 (python)

Fixed submission:
import math
N = int(input())
print(math.factorial(N)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
print(math.factorial(N)/(10*9+7))
Problem p03962 (python)

Fixed submission:
list = list(map(int, input().split()))
print(len(set(list)))

Buggy submission (verdict: Runtime Error):
list = set(map(int, input().split()))
print(len(set))
Problem p03998 (python)

Fixed submission:
SA, SB, SC = [input() for i in range(3)]
SA = SA + '0'
SB = SB + '0'
SC = SC + '0'

card = SA[0]
SA = SA[1:]

for i in range(303):
    if SA == '0' and card == 'a':
        print('A')
        break
    elif SB == '0' and card == 'b':
        print('B')
        break
    elif SC == '0' and card == 'c':
        print('C')
        break
    
    if card == 'a':
        card = SA[0]
        SA = SA[1:]
    elif card == 'b':
        card = SB[0]
        SB = SB[1:]
    elif card == 'c':
        card = SC[0]
        SC = SC[1:]

Buggy submission (verdict: Runtime Error):
while True:
    if len(SA)==0:
        print('A')
        break
    elif len(SB)==0:
        print('B')
        break
    elif len(SC)==0:
        print('C')
        break

    if card == 'a':
        SA = SA[1:]
        card = SA[0]
    elif card == 'b':
        SB = SB[1:]
        card = SB[0]
    elif card == 'c':
        SC =SC[1:]
        card = SC[0]

Buggy submission (verdict: Runtime Error):
SA = list(str(input())) 
SB = list(str(input())) 
SC = list(str(input())) 
card = 'a'

for i in range(400):

    if card == 'a':
        SA = SA[1:]
        card = SA[0]
    elif card == 'b':
        SB = SB[1:]
        card = SB[0]
    elif card == 'c':
        SC =SC[1:]
        card = SC[0]

    if len(SA)==1 and card=='a':
        print('A')
        break
    elif len(SB)==1 and card=='b':
        print('B')
        break
    elif len(SC)==1 and card=='c':
        print('C')
        break

Buggy submission (verdict: Runtime Error):
for i in range(400):

    if card == 'a':
        SA = SA[1:]
        card = SA[0]
    elif card == 'b':
        SB = SB[1:]
        card = SB[0]
    elif card == 'c':
        SC =SC[1:]
        card = SC[0]

    if len(SA)==1 and card=='a':
        print('A')
        break
    elif len(SB)==1 and card=='b':
        print('B')
        break
    elif len(SC)==1 and card=='c':
        print('C')
        break
Problem p02731 (python)

Fixed submission:
L = int(input())
x = float(L/3)
print(x**3)

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

Fixed submission:


arg = list(map(int, input().split())) # 1行, 配列
N = arg[0]
K = arg[1]
S = list(map(int, input().split())) # 1行, 配列

DP = [float('inf')] * N
DP[0] = 0
for i in range(1, N):
  if i == 1:
    DP[i] = abs(S[i] - S[i-1])
    continue
  for j in range(K+1):
    if i - j < 0:
      continue
    DP[i] = min(DP[i] , DP[i-j] + abs(S[i] - S[i-j]))

print(DP[-1])

Buggy submission (verdict: Runtime Error):

arg = list(map(int, input().split())) # 1行, 配列
N = arg[0]
K = arg[1]
S = list(map(int, input().split())) # 1行, 配列

dp = [float('inf')] * N
dp[0] = 0
for i in range(1, N):
  if i == 1:
    DP[i] = abs(S[i] - S[i-1])
    continue
  for j in range(K+1):
    if i - j < 0:
      continue
    DP[i] = min(DP[i] , DP[i-j] + abs(S[i] - S[i-j]))

print(DP[-1])
Problem p02675 (python)

Fixed submission:
n = input()
sn = str(n)
snr = int(sn[::-1][:1])

if snr == 3:
    print("bon")
elif snr == 0 or snr ==1 or snr == 6 or snr == 8:
    print("pon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
k = int(input())
s = str(input())

if int(len(s)) < k:
    print(s)
else:
    print(s[:k],"...")
Problem p03069 (python)

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

left_black = 0
right_white = S.count('.')
ans = right_white

for i in range(N):
    if S[i] == '#':
        left_black += 1 
    else:
        right_white -= 1
    ans = min(ans, left_black + right_white)
print(ans)

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

ct = 0
if S[0] != S[1]:
    ct += 1

for i in range(N):
    if i % 4 <= 1:
        if S[i] != S[1]:
            ct += 1
    else:
        if S[i] == S[1]:
            ct += 1

print(ct)
Problem p03254 (python)

Fixed submission:
if __name__ == "__main__":
    n, x = map(int, input().split())
    aaa = list(map(int, input().split()))
    ans = 0
    
    for a in sorted(aaa):
        if x < a:
            break
        ans += 1
        x -= a
    else:
        if x > 0:
            ans -= 1
    print(ans)

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    n, x = map(int, input().split())
    aaa = list(map(int, input().split()))
    
    for a in sorted(aaa):
        if x < a:
            break
        ans += 1
        x -= a
    else:
        if x > 0:
            ans -= 1
    print(ans)

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    N,x = list(map(int, input().split()))
    a = list(map(int, input().split()))
    A = 0

    a.sort()
    print(a)
    while x >= 0:
        if a[-1] < x:
            x -= a.pop(-1)
            A += 1
        else:
            break

    if x != 0:
        A -= 1
    print(A)
Problem p02642 (python)

Fixed submission:
n = int(input())
data = list(map(int, input().split()))
mx = max(data)
marked = [0]*(mx + 1)
for a in data:
    for x in range(a, mx+1, a):
        marked[x] += 1
ans = 0
for a in data:
    if marked[a] == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int,input().split()))
L.sort(reverse=True)
count = 0
for n in np.array(range(N)):
    print(f"N:{n}")
    if n != N-1:
        L_s = L[n+1:]
    else:
        L_s = L[n:]
    print(f"L_s:{L_s}")
    for l_s in L_s:
        print(l_s)
        if L[n]%l_s == 0:
            break
    else:
        count += 1

print(count)
Problem p02675 (python)

Fixed submission:

N = int(input())

if (N % 100) % 10 == 2 or (N % 100) % 10 == 4 or (N % 100) % 10 == 5 or (N % 100) % 10 ==7 or (N % 100) % 10 ==9:
    print("hon")
elif (N % 100) % 10 == 0 or (N % 100) % 10 ==1 or (N % 100) % 10 ==6 or (N % 100) % 10 ==8:
    print("pon")
elif (N%100)%10 == 3:
    print("bon")

Buggy submission (verdict: Runtime Error):
#C - : (Colon)

import math


I = input().split()
A = int(I[0])
#hour hand length cm
B = int(I[1])
#minute hand length cm
H = int(I[2])
#hours
M = int(I[3])
#key?
#mins

tha = 30*H + .5*M
thb = 6*M
diff= (math.pi/180)*(abs(tha-thb))
Q = math.cos(diff)
#(theta, radius)
d = math.sqrt(A**2 + B**2 - 2*A*B*Q)



print(d)

Buggy submission (verdict: Runtime Error):

import math


I = input().split()
A = int(I[0])
#hour hand length cm
B = int(I[1])
#minute hand length cm
H = int(I[2])
#hours
M = int(I[3])
#key?
#mins

tha = 30*H 
thb = 6*M
diff= (math.pi/180)*(tha-thb)

#(theta, radius)
d = math.sqrt(A**2 + B**2 - 2*A*B*(math.cos((diff))))


print(d)
Problem p02841 (python)

Fixed submission:
m_1,d_1 = map(int, input().split())
m_2,d_2 = map(int, input().split())
if d_2!=d_1+1:
	print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
m_1,d_1 = int(input(),split())
m_2,d_2 = int(input(),split())
if d_2!=d_1+1:
	print(1)
else:
  print(0)
Problem p03597 (python)

Fixed submission:
n = int(input())
a = int(input())
print(n*n-a)

Buggy submission (verdict: Runtime Error):
n = input(int())
a = input(int())
print(n*n-a)
Problem p02756 (python)

Fixed submission:
from collections import deque
S = str(input())
Q = int(input())
Qy = list([input().split() for _ in range(Q)])
rev = False #反転チェック
ans = deque([S])
for t in Qy:
    if t[0] == '1':
        rev = not rev
    else:
        if (t[1]=='1' and rev == False) or (t[1]=='2' and rev == True):
            ans.appendleft(t[2])
        else:
            ans.append(t[2])
if rev == False:
    print(''.join(ans))
else:
    print(''.join(ans)[::-1])

Buggy submission (verdict: Runtime Error):
S = str(input())
Q = int(input())
Qy = list([input().split() for _ in range(Q)])
ans = [S]

rev = False #反転チェック

for i in Qy:
    if i[0] == '1':
        rev = not rev
	elif i[0] == '2':
        if rev == False:
            if i[1] == '1':
                ans.insert(0,i[2])
            else:
                ans.append(i[2])
        else:
            if i[1] == '1':
                ans.append(i[2])
            else:
                ans.insert(0,i[2])

if rev == False:
    print(''.join(ans))
else:
    ans.reverse()
    print(''.join(ans))

Buggy submission (verdict: Runtime Error):
S = str(input())
Q = int(input())
Qy = list([input().split() for _ in range(Q)])
ans = [S]
for i in Qy:
    if i[0] == '1':
        ans.reverse()
    elif i[0] == '2':
        if i[1] == '1':
            ans.insert(0,i[2])
        else:
            ans.append(i[2])
    print(ans)
print(''.join(ans))
Problem p02786 (python)

Fixed submission:
def input_int():
    return int(input())

def suss(num):
  result = 2
  while num > 1:
    num = num // 2
    result = result * 2
  return result - 1

h = input_int()
print(suss(h))

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

log = {'1': 1 , '2': 3, '3': 3, '4': 7 }

i = 1
while i <= h:
  if str(i) in log:
    # print(log[str(i)])
  else:
    n = i // 2
    log.setdefault(str(i), log[str(n)]*2+1)
    # print(log[str(i)])
  i=i+1
print(log[h])
Problem p03110 (python)

Fixed submission:
n = int(input())
x = []
u = []
s = 0
for i in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
      s = s + int(x)
    if u == 'BTC':
      s = s + ( float(x) *  380000.0) 

print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = []
u = []
s = 0
for i in range(n):
    x.append(floart(input())
    u.append(input())
    if u == 'JPY':
      s = s + int(x)
    if u == 'BTC':
      s = s + ( x *  380000.0) 

print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = []
u = []
s = 0
for i in range(n):
    x.append(floart(input())
    u.append(input())
    if u[i] == 'JPY':
      s = s + int(x)
    if u[i] == 'BTC':
      s = s + ( x *  380000.0) 

print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = []
u = []
s = 0
for i in range(n):
    x.append(input())
    u.append(input())
    if u[i] == 'JPY':
      s = s + int(x)
    if u[i] == 'BTC':
      s = s + ( float(x) *  380000.0) 

print(s)
Problem p02924 (python)

Fixed submission:
N = int(input())

print(N*(N-1) // 2)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

N = input()
print(N*(N-1) / 2)
Problem p02945 (python)

Fixed submission:
# coding: utf-8
 
A, B = list(map(int, input().split()))
 
print(max(A+B, A-B, A*B))

Buggy submission (verdict: Runtime Error):
# coding: utf-8

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

print(max(A+B, A-B, A*B)
Problem p03737 (python)

Fixed submission:
# coding: utf-8
print ''.join([x[0] for x in map(str, raw_input().split())]).upper()

Buggy submission (verdict: Runtime Error):
# coding: utf-8
print map(str, [x[0] for x in map(str, raw_input().split())]).upper()
Problem p03759 (python)

Fixed submission:
# coding: utf-8
(a,b,c) = map(int, raw_input().split())
print "YES" if b - a == c - b else "NO"

Buggy submission (verdict: Runtime Error):
# coding: utf-8
(a,b,c) = int(raw_input().split())
print "YES" if b - a == c - b else "NO"
Problem p02909 (python)

Fixed submission:
S = input()

weather = ['Sunny', 'Cloudy', 'Rainy']

if S == weather[0]:
    print(weather[1])
elif S == weather[1]:
    print(weather[2])
elif S == weather[2]:
    print(weather[0])

Buggy submission (verdict: Runtime Error):

import sys
def input():
    return sys.stdin.readline()[:-1]

N, K, Q = map(int, input().split())

points = [K for _ in range(N)]

for q in range(Q):
    A = int(input()) - 1
    points = [p if i == A else p-1 for i, p in enumerate(points)]
for p in points:
    if p < 1:
        print('No')
    else:
        print('Yes')

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

N, K, Q = map(int, input().split())

points = np.array([K for _ in range(N)])

for q in range(Q):
    A = int(input()) - 1
    points -= 1
    points[A] += 1

for n in range(N):
    if points[n] < 1:
        print('No')
    else:
        print('Yes')
Problem p02911 (python)

Fixed submission:
import numpy as np
import sys
def input():
    return sys.stdin.readline()[:-1]

N, K, Q = map(int, input().split())

points = np.array([K - Q for _ in range(N)])

for q in range(Q):
    A = int(input()) - 1
    points[A] +=1

for p in points:
    if p < 1:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
import numpy
import sys
def input():
    return sys.stdin.readline()[:-1]

N, K, Q = map(int, input().split())

points = np.array([K for _ in range(N)])

for q in range(Q):
    A = int(input()) - 1
    points -= 1
    points[A] +=1

for p in points:
    if p < 1:
        print('No')
    else:
        print('Yes')

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

N, K, Q = map(int, input().split())

points = np.array([K for _ in range(N)])

for q in range(Q):
    A = int(input()) - 1
    points -= 1
    points[A] += 1

for n in range(N):
    if points[n] < 1:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
import numpy as np
 
N, K, Q = map(int, input().split())
 
points = np.array([K for _ in range(N)])
 
for q in range(Q):
    A = int(input()) - 1
    points -= 1
    points[A] += 1
 
[print('Yes') if p > 0 else print('No') for p in points]