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

Fixed submission:
import sys

N, M = map(int, input().split())
ship = [[] for i in range(N+1)]

for i in range(M):
    a, b = map(int, input().split())
    ship[a].append(b)
    ship[b].append(a)

flag = 0
for i in ship[1]:
    if N in ship[i]:
        flag = 1
if flag == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import bisect
N, M = map(int, input().split())
a = []
number = []
flag = 0
for i in range(M):
    A, B = map(int, input().split())
    a.append([A, B])
    a.append([B, A])
    number.append(A)
    number.append(B)
a.sort()
b = a[:]
b.reverse()
one = []
two = []
for i in range(M):
    if a[i][0] == 1:
        one.append(a[i][1])
    else:
        break

for i in range(M):
    if b[i][0] == N:
        two.append(b[i][1])
    else:
        break

if len(intersect_list(one, two)) != 0:
    print("POSSIBLE")

else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import bisect
N, M = map(int, input().split())
a = []
number = []
flag = 0
for i in range(M):
    A, B = map(int, input().split())
    a.append([A, B])
    a.append([B, A])
    number.append(A)
    number.append(B)
a.sort()
b = a[:]
b.reverse()
one = []
two = []
for i in range(M):
    if a[i][0] == 1:
        one.append(a[i][1])
    else:
        break

for i in range(M):
    if b[i][0] == N:
        two.append(b[i][1])
    else:
        break



for i in range(len(one)):
    for j in range(len(two)):
        if one[i] == two[j]:
            flag = 1
            print("POSSIBLE")  
                break
    if flag == 1:
        break

if flag == 0:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import bisect
N, M = map(int, input().split())
a = []
number = []
flag = 0
for i in range(M):
    A, B = map(int, input().split())
    a.append([A, B])
    a.append([B, A])
    number.append(A)
    number.append(B)
a.sort()
b = a[:]
b.reverse()
one = []
two = []
for i in range(M):
    if a[i][0] == 1:
        one.append(a[i][1])
    else:
        break

for i in range(M):
    if b[i][0] == N:
        two.append(b[i][1])
    else:
        

###
#for i in range(len(one)):
#    for j in range(len(two)):
#        if one[i] == two[j]:
#            flag = 1
#            print("POSSIBLE")
#            break
#    if flag == 1:
#        break
###
if flag == 0:
    print("IMPOSSIBLE")
Problem p03662 (python)

Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
tree = [[] for i in range(N+1)]

for i in range(N-1):
    a, b = map(int, input().split())
    tree[a].append(b)
    tree[b].append(a)

dist_fennec = [100001] * (N+1)
dist_snuke = [100001] * (N+1)
q = [1]
dist_fennec[1] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_fennec[next] == 100001:
            dist_fennec[next] = dist_fennec[now] + 1
            q.append(next)

q = [N]
dist_snuke[N] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_snuke[next] == 100001:
            dist_snuke[next] = dist_snuke[now] + 1
            q.append(next)

fennec, snuke = 0, 0
for i in range(1, N+1):
    if dist_snuke[i] >= dist_fennec[i]:
        fennec += 1
    else:
        snuke += 1

if fennec > snuke:
    print("Fennec")
else:
    print("Snuke")

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N = int(input())
tree = [[] for i in range(N+1)]

for i in range(N-1):
    a, b = map(int, input().split())
    tree[a].append(b)
    tree[b].append(a)

dist_fennec = [100001] * (N+1)
dist_snuke = [100001] * (N+1)
q = [1]
dist[1] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_fennec[next] == 100001:
            dist_fennec[next] = dist_fennec[now] + 1
            q.append(next)

q = [N]
dist[N] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_snuke[next] == 100001:
            dist_snuke[next] = dist_snuke[now] + 1
            q.append(next)

fennec, snuke = 0, 0
for i in range(1, N+1):
    if dist_snuke[i] <= dist_fennec[i]:
        fennec += 1
    else:
        snuke += 1

if fennec > snuke:
    print("Fennec")
else:
    print("Snuke")
Problem p03674 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0]*(n+1)
for i in range(n+1):
    if b[a[i]] == 0:
        b[a[i]] += 1
    else:
        d = a[i]

l = 0
r = 0
c = 0
for i in range(n+1):
    if a[i] != d and c == 0:
        l += 1
    elif a[i] != d and c == 2:
        r += 1
    elif a[i] == d:
        c += 1


