Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input())

RGB = set(['R', 'G', 'B'])
list_R = []
list_G = []
list_B = []
for k in range(N):
    s_sep = S[k]
    if s_sep == 'R':
        list_R.append(k)
    elif s_sep == 'G':
        list_G.append(k)
    else:
        list_B.append(k)


def count_num(list_RGB, i, j):
    counter = 0
    for k in list_RGB[::-1]:
        if k < j:
            break
        if k - j != j - i:
            counter += 1
    return counter


count = 0
for i in range(0, N):
    for j in range(i+1, N):
        one = RGB - set([S[i], S[j]])
        if len(one) == 1:
            if list(one)[0] == 'R':
                count += count_num(list_R, i, j)
            elif list(one)[0] == 'G':
                count += count_num(list_G, i, j)
            else:
                count += count_num(list_B, i, j)

print(count)

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

# RGBとなる組み合わせの数を求める
sum_collection = S.count('R') * S.count('G') * S.count('B')

# RGBとなる組み合わせの数から、 j - i == k - jとなる組の数を減らす
for i in range(N):
    for j in range(i, N):
        # j - i == k - j　となる組を見つける
        k = j + (j - i)
        if k >= N:
            break
        # すべて違ったら　(R G Bの組み合わせであったら)
        if S[i] != S[j] != S[k] != S[i]:
            sum_collection -= 1

print(sum_collection)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input())

if 'R' != 'G' != 'R' != 'R':
    print('yes')


