Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import collections

N=int(input())
S=[]
for i in range(N):
    S.append(sorted(input()))

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

print(ans)


Fixed submission:
N = int(input())

S = []
for i in range(N):
    S.append(input())

count = {}
ans = 0

for s in S:
    s=str(sorted(s))
    if s in count:
        count[s] += 1
    else:
        count[s] = 1

ans = 0
for c in count.values():
    ans += c*(c-1)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections

N=int(input())
S=[]
for i in range(N):
    S.append(input())

ans = 0
for j in range(N-1):
    for k in range(j+1, N):
        if (collections.Counter(S[j]) == collections.Counter(S[k])):
            ans += 1

print(ans)


Fixed submission:
N = int(input())

S = []
for i in range(N):
    S.append(input())

count = {}
ans = 0

for s in S:
    s=str(sorted(s))
    if s in count:
        count[s] += 1
    else:
        count[s] = 1

ans = 0
for c in count.values():
    ans += c*(c-1)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections

N=int(input())
S=[]
for i in range(N):
    S.append(input())

ans = 0
for j in range(N-1):
    for k in range(j+1, N):
        if (collections.Counter(S[j]) == collections.Counter(S[k])):
            ans += 1

print(ans)


Fixed submission:
N = int(input())

S = []
for i in range(N):
    S.append(input())

count = {}
ans = 0

for s in S:
    s=str(sorted(s))
    if s in count:
        count[s] += 1
    else:
        count[s] = 1

ans = 0
for c in count.values():
    ans += c*(c-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

N = int(input())
H = list(map(int, input().split()))

for i in range(N-1):
    if (H[i] > H[i+1]):
        H[i] -= 1
    

for j in range(N):
    if (H[j] > H[i+1]):
        print('No')
        sys.exit()
        
print('Yes')

Fixed submission:

N = int(input())
H = list(map(int, input().split()))

for i in range(N-1):
    if (H[i] < H[i+1]):
        H[i+1] -= 1
    

for j in range(N-1):
    if (H[j] > H[j+1]):
        print('No')
        exit()

print('Yes')
Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D = map(int, input().strip().split())

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

ans = 0
lcm = lcm_base(C,D)
c_num = B//C - (A-1)//C 
d_num = B//D - (A-1)//D
diff = B//lcm - (A-1)//lcm

print(B-A+1-(c_num+d_num-diff))


Fixed submission:
import math
import fractions

A,B,C,D = map(int, input().strip().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

ans = 0
lcm = lcm_base(C,D)
c_num = B//C - (A-1)//C 
d_num = B//D - (A-1)//D
diff = B//lcm - (A-1)//lcm

print(B-A+1-(c_num+d_num-diff))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = []
B = []
for i in range(N):
    a,b=map(int, input().split()) 
    A.append(a)
    B.append(b)
    tasks = dict(zip(range(N),B))

sorted_tasks = sorted(tasks.items(), key=lambda x:x[1])

sum = 0
flg = False

for k, v in sorted_tasks:
    sum += A[k]
    if (sum > v):
        flg = True
        break

if (flg):
    print('No')
else:
    print('Yes')

Fixed submission:
N = int(input())

W=[[int(_) for _ in input().split()] for __ in range(N)]  

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

sum = 0
flg = False

for i in range(N):
    sum += W[i][0]
    if (sum > W[i][1]):
        flg = True
        break

if (flg):
    print('No')
else:
    print('Yes')

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

A = []
B = []
for i in range(N):
    a,b=map(int, input().split()) 
    A.append(a)
    B.append(b)
    tasks = dict(zip(range(N),B))

sorted_tasks = sorted(tasks.items(), key=lambda x:x[1])

sum = 0
flg = False

for k, v in sorted_tasks:
    sum += A[k]
    if (sum > v):
        flg = True
        break

if (flg):
    print('No')
else:
    print('Yes')

Fixed submission:
N = int(input())

W=[[int(_) for _ in input().split()] for __ in range(N)]  

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

sum = 0
flg = False

for i in range(N):
    sum += W[i][0]
    if (sum > W[i][1]):
        flg = True
        break

if (flg):
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int, input().split())
A = [int(input()) for i in range(M)]

mod=10**9+7
dp=[0]*(N+1)
dp[0]=1
for i in range(1,N+1):
    if i in A:
        continue
    if i==1:
        dp[1]=dp[0]
        continue
    dp[i]=dp[i-1]+dp[i-2]
    dp[i]%=mod
print(dp[N])

Fixed submission:
N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split())
a = [int(input()) for i in range(m)]