def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9 + 7
N = 100011
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

for i in range(1, n+2):
    print((cmb(n+1, i, mod)-cmb(r+l, i-1, mod))%mod)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = [0]*(n+1)
for i in range(n):
    if b[a[i]] == 0:
        b[a[i]] += 1
    else:
        d = a[i]

l = 0
r = 0
c = 0
for i in range(n+1):
    if a[i] != d and c == 0:
        l += 1
    elif a[i] != d and c == 2:
        r += 1
    if a[i] == d:
        c += 1


def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9 + 7
N = 100001
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


print(n)
for i in range(2, n+2):
    print(cmb(n+1, i, mod)-max(0, r-i+2)-max(0, l-i+2))
Problem p03699 (python)

Fixed submission:
N = int(input())
s = []
for i in range(N):
    s.append(int(input()))
stot = sum(s)
#i個のうちいくつか使ってjにできるか
dp = [[False for i in range(stot+101)] for j in range(N+1)]
dp[0][0] = True
for i in range(N):
    for j in range(stot):
        dp[i+1][j+s[i]] = dp[i][j] or dp[i+1][j+s[i]]
        dp[i+1][j] = dp[i][j] or dp[i+1][j]

ans = 0
for i in range(stot+1):
    if dp[N][i] and i % 10 != 0:
        ans = i
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = []
for i in range(N):
    s.append(int(input()))
stot = sum(s)
#i個のうちいくつか使ってjにできるか
dp = [[False for i in range(stot+101)] for j in range(N+1)]
dp[0][0] = True
for i in range(N):
    for j in range(stot):
        dp[i+1][j+s[i]] = dp[i][j] or dp[i+1][j+s[i]]
        dp[i+1][j] = dp[i][j] or dp[i+1][j]


for i in range(stot+1):
    if dp[N][i] and i % 10 != 0:
        ans = i
print(ans)
Problem p03719 (python)

Fixed submission:
A, B, C = map(int, input().split())
if A <= C and C <= B:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A, B, C = int(input().split())
if A <= C and C <= B:
    print("Yes")
else:
    print("No")
Problem p03721 (python)

Fixed submission:
N, K = map(int, input().split())
a = []
b = []
hairetu = []
for i in range(N):
    A, B = map(int, input().split())
    hairetu.append([A, B])

hairetu.sort()
for i in range(N):
    K -= hairetu[i][1]
    if K <= 0:
        print(hairetu[i][0])
        break

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
number = [0 for i in range(N+1)]
for i in range(N):
  a, b = map(int, input().split())
  number[a] += b
for i in range(N):
  if K - number[i+1] <= 0:
    print(i+1)
    break
  else:
    K -= number[i+1]

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
number = [0 for i in range(N+1)]
for i in range(N):
  a, b = map(int, input().split())
  number[a] += b
for i in range(N):
  if K - number[i+1] <= 0:
    print(i+1)
  else:
    K -= number[i+1]
Problem p03759 (python)