count = 0
for i in range(0, N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            if j - i != k - j:
                if S[i] != S[j] != S[k] != S[i]:
                    count += 1

print(count)

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

# RGBとなる組み合わせの数を求める
sum_collection = S.count('R') * S.count('G') * S.count('B')

# RGBとなる組み合わせの数から、 j - i == k - jとなる組の数を減らす
for i in range(N):
    for j in range(i, N):
        # j - i == k - j　となる組を見つける
        k = j + (j - i)
        if k >= N:
            break
        # すべて違ったら　(R G Bの組み合わせであったら)
        if S[i] != S[j] != S[k] != S[i]:
            sum_collection -= 1

print(sum_collection)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
while N > K//2:
  N = abs(N-K)
print(N)

Fixed submission:
N, K = map(int, input().split())
a = (N//K) * K
N -= a
while N > K//2:
  N = abs(N-K)
print(N)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
dict1 = {}
for _ in range(N):
  s = input()
  if s in dict1:
    dict1[s] += 1
  else:
    dict1[s] = 1
list1 = [d[0] for d in dict1.items() if d[1]==max(dict1.values())]
list1.sort()
for s in list1:
  print(s)


Fixed submission:
N = int(input())
dict1 = {}
for _ in range(N):
  s = input()
  if s in dict1:
    dict1[s] += 1
  else:
    dict1[s] = 1
max_num= max(dict1.values())
list1 = [d[0] for d in dict1.items() if d[1]==max_num]
list1.sort()
for s in list1:
  print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
dict1 = {}
for _ in range(N):
  s = input()
  if s in dict1:
    dict[s] += 1
  else:
    dict[s] = 1
list1 = [d[0] for d in dict1.items() if d[1]==max(dict1.values())]
list1.sort()
for s in list1:
  print(s)

Fixed submission:
N = int(input())
dict1 = {}
for _ in range(N):
  s = input()
  if s in dict1:
    dict1[s] += 1
  else:
    dict1[s] = 1
max_num= max(dict1.values())
list1 = [d[0] for d in dict1.items() if d[1]==max_num]
list1.sort()
for s in list1:
  print(s)
Buggy python submission (verdict: Runtime Error):
N = int(input())
list1 = sorted(list(map(int, input().split())))

s = 'YES'
for i in range(N-1):
  if list[i] == list[i+1]:
    s = 'NO'
    break
print(s)

Fixed submission:
N = int(input())
list1 = sorted(list(map(int, input().split())))
pre_num = None
s = 'YES'
for num in list1:
  if num == pre_num:
    s = 'NO'
    break
  pre_num = num
print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
list1 = list(map(int, input().split())).sort()
pre_num = None
s = 'YES'
for num in list1:
  if num == pre_num:
    s = 'NO'
    break
  pre_num = num
print(s)

Fixed submission:
N = int(input())
list1 = sorted(list(map(int, input().split())))
pre_num = None
s = 'YES'
for num in list1:
  if num == pre_num:
    s = 'NO'
    break
  pre_num = num
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N , M = map(int, input().split())
list1 = list(map(int, input().split()))
dp =[float('inf') for i in range(N)]
dp[0] = 0
for i in range(N):
    for j in range(1,M+1):
        if j > i:
            break
        dp[i] = min(dp[i],dp[i-j]+abs(list1[i]-list1[i-j]) )
        #print(dp)
print(dp[N-1])

Fixed submission:
N , M = map(int, input().split())
import numpy as np
list1=np.array(list(map(int, input().split())))
dp = np.array([float('inf') for i in range(N)])
dp[0] = 0
#print(np.abs(list1[1]-list1[1:1+1]))
for i in range(N):
    if i - M < 0:
        dp[i] = np.min(dp[:i+1]+np.abs(list1[i]-list1[:i+1]) )
    else:
        dp[i] = np.min(dp[i-M:i+1]+np.abs(list1[i]-list1[i-M:i+1]) )
    #print(dp)
print(int(dp[N-1]))
Buggy python submission (verdict: Time Limit Exceeded):
N, W= map(int, input().split())
list1 = [ tuple(map(int, input().split())) for _ in range(N)]
dp = [ [0 for i in range(W+1)] for i in range(N)]

for i in range(N):
    for w in range(1,W+1):
        if list1[i][0] <= w:
            dp[i][w] =max(list1[i][1]+dp[i-1][w-list1[i][0]], dp[i-1][w])
        else:
            dp[i][w] =dp[i-1][w]
print(dp[-1][-1])

Fixed submission:
import numpy as np
N, W = map(int, input().split())
w, v = [], []
for i in range(N):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

DP = np.zeros((N+1,W+1), dtype=np.int64)

for i in range(N):
    DP [i+1] = np.array(DP[i])
    DP[i+1][w[i]:] = np.maximum(DP[i][:-w[i]]+ v[i], DP[i][w[i]:])

#print(DP)
print(DP[-1][-1])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
S = input()
s = np.array([True if _ == 'W' else False for _ in S])
s_ = np.logical_not(s)
res = N
for i in range(N):
    a = sum(s[0:i]) + sum(s_[i+1:N])
    if a < res:
        res = a
print(res)

Fixed submission:
import numpy as np
N = int(input())
S = input()
pre_s = S[0]
sum1 = sum(s == 'E' for s in S)
res = sum1
if S[0] =='E':
    sum1-=1
    
for i in range(1,len(S)):
    if pre_s =='W':
        sum1 +=1
    if S[i]=='E':
        sum1 -=1
    if sum1 < res:
        res =sum1
    pre_s = S[i]
print(res)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

count = 0
for i in range(0, len(a)):
    if a[i] != b[i];
        count+=1
      
print(count)

Fixed submission:
a = input()
b = input()
 
count = 0
for i in range(0, len(a)):
    if a[i] != b[i]:
        count+=1
      
print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(input().split())
if a < 8 and b < 8:
  print("Yay!")
else:
  print(":(")

Fixed submission:
a, b = map(int, input().split())
if a <= 8 and b <= 8:
  print("Yay!")
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
d, n = map(int, input().split())
count = 0
for i in range(0, 10000 * 100 + 1):
  if i % (pow(100 , d)):
    count += 1
    if count == n:
      print(i)
      return

Fixed submission:
# numが100で何回割れるか
def getDevide100Count(num: int):
    n = 0
    while num % 100 == 0:
        num = num / 100 
        n += 1
    return n


d, n = map(int, input().split())
count = 0
i = 0
while count != n:
    i += 1
    if getDevide100Count(i) == d:
        count += 1

print(i)
Buggy python submission (verdict: Runtime Error):
def num_divide_two(num: int):
    return int(format(num, 'b')[::-1].find("1"))

N = int(input())
print(sum(map(num_divide_two, map(int, input().split())))

Fixed submission:
def num_divide_two(num: int):
    return int(format(num, 'b')[::-1].find("1"))

N = int(input())
print(sum(map(num_divide_two, map(int, input().split()))))
Buggy python submission (verdict: Runtime Error):
n = input()
n = 1000 - n
while n < 0:
    n += 1000
print(n)

Fixed submission:
n = int(input())
n = 1000 - n
while n < 0:
    n += 1000
print(n)
Buggy python submission (verdict: Runtime Error):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = input()

if abs(t * (w - v)) >= abs(b - a):
  print('YES')
else:
  print('NO')

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

if t * (v - w) >= abs(a - b):
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())

if a >= k:
  print(k)
elif a + b >= k:
  print(a)
else:
  print(a - (k - a - b)
    

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

if a >= k:
  print(k)
elif a + b >= k:
  print(a)
else:
  print(a - (k - a - b))
Buggy python submission (verdict: Runtime Error):
def solve():
    x, n = map(int, input().split())
    if not n:
        print(x)
        return

    ps = list(map(int, input().split()))
    flgs = [1] * 101

    for p in ps:
        flgs[p] = 0

    ansr = 101
    ansl = 101
    index = x
    while 1:
        if flgs[index] == 1:
            ansr = index
            break
        else:
            index += 1

    index = x
    while 1:
        if flgs[index] == 1:
            ansl = index
            break
        else:
            index -= 1

    if abs(ansr - x) >= abs(ansl - x):
        print(ansl)
    else:
        print(ansr)


solve()

Fixed submission:
def solve():
    x, n = map(int, input().split())

    if not n:
        print(x)
        return

    ps = list(map(int, input().split()))
    flgs = [1] * 102

    for p in ps:
        flgs[p] = 0

    ansr = 101
    ansl = 101
    index = x
    while 1:
        if flgs[index] == 1:
            ansr = index
            break
        else:
            index += 1

    index = x
    while 1:
        if flgs[index] == 1:
            ansl = index
            break
        else:
            index -= 1

    if abs(ansr - x) >= abs(ansl - x):
        print(ansl)
    else:
        print(ansr)


solve()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = list(map(int, input().split()))

ans = 1

for i in A_list:
    ans = ans * i


if ans > 10 ** 18:
    ans = -1

print(ans)

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

ans = 1

for i in A_list:
    if i == 0:
        ans = 0

if ans != 0:
    for i in A_list:
        ans = ans * i
        if ans > 10 ** 18:
            ans = -1
            break

print(ans)

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

ans = 1

for i in A_list:
    if i == 0:
        print(0)
        exit(1)

for i in A_list:
    ans = ans * i
    if ans > 10 ** 18:
        ans = -1
        break

print(ans)

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

ans = 1

for i in A_list:
    if i == 0:
        ans = 0

if ans != 0:
    for i in A_list:
        ans = ans * i
        if ans > 10 ** 18:
            ans = -1
            break

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = ['-1' for _ in range(N+1)]
C = {}
C['AC'] = 0; C['WA'] = 0; C['TLE'] = 0; C['RE'] = 0
for i in range(N):
  S[i+1] = input()
  C[S[i+1]] += 1
for case in ['AC', 'WA', 'TLE', 'RE']:
  print('{} x {}'.format(case,str(C[case])))

Fixed submission:
N = int(input())
if N%1000 == 0:
  print(0)
else:
  print(1000 - N%1000)
Buggy python submission (verdict: Runtime Error):
    N = int(input())
    S = ['-1' for _ in range(N+1)]
    C = {}
    C['AC'] = 0; C['WA'] = 0; C['TLE'] = 0; C['RE'] = 0
    for i in range(N):
        S[i+1] = input()
        C[S[i+1]] += 1
    for case in ['AC', 'WA', 'TLE', 'RE']:
        print('{} x {}'.format(case,str(C[case])))

Fixed submission:
N = int(input())
S = ['-1' for _ in range(N+1)]
cases = ['AC', 'WA', 'TLE', 'RE']
C = dict(zip(cases, [0]*len(cases)))
for i in range(N):
  S[i+1] = input()
  C[S[i+1]] += 1
for case in cases:
  print('{} x {}'.format(case,str(C[case])))
Buggy python submission (verdict: Runtime Error):
	x = list(map(int, input().split()))
    count = 1
    for i in x:
        if i == 0:
            print(count)
            break
        count += 1

Fixed submission:
x = list(map(int, input().split()))
count = 1
for i in x:
  if i == 0:
    print(count)
    break
  count += 1
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // math.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

Fixed submission:
import fractions

N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

Fixed submission:
import fractions

N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

Buggy python submission (verdict: Runtime Error):
    N = int(input())
    a = list(map(int, input().split()))
    l = a[0]
    for i in range(1,N):
        l = l * a[i] // fractions.gcd(l, a[i])
    # print(l)

    m = l-1

    # f
    fm = 0
    for i in range(N):
        fm += m % a[i]
    print(fm)

Fixed submission:
import fractions

N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
# print(l)

m = l-1

# function
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

Fixed submission:
import fractions

N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)
Buggy python submission (verdict: Runtime Error):
import sys
N = int(input())
base = ['AC','WA','TLE','RE']
array = [ input() for a in range(N) if input() in base]

if not ( 1 <= N <= 10**5 ): sys.exit()

for I in base:
    print(I+' x '+str(array.count(I)))

Fixed submission:
import sys
N = int(input())
array = [ input() for a in range(N) ]
base = ['AC','WA','TLE','RE']

for I in base:
    print(I+' x '+str(array.count(I)))

Buggy python submission (verdict: Runtime Error):
import sys
N = int(input())
array = [ input() for a in range(6) ]
base = ['AC','WA','TLE','RE']

for I in base:
    print(I+' x '+str(array.count(I)))

Fixed submission:
import sys
N = int(input())
array = [ input() for a in range(N) ]
base = ['AC','WA','TLE','RE']

for I in base:
    print(I+' x '+str(array.count(I)))
Buggy python submission (verdict: Runtime Error):
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
 b = X - a
 if 2 * a + 4 * b == Y:
 ans = 'Yes'
 print(ans)

Fixed submission:
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
  b = X - a
  if 2 * a + 4 * b == Y:
    ans = 'Yes'
    print(ans)

Buggy python submission (verdict: Runtime Error):
import sys

X, Y = map(int, input().split())
ans = 'No'
if X[0] > 100 or X[1] > 100:
  print(ans)
  sys.exit()
if X[1] > X[0]*4 or X[1] < X[0]*2:
  print(ans)
  sys.exit()
if X[1] % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
 b = X - a
 if 2 * a + 4 * b == Y:
 ans = 'Yes'
 print(ans)


Fixed submission:
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
  b = X - a
  if 2 * a + 4 * b == Y:
    ans = 'Yes'
    print(ans)

Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())
ans = 'No'
for a in range(X + 1):
 b = X - a
 if 2 * a + 4 * b == Y:
 ans = 'Yes'
 print(ans)

Fixed submission:
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
  b = X - a
  if 2 * a + 4 * b == Y:
    ans = 'Yes'
    print(ans)

Buggy python submission (verdict: Runtime Error):
X = list(map(int, input().split()))
if X[0] > 100 or X[1] > 100:
  no_print
if X[1] > X[0]*4 or X[1] < X[0]*2:
  no_print
if X[1] % 2 == 1:
  no_print

number_check
  
def no_print():
  print(No)
  exit
    for I in list(range(1,100,1))

def number_check():
  turtle = X[0]
  crane = 0
  for (int i==0; i <= X[0]: i++):
    result = turtle * 4 + crane * 2 
    if result > X[1]:
      crane += 1
      turtle -= 1
    if result == X[1]:
      print(Yes)
      exit
    if result < X[1]:
      turtle += 1
      crane -= 1
      

Fixed submission:
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
  b = X - a
  if 2 * a + 4 * b == Y:
    ans = 'Yes'
    print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

X,N = map(int,input().split())
P = list(map(int,input().split()))
if X < 1 or 100 < X:
    sys.exit()
if N < 0 or 100 < N:
    sys.exit()
if N == 0:
    print(X)
    sys.exit()

P_number = len(P)
if P_number < 1 or 100 < P_number:
    sys.exit()

res1 = 100
res2 = 100
res0 = 0
i = 0
while i < N:
    if !((X - i) in P):
        res1 = (X - i)
    i += 1
while j < N:
    if !((X + j) in P):
        res2 = (X + j)
    j += 1
if res2 > res1:
    res0 = res1
else if res1 > res2:
    res0 = res2
else if res2 == res1:
    res0 = res1
print(res0)


Fixed submission:
import sys

X,N = map(int,input().split())
P = list(map(int,input().split()))
if X < 1 or 100 < X:
    sys.exit()
if N < 0 or 100 < N:
    sys.exit()
if N == 0:
    print(X)
    sys.exit()

P_number = len(P)
if P_number < 1 or 100 < P_number:
    sys.exit()

res1 = 100
res2 = 100
res0 = 0
i = 0
j = 0
while i <= N:
    if (X - i) not in P:
        res1 = (X - i)
        break
    i += 1
while j <= N:
    if (X + j) not in P:
        res2 = (X + j)
        break
    j += 1
if i > j:
    res0 = res2
elif j > i:
    res0 = res1
elif i == j:
    res0 = res1
print(res0)

Buggy python submission (verdict: Runtime Error):
import sys

X,N = map(int,input().split())
P = list(map(int,input().split()))
if X < 1 or 100 < X:
    sys.exit()
if N < 0 or 100 < N:
    sys.exit()
P_number = count(P)
if P_number < 1 or 100 < P_number:
    sys.exit()

res = 100
count = 0
while i < N:
    if res > abs(X - P[i]):
        res = X - P[i] 
print(res)

Fixed submission:
import sys

X,N = map(int,input().split())
P = list(map(int,input().split()))
if X < 1 or 100 < X:
    sys.exit()
if N < 0 or 100 < N:
    sys.exit()
if N == 0:
    print(X)
    sys.exit()

P_number = len(P)
if P_number < 1 or 100 < P_number:
    sys.exit()

res1 = 100
res2 = 100
res0 = 0
i = 0
j = 0
while i <= N:
    if (X - i) not in P:
        res1 = (X - i)
        break
    i += 1
while j <= N:
    if (X + j) not in P:
        res2 = (X + j)
        break
    j += 1
if i > j:
    res0 = res2
elif j > i:
    res0 = res1
elif i == j:
    res0 = res1
print(res0)
Buggy python submission (verdict: Runtime Error):
import sys
A,B = map(int,input())
if not ( 1 <= A <= 100 and 1 <= B <= 100 ): sys.exit()

print(A*B)

Fixed submission:
import sys
A,B = map(int,input().split())
if not ( 1 <= A <= 100 and 1 <= B <= 100 ): sys.exit()

print(A*B)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
array = list(map(int,input().split()))

if not ( 2 <= N <= 10**5 ): sys.exit()
if not ( 0 <= min(array) and max(array) <= 10**18): sys.exit()

sum = array[0]
for I in range(1,len(array)):
    sum *= array[I]
print(sum) if sum <= 10**18 else print(-1)

Fixed submission:
import sys
N = int(input())
array = list(map(int,input().split()))

if not ( 2 <= N <= 10**5 ): sys.exit()
if not ( 0 <= min(array) and max(array) <= 10**18): sys.exit()
if 0 in array: print(0); sys.exit()

sum = array[0]
for I in range(1,len(array)):
    sum *= array[I]
    if sum > 10**18: print(-1);sys.exit()
print(sum)
Buggy python submission (verdict: Runtime Error):
import sys
S = input()

if not ( len(S) == 3 and ( "A" in S or "B" in S)): sys.exit()

print('No') if S = 'AAA' or S = 'BBB' else print('Yes')

Fixed submission:
import sys
S = input()

if not ( len(S) == 3 and ( "A" in S or "B" in S)): sys.exit()

print('No') if S == 'AAA' or S == 'BBB' else print('Yes')
Buggy python submission (verdict: Runtime Error):
import sys
N,A,B = map(int,input().split())

if not ( 1 <= N <= 10**18 and 0 <= A and 0 <= B and 0 < A + B <= 10**18 ): sys.exit()
if not ( isinstance(N,int) and isinstance(A,int) and isinstance(B,int) ): sys.exit()

count = 0
while N >= 0:
    if N <= A:
        remind = N
        break
    N -= A+B
    count += 1
print(count * A + remind)

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

if not ( 1 <= N <= 10**18 and 0 <= A and 0 <= B and 0 < A + B <= 10**18 ): sys.exit()
if not ( isinstance(N,int) and isinstance(A,int) and isinstance(B,int) ): sys.exit()

count = N // (A+B)
remind = N % (A+B) if N % (A+B) <= A else A
    
print(count * A + remind)
Buggy python submission (verdict: Runtime Error):
import sys
import string
import itertools
N = int(input())
S = list(input())
array = string.ascii_uppercase

for I in S:
    if array.index(I) + N <= 25:
        print(array[array.index(I) + N],end='')
    else:
        print(array[(array.index(I) + N) - 25],end='')
print('\n')

Fixed submission:
import sys
import string
N = int(input())
S = input()
s = list(S)
array = string.ascii_uppercase

if not ( 0 <= N <= 26 ): sys.exit()
if not ( 1 <= len(s) <= 10**4 ): sys.exit()
if not S.isupper(): sys.exit()

for I in s:
    if array.index(I) + N <= 25:
        print(array[array.index(I) + N],end='')
    else:
        print(array[(array.index(I) + N) - 26],end='')

Buggy python submission (verdict: Runtime Error):
import sys
import string
import itertools
N = int(input())
S = list(input())
array = string.ascii_uppercase

for I in S:
    if array.index(I) + N <= 25:
        print(array[array.index(I) + N],end='')
    else:
        print(array[(array.index(I) + N) - 25],end='')

Fixed submission:
import sys
import string
N = int(input())
S = input()
s = list(S)
array = string.ascii_uppercase

if not ( 0 <= N <= 26 ): sys.exit()
if not ( 1 <= len(s) <= 10**4 ): sys.exit()
if not S.isupper(): sys.exit()

for I in s:
    if array.index(I) + N <= 25:
        print(array[array.index(I) + N],end='')
    else:
        print(array[(array.index(I) + N) - 26],end='')