dp = [0] * (n+1)
dp[0] = 1
if (1 in a):
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2,n+1):
    if (i in a):
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2])%(10**9+7)

print(dp[n])

Fixed submission:
N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

dp = [0] * (n+1)
dp[0] = 1
if (1 in a):
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2,n+1):
    if (i in a):
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2])%(10**9+7)

print(dp[n])

Fixed submission:
N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

dp = [0] * (n+1)
dp[0] = 1
if (1 in a):
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2,n+1):
    if (i in a):
        dp[i] = 0
    else:
        dp[i] = (dp[i-1] + dp[i-2])%(10**9+7)

print(dp[n])

Fixed submission:
N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

dp = [0] * (n+1)
dp[0] = 1
if (1 in a):
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2,n+1):
    if (i in a):
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%(10**9+7))

Fixed submission:
N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print(dp[N])
Buggy python submission (verdict: Runtime Error):
n,a,b,c,d = map(int, input().split())
s = str(input())

a,b,c,d = a-1,b-1,c-1,d-1

cnt = 0
for i in range(a,max(c,d)+1):
    if s[i] == '#':
        cnt += 1
        if cnt >= 2:
            print('No')
            exit()
    else:
        cnt = 0

cnt = 0
if c > d:
    for i in range(b,d+1):
        if s[i] == '.':
            cnt += 1
            if cnt >= 3:
                if i-1 != d
                print('Yes')
                exit()
        else:
            cnt = 0
        if i == c:
            print('No')
            exit()
else:
    print('Yes')



Fixed submission:
n,a,b,c,d = map(int, input().split())
s = str(input())

a,b,c,d = a-1,b-1,c-1,d-1

cnt = 0
for i in range(a,max(c,d)+1):
    if s[i] == '#':
        cnt += 1
        if cnt >= 2:
            print('No')
            exit()
    else:
        cnt = 0

cnt = 0
if b >= 2:
    if s[b-2] == '.' and s[b-1] == '.':
        cnt = 2

if s[b-1] == '.':
    cnt = 1

if c > d:
    if s[d-1] == '.' and s[d+1] == '.':
        print('Yes')
        exit() 
    for i in range(b,d+1):
        if s[i] == '.':
            cnt += 1
            if cnt >= 3:
                print('Yes')
                exit()
        else:
            cnt = 0
        if i == d:
            print('No')
            exit()
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
import heapq 

N,M=map(int, input().split())
A=list(map(int, input().split()))
B = {}
C = {}
for i in range(M):
    B[i],C[i]=map(int, input().split())

high_scores = sorted(C.items(), key=lambda x:x[1], reverse=True)

heapq.heapify(A) 
for score in high_scores:
    num = B[score[0]]
    for i in range(num):
        min_num = heapq.heappop(A)
        heapq.heappush(A, max(min_num, score[1])) 

print(sum(A))

Fixed submission:
N,M=map(int, input().split())
A=list(map(int, input().split()))
B = {}
C = {}
for i in range(M):
    B[i],C[i]=map(int, input().split())

high_scores = sorted(C.items(), key=lambda x:x[1], reverse=True)

sum_b = 0
for score in high_scores:
    sum_b += B[score[0]]
    if N < sum_b:
        A += [score[1]] *  (B[score[0]]-sum_b+N)
        break
    else:
        A += [score[1]] *  B[score[0]]

A.sort(reverse=True)
A = A[:N]

print(sum(A))
Buggy python submission (verdict: Runtime Error):
N,Q=map(int, input().split())
S = input()

l = [0] * N
r = [0] * N

for i in range(Q):
    l[i], r[i] = map(int, input().split())

for j in range(Q):
    print(S[l[j]-1:r[j]].count('AC'))

Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
Buggy python submission (verdict: Runtime Error):
for i in range(N):
    A[i],B[i] = map(int, input().split())  

C = dict(zip(A,B))

c_sorted = sorted(C.items(), key=lambda x:x[0])