Fixed submission:
a, b, c = map(int, input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if b-a = c-b:
    print("YES")
else:
    print("NO")
Problem p03801 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
b = []
for i in range(N):
    b.append([a[i], i+1])
b.sort(reverse = True)
ans = [0]*(N+1)
mini = N+1

for i in range(N-1):
    mini = min(mini, b[i][1])
    if b[i+1][0] - b[i][0] < 0:
        ans[mini] += (b[i][0] - b[i+1][0])*(i+1)

ans[1] += N*b[-1][0]
for i in range(N):
    print(ans[i+1])

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
b = []
for i in range(N):
    b.append([a[i], i+1])
b.sort(reverse = True)
ans = [0]*(N+1)
mini = N+1

for i in range(N-1):
    mini = min(mini, b[i][1])
    if b[i+1][0] - b[i][0] < 0:
        ans[mini] += (b[i][0] - b[i+1][0])*(i+1)

ans[1] += N*min(b)
for i in range(N):
    print(ans[i+1])
Problem p03844 (python)

Fixed submission:
A, op, B = input().split()
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
A, op, B = map(int,input().split())
if op == '+':
    print(A+B)
else:
    print(A-B)
Problem p03846 (python)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
A.sort()
A = collections.Counter(A)

ans = 1
count = 0
if N == 1:
    if A[0] == 1:
        ans = 1
    else:
        ans = 0

elif N % 2 == 0:
    for i in range(1, int(N/2)+1):
        if A[i*2-1] == 2:
            count += 1
        else:
            ans = 0
else:
    if A[0] == 1:
        for i in range(1, int(N/2)+1):
            if A[i*2] == 2:
                count += 1

            else:
                ans = 0
    else:
        ans = 0
for i in range(count):
    ans *= 2
    ans %= 1000000007
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A = list(map(int,input().split()))
A.sort()
A = collections.Counter(A)

ans = 1
count = 0
if N == 1:
    if A[0] == 0:
        ans = 1
    else:
        print(0)

if N % 2 == 0:
    for i in range(1, int(N/2)+1):
        if A[i*2-1] == 2:
            count += 1
        else:
            ans = 0
else:
    if A.count(0) == 1:
        for i in range(1, int(N/2)+1):
            if A[i*2] == 2:
                count += 1

            else:
                ans = 0
    else:
        ans = 0
for i in range(count):
    ans *= 2
    ans %= 1000000007
print(ans)
Problem p03966 (python)

Fixed submission:
N = int(input())
x, y = 1, 1
for i in range(N):
  a, b = map(int, input().split())
  mul = max((x+a-1)//a, (y+b-1)//b)
  x = mul*a
  y = mul*b
print(x+y)

Buggy submission (verdict: Runtime Error):
N = int(input())
x, y = 0
for i in range(N):
  a, b = map(int, input().split())
  mul = max((x-1)//a+1, (y-1)//b+1)
  x = mul*a
  y = mul*b
print(x+y)
Problem p03971 (python)

Fixed submission:
N, A, B = map(int, input().split())
S = input()
a = 0
b = 0
for i in range(N):
  if S[i] == 'a' and a+b < A+B:
    a += 1
    print('Yes')
  elif S[i] == 'b' and a+b < A+B and b < B:
    b += 1
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
S = input()
a = 0
b = 0
for i in range(S):
  if S[i] == 'a' and a+b < A+B:
    a += 1
    print('Yes')
  elif S[i] == 'b' and a+b < A+B and b < B:
    print('Yes')
  else:
    print('No')
Problem p04034 (python)

Fixed submission:
N, M = map(int, input().split())
red = [False for i in range(N+1)]
red[1] = True
box = [1 for i in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    if red[x]:
        red[y] = True
    box[x] -= 1
    box[y] += 1
    if box[x] == 0:
        red[x] = False

ans = 0
for i in range(1, N+1):
    if red[i] and box[i] > 0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
red = [False for i in range(N+1)]
red[1] = True
box = [1 for i in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    if red[x]:
        red[y] = True
    box[x] -= 1
    box[y] += 1
    if box[i] == 0:
        red[x] = False

ans = 0
for i in range(1, N+1):
    if red[i] and box[i] > 0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
red = [False for i in range(N+1)]
red[1] = True
box = [1 for i in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    if red[x]:
        red[y] = True
    box[x] -= 1
    box[y] += 1
    if box[i] == 0:
        red[i] = False

ans = 0
for i in range(1, N+1):
    if red[i] and box[i] > 0:
        ans += 1
print(ans)
Problem p02556 (python)

Fixed submission:

n=int(input())
lx=[]
ly=[]
for i in range(n):
  x,y=map(int,input().split())
  lx.append(x+y)
  ly.append(x-y)
ax,bx,ay,by=max(lx),min(lx),max(ly),min(ly)
print(max(ax-bx,ay-by))

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
lx=[]
ly=[]
for i in range(n):
  x,y=map(int,input().split())
  lx.append(x+y)
  ly.append(x-y)
ax,bx,ay,by=max(lx),min(lx),max(ly),min(ly)
print(max(ax-bx,ay-by))
Problem p02573 (python)

Fixed submission:
n,m=map(int,input().split())
p=[(i,1)for i in range(n)]
def find(i):
  if p[i][0]==i:return i
  else:
    c=find(p[i][0])
    p[i]=(c,0)
    return c
def union(i,j):
  pi=find(i)
  pj=find(j)
  if not pi==pj:
    if p[pi][1]>p[pj][1]:
      p[pi]=(pi,p[pi][1]+p[pj][1])
      p[pj]=(pi,0)
    else:
      p[pj]=(pj,p[pi][1]+p[pj][1])
      p[pi]=(pj,0)
      

for i in range(m):
  a,b=map(int,input().split())
  union(a-1,b-1)
ans=0
for i in range(n):
  if p[i][0]==i:ans=max(ans,p[i][1])
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
p=[(i,1)for i in range(n)]
def find(i):
  if p[i][0]==i:return i
  else:
    c=find(p[i])
    p[i]=(c,0)
    return c
def union(i,j):
  pi=find(i)
  pj=find(j)
  if not pi==pj:
    if p[pi][1]>p[pj][1]:
      p[pj]=(pi,p[pi][1]+p[pj][1])
    else:
      p[pi]=(pj,p[pi][1]+p[pj][1])

for i in range(m):
  a,b=map(int,input().split())
  union(a-1,b-1)
ans=0
for i in range(n):
  if p[i][0]==i:ans=max(ans,p[i][1])
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
p=[(i,1)for i in range(n)]
def find(i):
  if p[i][0]==i:return i
  else:
    c=find(p[i][0])
    p[i]=(c,0)
    return c
def union(i,j):
  pi=find(i)
  pj=find(j)
  if not pi==pj:
    if p[pi][1]>p[pj][1]:
      p[pi]=(pi,p[pi][1]+p[pj][1])
      p[pj]=(pi,0)
    else:
      p[pj]=(pj,p[pi][1]+p[pj][1])
      p[pi]=(pj,0)
      

for i in range(m):
  a,b=map(int,input().split())
  union(a,b)
ans=0
for i in range(n):
  if p[i][0]==i:ans=max(ans,p[i][1])
print(ans)
Problem p02584 (python)

Fixed submission:
x,k,d=map(int,input().split())
xa=abs(x)
kz=xa//d
xz=xa-kz*d

if xz*2>d:
  xzz=d-xz
  kz+=1
else:
  xzz=xz
rest=k-kz
if rest<0:
  print(xa-k*d)
elif rest%2==0:
  print(xzz)
else:
  print(d-xzz)

Buggy submission (verdict: Runtime Error):
x,k,d=map(int,input().split())
xa=abs(x)
pm=x//xa
kz=xa//d
xz=xa-kz*d
if xz*2>d:
  xzz=d-xz
  kz+=1
else:
  xzz=xz
rest=k-kz
if rest%2==0:
  print(xzz)
else:
  print(d-xzz)
Problem p02731 (python)

Fixed submission:
n=int(input())
print((n/3)**3)

Buggy submission (verdict: Runtime Error):
n=input()
print((n/3)**3)
Problem p02788 (python)

Fixed submission:
import math
N,D,A=map(int,input().split())
l=[]
for i in range(N):
  k=list(map(int,input().split()))
  l.append(k)
l.sort()
S=[0]*N
ma=[0]*N
tmp=N-1
for i in reversed(range(N)):
  x=l[i][0]
  for j in reversed(range(0,tmp)):
    if abs(l[j][0]-(x-D))>D:
      ma[i]=j+1
      tmp=j+1
      break
  else:
    ma[i]=0
    tmp=0
ans=0
S[0]=math.ceil(l[0][1]/A)
for i in range(1,N):
  h=l[i][1]
  left=S[ma[i]-1] if ma[i]>0 else 0
  right=S[i-1]
  sum_=(right-left)*A
  if h<=sum_:
    S[i]=S[i-1]
    continue
  time=math.ceil((h-sum_)/A)
  S[i]=time+S[i-1]
print(S[N-1])

Buggy submission (verdict: Runtime Error):
import math
N,D,A=map(int,input().split())
l=[]
for i in range(N):
  k=tuple(map(int,input().split()))
  l.append(k)
l.sort(key=itemgetter(0))
S=[0]*N
ma=[0]*N
tmp=N-1
for i in reversed(range(N)):
  x=l[i][0]
  for j in reversed(range(0,tmp)):
    if abs(l[j][0]-(x-D))>D:
      ma[i]=j+1
      tmp=j+1
      break
  else:
    ma[i]=0
    tmp=0
ans=0
S[0]=math.ceil(l[0][1]/A)
for i in range(1,N):
  h=l[i][1]
  left=S[ma[i]-1] if ma[i]>0 else 0
  right=S[i-1]
  sum_=(right-left)*A
  if h<=sum_:
    S[i]=S[i-1]
    continue
  time=math.ceil((h-sum_)/A)
  S[i]=time+S[i-1]
print(S[N-1])

Buggy submission (verdict: Runtime Error):
import math
N,D,A=map(int,input().split())
l=[]
for i in range(N):
  x,h=map(int,input().split())
  l.append((x<<30)+h)
l.sort()
S=[0]*N
ma=[0]*N
tmp=N-1
for i in reversed(range(N)):
  x=l[i]>>30
  for j in reversed(range(0,tmp)):
    if abs(l[j]>>30-(x-D))>D:
      ma[i]=j+1
      tmp=j+1
      break
  else:
    ma[i]=0
    tmp=0
ans=0
S[0]=math.ceil(l[0]&(2**30-1)/A)
for i in range(1,N):
  h=l[i]&(2**30-1)
  left=S[ma[i]-1] if ma[i]>0 else 0
  right=S[i-1]
  sum_=(right-left)*A
  if h<=sum_:
    S[i]=S[i-1]
    continue
  time=math.ceil((h-sum_)/A)
  S[i]=time+S[i-1]
print(S[N-1])

Buggy submission (verdict: Runtime Error):
import math
N,D,A=map(int,input().split())
l=[]
for i in range(N):
  k=list(map(int,input().split()))
  l.append(k)
l.sort()
ans=0
for i in range(N):
  h=l[i][1]
  if h<=0:continue
  d=l[i][0]+D
  time=math.ceil(h/A)
  s=set()
  for j in range(i,n):
    if abs(d-l[j][0])<=D:
      s.add(j)
    else:break
  for k in s:
    l[k][1]-=time*A
  ans+=time
print(ans)

Buggy submission (verdict: Runtime Error):
import math
N,D,A=map(int,input().split())
l=[]
for i in range(N):
  k=list(map(int,input().split()))
  l.append(k)
l=l.sort()
ans=0
for i in range(N):
  h=l[i][1]
  if h<=0:continue
  d=l[i][0]+D
  time=math.ceil(h/A)
  s=set()
  for j in range(i,n):
    if abs(d-l[j][0])<=D:
      s.add(j)
    else:break
  for k in s:
    l[k][1]-=time*A
  ans+=time
print(ans)
Problem p02812 (python)

Fixed submission:
N=int(input())
S=input()
ans=0
for i in range(N):
    if S[i]=='A':
        if i+1<N and S[i+1]=='B':
            if i+2<N and S[i+2]=='C':
                ans+=1
print(ans)

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

Fixed submission:
s=int(input())
a=[0]*2001
x=(10**9)+7
if s<3:
    print(0)
    exit()

    
else:

    for i in range(3,6):
        a[i]=1

    for i in range(6,2001):
        a[i]=(sum(a[3:i-2])+1)%(x)

print(a[s])

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

a=list()
for i in range(n):

    a.append(list(map(int,input().strip().split())))
a=list(set(a))
ans=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        ans=max(ans,abs(a[i][0]-a[j][0])+abs(a[j][1],a[i][1]))

print(ans)
Problem p02582 (python)

Fixed submission:
a=input()
flag=False
ans=0
hold=0
for i in range(3):
    if a[i]=='R' and not flag:
        ans=1
        flag=not flag
        hold=max(hold,ans)

    elif a[i]=='R' and flag:
        ans+=1
        hold=max(hold,ans)

    else:
        ans=0
        flag=False


print(hold)

Buggy submission (verdict: Runtime Error):
a=input()
flag=False
ans=0
hold=0
for i in range(3):
    if a[i]=='R' and not flag:
        ans=1
        flag=not flag
        hold=max(hold,ans)

    elif a[i]=='R' and flag:
        ans+=1
        hold=max(hold,ans)

    else:
        ans=0
        flag=False


return(hold)

Buggy submission (verdict: Runtime Error):
s=input()
ans=0
flag=False
for i in a:
  if i=='R' and not flag:
    ans=1
    hold=ans
    
  if i=='R' and flag:
    ans+=1
    hold=ans
    
  else:
    ans=0
    flag=False
    
  return hold
Problem p02801 (python)

Fixed submission:
a = "abcdefghijklmnopqrstuvwxyz"
C = input()
print(a[a.index(C)+1])

Buggy submission (verdict: Runtime Error):
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
C = input()
print(a[a.index(C)+1])
Problem p02584 (python)

Fixed submission:
X, K, D = map(int, input().split())

X = abs(X)

K_main = X // D
K_sub = K - K_main

if (K_sub < 0):
  print(abs(X - D * K))
else:
  answer = abs(X - D * K_main)
  if (K_sub % 2 == 0):
    print(answer)
  else:
    print(abs(answer -D))

Buggy submission (verdict: Runtime Error):
X, K, D = map(int, input().split())

abs_num = abs(X)
counter = 0
d_p = D

while (X > d_p):
  d_p += D
  counter += 1

if (counter <= K):
  point = d_p % X
  print(min(abs(point-D), point))
else:
  d_p = D * counter
  print(X - d_p)
Problem p04043 (python)

Fixed submission:
a, b, c = (int(x) for x in input().split())

if (a + b + c) == 17:
  print("YES")
else:
  print("NO")

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

if (a + b + c) == 17:
  print("YES")
else:
  print("NO")

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

if (a + b + c) == 19:
  print("YES")
else:
  print("NO")
Problem p03352 (python)

Fixed submission:
X = int(input())
check =[]
check2=[]
for i in range(1,33):
    for s in range(2,11):
        check.append(pow(i,s))

#print(check)
for i in check:
    if i<=X:
        check2.append(i)
print(max(check2))

Buggy submission (verdict: Runtime Error):
X = int(input())
check =[]
check2=[]
for i in range(1,33):
    for s in range(2,11):
        check.append(pow(i,s))


for i in check:
    if i<X:
        check2.append(i)

print(max(check2))

Buggy submission (verdict: Runtime Error):
X = int(input())
check =[]
check2=[]
for i in range(1,33):
    for s in range(2,11):
        check.append(pow(i,s))
print(check)

for i in check:
    if i<X:
        check2.append(i)

print(max(check2))
Problem p03455 (python)

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

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

Buggy submission (verdict: Runtime Error):
a = input()
b= input()
x = a*b
def odd_even():
    if x%2==0:
        return "Even"
    else:
        return"Odd"
 
odd_even(x)

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

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

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

if x%2==0:
    print("Odd")
else:
    print("even")

Buggy submission (verdict: Runtime Error):
a = input()
b= input()
x = a*b
def odd_even():
    if x%2==0:
        return "Odd"
    else:
        return"Even"

odd_even(x)

Buggy submission (verdict: Runtime Error):
x = a*b
def odd_even():
    if x%2==0:
        return "Odd"
    else:
        return"Even"

odd_even(x)

Buggy submission (verdict: Runtime Error):
x = a*b
if x%2==0:
    print("Odd")
else:
    print("Even")
Problem p03493 (python)

Fixed submission:
x = str(input())
a =int(x[0])
b=int(x[1])
c=int(x[2])


print(a+b+c)

Buggy submission (verdict: Runtime Error):
x = str(input())
a =int(x[0])
b=int(x[1]9
c=int(x[2])


print(a+b+c)

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

print(a+b+c)

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = map(int,input().split())

check = s1+s2+s3
print(check)

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = map(int,input().split())

check = s1+s2+s3
if print(check)
Problem p03494 (python)

Fixed submission:
N  = int(input())
x = map(int,input().split())
count=0
check = 0
NEW_x=[]

def roop(N,x):
    global check
    global NEW_x
    for i in x:
        s = i//2
        if i%2==0:
            check +=1
            
            NEW_x.append(s)


        else:
            NEW_x.append(s)

roop(N,x)

while True:
  
    x = NEW_x
    NEW_x = []
    if check ==N:
        check=0
        count+=1
        roop(N,x)
    else:
        break

print(count)

Buggy submission (verdict: Runtime Error):
N  = int(input())
x = map(int,input().split())
count=0
check = 0
NEW_x=[]

def roop(N,x):
    global check
    global NEW_x
    for i in x:
        if i%2==0:
            check +=1
            s = i//2
            NEW_x.append(s)


        else:
            NEW_x.append(s)

roop(N,x)

while True:
  
    x = NEW_x
    NEW_x = []
    if check ==N:
        check=0
        count+=1
        roop(N,x)
    else:
        break

print(count)