ans = 0
cnt = 0

for k,v in dict(c_sorted).items():
    cnt += v
    if (cnt < M):
        ans += k*v
    else:
        ans += (M-cnt+v) * k
        break
print(ans) 

Fixed submission:
N, M = map(int, input().split())
ABs = [tuple(map(int, input().split())) for _ in range(N)]
 
ABs.sort()
 
ans = 0
for A, B in ABs:
    ans += A * min(M, B)
    M -= min(M, B)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int, input().split())

ans = a
for i in range(a+1, b+1):
    ans = (ans ^ i)

print(ans)

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

def xor_solve(x):
    if x % 4 == 0:
        return x
    elif x % 4 == 1:
        return 1
    elif x % 4 == 2:
        return x+1
    else:
        return 0
        
print(xor_solve(b) ^ xor_solve(a-1))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [0] * N
for i in range(N):
    A[i] = int(input())

lst=sorted(set(A))

target = {}
for i in range(len(lst)):
    target[lst[i]] = i
    
for a in A:
    print(target[a])

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

ans = 0
while(max(H)>=0):
    ans +=1
    for i in range(N):
        H[i] -= 1
        if (H[i] >= 0):
            if (i>=1):
                if (H[i-1] < 0 and max(H[:i])>=0):
                    ans += 1

print(ans-1)
Buggy python submission (verdict: Runtime Error):
import math
N,K=map(int, input().split())
h = list(map(int, input().split())) 

dp = [float('inf')] * N
dp[0] = 0

for i in range(N-K):
    for j in range(1,K+1):
        if (i+j < N):
            dp[i+j]=min(dp[i+j], dp[i]+abs(h[i+j]-h[i]))

print(dp[N-1])

Fixed submission:
import math
N = int(input())
h = list(map(int, input().split())) 

dp = [0] * N
dp[0] = 0
dp[1] = abs(h[1]-h[0])
 
for i in range(2,N):
    dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))

print(dp[N-1])
Buggy python submission (verdict: Time Limit Exceeded):
import math
N,K=map(int, input().split())
h = list(map(int, input().split())) 

dp = [float('inf')] * N
dp[0] = 0

for i in range(N):
    for j in range(1,K+1):
        if (i+j < N):
            dp[i+j]=min(dp[i+j], dp[i]+abs(h[i+j]-h[i]))

print(dp[N-1])


Fixed submission:
import math
N,K=map(int, input().split())
h = list(map(int, input().split())) 

dp = [float('inf')] * N
dp[0] = 0

for i in range(N):
    for j in range(1,K+1):
        if (i+j < N):
            dp[i+j]=min(dp[i+j], dp[i]+abs(h[i+j]-h[i]))

print(dp[N-1])
Buggy python submission (verdict: Time Limit Exceeded):
import math
s = input()
t = input()

s_len = len(s)
t_len = len(t)

dp = [[0]*(t_len+1) for t_item in range(0, s_len+1)]


for i in range(1, s_len+1):
    for j in range(1, t_len+1):
        if (s[i-1] == t[j-1]):
            dp[i][j] = dp[i-1][j-1] + 1
        else :
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])

N=dp[s_len][t_len]
y=s_len
x=t_len
H=[]
while N>0:
    if dp[y][x-1]-dp[y][x]==0:
        x-=1
        continue
    if dp[y-1][x]-dp[y][x]==0:
        y-=1
        continue
    H.append(t[x-1])
    N-=1
    y-=1
    x-=1
print(''.join(H[::-1]))

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

s_len = len(s)
t_len = len(t)

dp = [[0]*(t_len+1) for t_item in range(0, s_len+1)]


for i in range(1, s_len+1):
    for j in range(1, t_len+1):
        if (s[i-1] == t[j-1]):
            dp[i][j] = dp[i-1][j-1] + 1
        else :
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])

N=dp[s_len][t_len]
y=s_len
x=t_len
H=[]
while N>0:
    if dp[y][x-1]-dp[y][x]==0:
        x-=1
        continue
    if dp[y-1][x]-dp[y][x]==0:
        y-=1
        continue
    H.append(t[x-1])
    N-=1
    y-=1
    x-=1
print(''.join(H[::-1]))
Buggy python submission (verdict: Runtime Error):
C = [list(map(int,input().split())) for l in range(3)]

C = np.array(C)

cross1 = C[0][0] + C[1][1] + C[2][2]
cross2 = C[0][2] + C[1][1] + C[2][0]
if(cross1 == cross2 and np.sum(C)/6 == cross1/2):
    print('Yes')
else:
    print('No')

Fixed submission:
import math
import numpy as np
from fractions import gcd
import collections

C = [list(map(int,input().split())) for l in range(3)]

C = np.array(C)

cross1 = C[0][0] + C[1][1] + C[2][2]
cross2 = C[0][2] + C[1][1] + C[2][0]
if(cross1 == cross2 and np.sum(C)/6 == cross1/2):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))  

ans = 0
for i in range(n):
    if p[i] == i+1:
        ans += 1
        if i != n:
            p[i+1] = 0

print(ans)

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

ans = 0
for i in range(n):
    if p[i] == i+1:
        ans += 1
        if i != n-1:
            p[i+1] = 0


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())
A = [0] * M
B = [0] * M

for i in range(M):
    A[i],B[i] = map(int, input().split())

ans = 'IMPOSSIBLE'
for i in range(M):
    if(A[i] == 1):
        for j in range(M):
            if(B[i] == A[j] and B[j] == N):
                ans = 'POSSIBLE'
                break

print(ans)

Fixed submission:
N,M = map(int, input().split())
A = [0] * M
B = [0] * M

for i in range(M):
    A[i],B[i] = map(int, input().split())
aa = []
bb = []
for i in range(M):
    if(A[i] == 1):
        aa.append(B[i])
    if(B[i] == N):
        bb.append(A[i])

aa = set(aa)
bb = set(bb)
ret = aa & bb
if (len(ret) == 0):
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")
Buggy python submission (verdict: Runtime Error):
N = int(input())

print(math.ceil(N/11*2))

Fixed submission:
import math

N = int(input())

if (N%11 == 6):
    print(N//11*2+1)
else:
    print(math.ceil(N/11*2))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)
n=200
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans+=(gcd(i,j,k))
print(ans)

Fixed submission:
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
n=int(input())
ans = 0
for i in range(n):
    for j in range(i,n):
        for k in range(j,n):
            if i==j==k:
              ans+=gcd(i+1,j+1,k+1)
            elif i<j<k:
              ans+=6*(gcd(i+1,j+1,k+1))  
            else:
              ans+=3*(gcd(i+1,j+1,k+1))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
ans=0
for i in range(n-2):
  fir=s[i]
  for j in range(i+1,n-1):
    sec=s[j]
    if sec==fir:
      continue
    off=j-i
    for k in range(j+1,n):
      if k-j==off:
        continue
      thir=s[k]
      if (sec!=thir)and(thir!=fir):
        ans+=1
print(ans)

Fixed submission:
n=int(input())
s=input()
r=0
g=0
b=0
for i in range(n):
  if s[i]=="R":
    r+=1
  if s[i]=="G":
    g+=1 
  if s[i]=="B":
    b+=1 
ans=r*g*b
for i in range(n-2):
  for j in range(i+1,n-1):
    k=2*j-i
    if k>=n:
      continue
    if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
      ans-=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
ans=0
for i in range(n-2):
  fir=s[i]
  for j in range(i+1,n-1):
    sec=s[j]
    if sec==fir:
      continue
    off=j-i
    for k in range(j+1,n):
      if k-j==off:
        continue
      thir=s[k]
      if (fir!=sec)and(sec!=thir)and(thir!=fir):
        ans+=1
print(ans)

Fixed submission:
n=int(input())
s=input()
r=0
g=0
b=0
for i in range(n):
  if s[i]=="R":
    r+=1
  if s[i]=="G":
    g+=1 
  if s[i]=="B":
    b+=1 
ans=r*g*b
for i in range(n-2):
  for j in range(i+1,n-1):
    k=2*j-i
    if k>=n:
      continue
    if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
      ans-=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
ans=0
for i in range(n-2):
  fir=s[i]
  for j in range(i+1,n-1):
    sec=s[j]
    if sec==fir:
      continue
    off=j-i
    for k in range(j+1,n):
      if k-j==off:
        continue
      thir=s[k]
      if (fir!=sec)and(sec!=thir)and(thir!=fir):
        ans+=1
print(ans)

Fixed submission:
n=int(input())
s=input()
r=0
g=0
b=0
for i in range(n):
  if s[i]=="R":
    r+=1
  if s[i]=="G":
    g+=1 
  if s[i]=="B":
    b+=1 
ans=r*g*b
for i in range(n-2):
  for j in range(i+1,n-1):
    k=2*j-i
    if k>=n:
      continue
    if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
      ans-=1
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
if s[2]==s[3]&&s[4]==s[5]:
  print("Yes")
else:
  print("No")

Fixed submission:
s=input()
if (s[2]==s[3]) and (s[4]==s[5]):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,W=map(int,input().split())
dp=[[0]*(W+1) for _ in range(N+1)]
for i in range(1,N+1):
  w,v=map(int,input().split())
  for j in range(1,W+1):
    if j>=w:
      dp[i][j]=max(dp[i-1][j-w]+v,dp[i-1][j])
    else:
      dp[i][j]=dp[i-1][j]
print(dp[N][W])

Fixed submission:
N,W=map(int,input().split())
dp=[[0]*(W+1) for _ in range(N+1)]
for i in range(1,N+1):
  w,v=map(int,input().split())
  for j in range(1,W+1):
    if j>=w:
      dp[i][j]=max(dp[i-1][j-w]+v,dp[i-1][j])
    else:
      dp[i][j]=dp[i-1][j]
print(dp[N][W])
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=0
c=0
for i in range(n):
  if a[i]%2==0:
    if a[i]%4==0:
      c+=1
    else:
      b+=1
if b==0:
  print("Yes") if n<=3*c else print("No")
else:
  print("Yes") if n<=3c+b-1 else print("No")

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=0
c=0
for i in range(n):
  if a[i]%2==0:
    if a[i]%4==0:
      c+=1
    else:
      b+=1
if c==0:
  print("Yes") if n==b else print("No")
elif b==0:
  print("Yes") if n<=2*c+1 else print("No")
else:
  print("Yes") if n<=2*c+b else print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, s = map(int, input().split())
a = list(map(int, input().split()))

dp = [[0]*(s+1) for _ in range(n+1)]
mod = 998244353

dp[0][0] = 1
for i in range(n):
  for j in range(s+1):
    dp[i+1][j] += dp[i][j] * 2
    dp[i+1][j] %= mod
    if j+a[i] <= s:
      dp[i+1][j+a[i]] += dp[i][j]
      dp[i+1][j+a[i]] %= mod
      
print(dp[n][s])

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

dp = [[0]*(s+1) for _ in range(n+1)]
mod = 998244353

dp[0][0] = 1
for i in range(n):
  for j in range(s+1):
    dp[i+1][j] += dp[i][j] * 2
    dp[i+1][j] %= mod
    if j+a[i] <= s:
      dp[i+1][j+a[i]] += dp[i][j]
      dp[i+1][j+a[i]] %= mod
      
print(dp[n][s])
Buggy python submission (verdict: Runtime Error):
n, k = input().split()
n = int(n)
k = int(k)
p = list(map(int, input().split()))
q = [p[0]]
for i in range(n-1):
	q.append(q[i]+p[i+1])
r = []
for i in range(n-k):
	r.append(q[i+k]-q[i])
r.sort()
print((r[n-k-1]+k)/2)

Fixed submission:
n, k = input().split()
n = int(n)
k = int(k)
p = list(map(int, input().split()))
if n==k:
	print((sum(p)+n)/2)
else:
	q = [p[0]]
	for i in range(n-1):
		q.append(q[i]+p[i+1])
	r = []
	for i in range(n-k):
		r.append(q[i+k]-q[i])
	r.sort(reverse=True)
	print((r[0]+k)/2)
Buggy python submission (verdict: Runtime Error):
print("No" if int(input())*500<int(input()) else "yes")

Fixed submission:
k,x=map(int,input().split())
print("No" if k*500<x else "Yes")
Buggy python submission (verdict: Runtime Error):
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
print(alphabet[(alphabet.index(input())+n)%26])

Fixed submission:
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
for x in s:
  print(alphabet[(alphabet.index(x)+n)%26], end="")
print()