TnT/CodeNet4Repair huggingface dataset:
Problem:
Give a pair of integers (A, B) such that A^5-B^5 = X. It is guaranteed that there exists such a pair for the given integer X.

Incorrect submission (verdict: Wrong Answer):
import numpy as np
X = int(input())

t = np.arange(-100000, 100000, 1)
t = t**2
S = set(t)

for B in range(-100000, 100001, 1):
    if X+B**5 in S:
        print("%d %d"%((X+B**5)**0.2, B))


Fixed, accepted submission:
import numpy as np
X = int(input())

t = np.arange(0, 2000001, 1)
t = t**5
S = set(t)

for B in range(0,200001,1):
    if X+B**5 in S:
        print("%d %d"%((X+B**5)**0.2, B))
        break
    if X-B**5 in S:
        print("%d %d"%((X-B**5)**0.2, -B))
        break
Problem:
Write a program to simulate rolling a dice, which can be constructed by the following net.                  As shown in the figures, each face is identified by a different label from 1 to 6.  Write a program which reads integers assigned to each face identified by the label and a sequence of commands to roll the dice, and prints the integer on the top face. At the initial state, the dice is located as shown in the above figures.

Incorrect submission (verdict: Wrong Answer):
all_list = list(map(int, input().split()))
shiji = list(input())
for x in range(len(shiji)):
    print(all_list)
    if shiji[x] == 'S':
        all_list[0], all_list[1], all_list[5], all_list[4] = all_list[1], all_list[5], all_list[4], all_list[0]
    elif shiji[x] == 'N':
        all_list[1], all_list[5], all_list[4], all_list[0] = all_list[0], all_list[1], all_list[5], all_list[4]
    elif shiji[x] == 'W':
        all_list[3], all_list[5], all_list[2], all_list[0] = all_list[0], all_list[3], all_list[5], all_list[2]
    elif shiji[x] == 'E':
        all_list[0], all_list[3], all_list[5], all_list[2] = all_list[3], all_list[5], all_list[2], all_list[0]

print(all_list[0])



Fixed, accepted submission:
r={'N':(1,5,2,3,0,4),'S':(4,0,2,3,5,1),'E':(3,1,0,5,4,2),'W':(2,1,5,0,4,3)}
d=input().split()
for x in input():
    d=[d[y]for y in r[x]]
print(d[0])
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):
a, b, c = map(int,input().split())
if a == 5 and b == 5 and c == 7:
    print('Yes')
elif a == 5 and b == 7 and c == 5:
    print('Yes')
elif a == 7 and b == 5 and c == 5:
    print('Yes')
else:
    print('No')


Fixed, accepted submission:
a, b, c = map(int,input().split())
if a == 5 and b == 5 and c == 7:
    print('YES')
elif a == 5 and b == 7 and c == 5:
    print('YES')
elif a == 7 and b == 5 and c == 5:
    print('YES')
else:
    print('NO')
Problem:
We have a sequence of length N, a = (a_1, a_2, ..., a_N). Each a_i is a positive integer.  Snuke's objective is to permute the element in a so that the following condition is satisfied:    * For each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.  Determine whether Snuke can achieve his objective.

Incorrect submission (verdict: Wrong Answer):
N=int(input())
A=list(map(int,input().split()))
Odd,Four=0,0
for a in A:
    if a%2==1:Odd+=1
    elif a%4==0:Four+=1
if Odd+Four==N and Odd-Four==1:print("Yes")
elif Odd<=Four:print("Yse")
else:print("No")

Fixed, accepted submission:
N=int(input())
A=list(map(int,input().split()))
Odd,Four=0,0
for a in A:
    if a%2==1:Odd+=1
    elif a%4==0:Four+=1
if Odd+Four==N and Odd-Four==1:print("Yes")
elif Odd<=Four:print("Yes")
else:print("No")
Problem:
Write a program which reads two integers a, b and an operator op, and then prints the value of a op b.  The operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.

Incorrect submission (verdict: Wrong Answer):
x = []

while True:
    x = input().split()
    if x[1] == "?":
        break 
    elif x[1] == "+":
        print(int(x[0]) + int(x[2]))
    elif x[1] == "-":
        print(int(x[0]) - int(x[2]))
    elif x[1] == "*":
        print(int(x[0]) * int(x[2]))
    elif x[1] == "/":
        print(int(x[0]) / int(x[2]))

Fixed, accepted submission:
x = []

while True:
    x = input().split()
    if x[1] == "?":
        break 
    elif x[1] == "+":
        print(int(x[0]) + int(x[2]))
    elif x[1] == "-":
        print(int(x[0]) - int(x[2]))
    elif x[1] == "*":
        print(int(x[0]) * int(x[2]))
    elif x[1] == "/":
        print(int(x[0]) // int(x[2]))
Problem:
You are given three integers A, B and C.  Determine if there exists an equilateral triangle whose sides have lengths A, B and C.

Incorrect submission (verdict: Wrong Answer):
a,b,c = map(int,input().split())
ans = "No"
if a==b==c:
    ans = "yes"
print(ans)

Fixed, accepted submission:
a,b,c = map(int,input().split())
ans = "No"
if a==b==c:
    ans = "Yes"
print(ans)
Problem:
There is a hotel with the following accommodation fee:    * X yen (the currency of Japan) per night, for the first K nights   * Y yen per night, for the (K+1)-th and subsequent nights  Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
print(X*N) if K < N else print(X*K + Y*(N-K)) 

Fixed, accepted submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
print(X*N) if K > N else print(X*K + Y*(N-K))
Problem:
There are N cities and M roads. The i-th road (1≤i≤M) connects two cities a_i and b_i (1≤a_i,b_i≤N) bidirectionally. There may be more than one road that connects the same pair of two cities. For each city, how many roads are connected to the city?

Incorrect submission (verdict: Wrong Answer):
#ABC061.B
N,M = map(int,input().split())
L = []
for i in range(M):
    a,b = map(int,input().split())
    L.append([a,b])
for m in range(N+1):
    ans = L.count(m)
    print(ans)

Fixed, accepted submission:
N , M = map(int,input().split())
L = []
for i in range(M):
    a,b = map(int,input().split())
    L.append(a)
    L.append(b)
for j in range(1,N+1):
    ans = L.count(j)
    print(ans)
Problem:
You are given an H × W grid.   The squares in the grid are described by H strings, S_1,...,S_H.   The j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \leq i \leq H,1 \leq j \leq W).   `.` stands for an empty square, and `#` stands for a square containing a bomb.  Dolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.   (Below, we will simply say "adjacent" for this meaning. For each square, there are at most eight adjacent squares.)   He decides to replace each `.` in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.  Print the strings after the process.

Incorrect submission (verdict: Wrong Answer):
h,w = map(int,input().split())
a = ["." for i in range(w+2)]
dot_map = [a]
for _ in range(h):
    l = list(input())
    l.insert(0, ".")
    l.append(".")
    dot_map.append(l)
dot_map.append(a)

for i in range(1, h+1):
    for j in range(1,w+1):
        if dot_map[i][j] == ".":
            counter = 0
            if dot_map[i-1][j-1] == "#":
                counter += 1
            if dot_map[i-1][j] == "#":
                counter += 1
            if dot_map[i-1][j+1] == "#":
                counter += 1
            if dot_map[i][j-1] == "#":
                counter += 1
            if dot_map[i][j+1] == "#":
                counter += 1
            if dot_map[i+1][j-1] == "#":
                counter += 1
            if dot_map[i+1][j] == "#":
                counter += 1
            if dot_map[i+1][j+1] == "#":
                counter += 1
            dot_map[i][j] = counter

for i in range(1, h+1):
    ans = dot_map[i]
    print(*ans[1:w+1])

Fixed, accepted submission:
h,w = map(int,input().split())
a = ["." for i in range(w+2)]
dot_map = [a]
for _ in range(h):
    l = list(input())
    l.insert(0, ".")
    l.append(".")
    dot_map.append(l)
dot_map.append(a)

for i in range(1, h+1):
    for j in range(1,w+1):
        if dot_map[i][j] == ".":
            counter = 0
            if dot_map[i-1][j-1] == "#":
                counter += 1
            if dot_map[i-1][j] == "#":
                counter += 1
            if dot_map[i-1][j+1] == "#":
                counter += 1
            if dot_map[i][j-1] == "#":
                counter += 1
            if dot_map[i][j+1] == "#":
                counter += 1
            if dot_map[i+1][j-1] == "#":
                counter += 1
            if dot_map[i+1][j] == "#":
                counter += 1
            if dot_map[i+1][j+1] == "#":
                counter += 1
            dot_map[i][j] = str(counter)

for i in range(1, h+1):
    ans = dot_map[i]
    print("".join(ans[1:w+1]))
Problem:
You are given nonnegative integers a and b (a ≤ b), and a positive integer x. Among the integers between a and b, inclusive, how many are divisible by x?

Incorrect submission (verdict: Wrong Answer):
from statistics import mean, median,variance,stdev
import sys
import math
import fractions
def j(a):
    if a==1: print("YES")
    else :print("NO")


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())



x,y,z = (int(i) for i in input().split())    





print((y-x+1)//z)

Fixed, accepted submission:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
from operator import itemgetter

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())

x,y,z= (int(i) for i in input().split())       









low = (x//z)*z
if low < x: low+=z
high = (y//z)*z
print((high - low)//z+1)
Problem:
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.    An example of a trapezoid  Find the area of this trapezoid.

Incorrect submission (verdict: Time Limit Exceeded):
sa = input()
sb = input()
sc = input()
turn = sa[0]
sa = sa[1:]
while True:
    if turn == 'a':
        if not sa:
            win = 'A'
            break
        else:
            turn = sa[0]
            sa = sa[1:]
    if turn == 'b':
        if not sb:
            win = 'B'
            break
        else:
            turn = sb[0]
            sb = sb[1:]
    if turn == 'c':
        if not sc:
            win = 'C'
            break
        else:
            turn = sc[0]
            sc = sc[1:]

Fixed, accepted submission:
a=int(input())
b=int(input())
h=int(input())
ans=(a+b)*h/2
print(int(ans))
Problem:
You are given an H × W grid.   The squares in the grid are described by H strings, S_1,...,S_H.   The j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \leq i \leq H,1 \leq j \leq W).   `.` stands for an empty square, and `#` stands for a square containing a bomb.  Dolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.   (Below, we will simply say "adjacent" for this meaning. For each square, there are at most eight adjacent squares.)   He decides to replace each `.` in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.  Print the strings after the process.

Incorrect submission (verdict: Wrong Answer):
H, W = map(int, input().split())
S = [[""]]*H
for i in range(H):
  S[i] = input()
print(S)

dh = [-1,-1,-1,0,0,1,1,1]
dw = [-1,0,1,-1,1,-1,0,1]

for i in range(H):
  for j in range(W):
    count=0
    if S[i][j]==".":
      for l in range(8):
        if H>i+dh[l]>-1 and W>j+dw[l]>-1:
          if S[i+dh[l]][j+dw[l]]=="#":
            count+=1
      S[i]=S[i][:j] + str(count) + S[i][j+1:]

for i in range(H):
  print(S[i])

Fixed, accepted submission:
H, W = map(int, input().split())
S = [[""]]*H
for i in range(H):
  S[i] = input()

dh = [-1,-1,-1,0,0,1,1,1]
dw = [-1,0,1,-1,1,-1,0,1]

for i in range(H):
  for j in range(W):
    count=0
    if S[i][j]==".":
      for l in range(8):
        if H>i+dh[l]>-1 and W>j+dw[l]>-1:
          if S[i+dh[l]][j+dw[l]]=="#":
            count+=1
      S[i]=S[i][:j] + str(count) + S[i][j+1:]

for i in range(H):
  print(S[i])
Problem:
You are given a string s. Among the **different** substrings of s, print the K-th lexicographically smallest one.  A substring of s is a string obtained by taking out a non-empty contiguous part in s. For example, if s = `ababc`, `a`, `bab` and `ababc` are substrings of s, while `ac`, `z` and an empty string are not. Also, we say that substrings are different when they are different as strings.  Let X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings. X is lexicographically larger than Y if and only if Y is a prefix of X or x_{j} > y_{j} where j is the smallest integer such that x_{j} \neq y_{j}.

Incorrect submission (verdict: Wrong Answer):
from collections import defaultdict

S = input()
K = int(input())

alphabet = defaultdict(list)
for i, s in enumerate(S):
    alphabet[s].append(i)

alpha_list = sorted(alphabet.keys())
cand = []
i = 0
while len(cand) < K:
    for j in alphabet[alpha_list[i]]:
        for l in range(1, len(S)-j+1):
            cand.append(S[j:j+l])
    i += 1
cand = sorted(cand)
print(cand[K-1])

Fixed, accepted submission:
# ABC 097 C
S = input()
K = int(input())

cand = []
for l in range(1, K+1):
    for i in range(len(S) - l + 1):
        cand.append(S[i:i+l])

cand = sorted(list(set(cand)))
print(cand[K-1])
Problem:
Write a program which computes the digit number of sum of two integers a and b.

Incorrect submission (verdict: Wrong Answer):
[print(i//10)for i in[sum(int(e)for e in ln.split())for ln in __import__("sys").stdin]]

Fixed, accepted submission:
[print(len(str(i)))for i in[sum(int(e)for e in ln.split())for ln in __import__("sys").stdin]]
Problem:
AtCoDeer has three cards, one red, one green and one blue.   An integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.   We will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer.   Is this integer a multiple of 4?

Incorrect submission (verdict: Wrong Answer):
r,g ,b=map(int,input().split())
A=100*r+10*g+b
if A%4==0:
    print("Yes")
else :
    print("No")

Fixed, accepted submission:
r,g ,b=map(int,input().split())
A=100*r+10*g+b
if A%4==0 :
    print("YES")
else :
    print("NO")
Problem:
Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).

Incorrect submission (verdict: Wrong Answer):
N, A, B=map(int, input().split())
ans=0
for i in range(1, N+1):
  s=str(i)
  x=0
  for j in s:
    x+=int(j)
    
  if A<=x<=B:
    ans+=1
    
print(ans)

Fixed, accepted submission:
N, A, B=map(int, input().split())
ans=0
for i in range(1, N+1):
  s=str(i)
  x=0
  for j in s:
    x+=int(j)
    
  if A<=x<=B:
    ans+=i
    
print(ans)
Problem:
Let's arrange a deck of cards. There are totally 36 cards of 4 suits(S, H, C, D) and 9 values (1, 2, ... 9). For example, 'eight of heart' is represented by H8 and 'one of diamonds' is represented by D1.  Your task is to write a program which sorts a given set of cards in ascending order by their values using the Bubble Sort algorithms and the Selection Sort algorithm respectively. These algorithms should be based on the following pseudocode:                 BubbleSort(C) 1 for i = 0 to C.length-1 2     for j = C.length-1 downto i+1 3         if C[j].value < C[j-1].value 4             swap C[j] and C[j-1]                 SelectionSort(C) 1 for i = 0 to C.length-1 2     mini = i 3     for j = i to C.length-1 4         if C[j].value < C[mini].value 5             mini = j 6     swap C[i] and C[mini]   Note that, indices for array elements are based on 0-origin.  For each algorithm, report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).

Incorrect submission (verdict: Wrong Answer):
def bubblesort(n, a):
    r = a[:]
    for i in range(n):
        for j in range(n-1, i, -1):
            if int(r[j][1]) < int(r[j-1][1]):
                r[j], r[j-1] = r[j-1], r[j]

    print(*r)
    print("Stable")


def selectionsort(n, a):
    r = a[:]
    ret = "Stable"
    for i in range(n):
        tmp = i
        for j in range(i, n):
            if int(r[j][1]) < int(r[tmp][1]):
                tmp = j
        r[i], r[tmp] = r[tmp], r[i]
        if r[i][0] != r[tmp][0] and int(r[i][1]) == int(r[tmp][1]):
            ret = "Not Stable"

    print(*r)
    print(ret)


def main():
    n = int(input())
    a = list(input().split())

    bubblesort(n, a)
    selectionsort(n, a)


if __name__ == '__main__':
    main()



Fixed, accepted submission:

def bubblesort(n, a):
    r = a[:]
    for i in range(n):
        for j in range(n-1, i, -1):
            if int(r[j][1]) < int(r[j-1][1]):
                r[j], r[j-1] = r[j-1], r[j]

    print(*r)
    print("Stable")


def selectionsort(n, a):
    r = a[:]
    ret = "Stable"
    for i in range(n):
        tmp = i
        for j in range(i, n):
            if int(r[j][1]) < int(r[tmp][1]):
                tmp = j
        r[i], r[tmp] = r[tmp], r[i]

    for i in range(n):
        for j in range(i+1, n):
            for k in range(n):
                for l in range(k+1, n):
                    if int(a[i][1]) == int(a[j][1]) and a[i] == r[l] and a[j] == r[k]:
                        ret = "Not stable"

    print(*r)
    print(ret)


def main():
    n = int(input())
    a = list(input().split())

    bubblesort(n, a)
    selectionsort(n, a)


if __name__ == '__main__':
    main()
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
a = int(input())

print(a % 1000)

Fixed, accepted submission:
a = int(input())

if a % 1000 == 0:
    print(0)
else:
    print(1000 - (a % 1000))
Problem:
Iroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.  She is shopping, and now paying at the cashier. Her total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).  However, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.  Find the amount of money that she will hand to the cashier.

Incorrect submission (verdict: Wrong Answer):
N, K = map(int, input().split())
D = list(map(int, input().split()))

L = [i for i in range(10) if i not in D]

A = [i for i in L]

for i in L:
  for j in L:
    A.append(10*i+j)
for  i in L:
  for j in L:
    for k in L:
      A.append(100*i+10*j+k)
for i in L:
  for j in L:
    for k in L:
      for l in L:
        A.append(1000*i+100*j+10*k+l)

for i in A:
  if i >= N:
    print(N)
    break

Fixed, accepted submission:
N, K = map(int, input().split())
D = list(map(int, input().split()))
L = [i for i in range(10) if i not in D]
A = []
for i in L:
  A.append(i)
for i in L:
  for j in L:
    A.append(10*i+j)
for  i in L:
  for j in L:
    for k in L:
      A.append(100*i+10*j+k)
for i in L:
  for j in L:
    for k in L:
      for l in L:
        A.append(1000*i+100*j+10*k+l)

for i in L:
  for j in L:
    for k in L:
      for l in L:
        for m in L:
          A.append(\
10000*i+1000*j+100*k+10*l+m)

for i in A:
  if i >= N:
    print(i)
    break
Problem:
Write a program which reads three integers a, b and c, and prints "Yes" if a < b < c, otherwise "No".

Incorrect submission (verdict: Wrong Answer):
lin = input()
l = lin.split(" ")
a = int(l[0])
b = int(l[1])
c = int(l[2])

if a < b < c:
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
lin = input()
l = lin.split(" ")
a = int(l[0])
b = int(l[1])
c = int(l[2])

if a < b < c:
    print('Yes')
else:
    print('No')
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
from collections import Counter


def main():

    N = int(input())
    lst = []

    for _ in range(N):
        lst.extend(input().split())

    c = dict(Counter(lst))


    for i in ["AC", "WA", "TLE", "RE"]:
        c.setdefault(i, 0)
        print(f"{i} × {c[i]}")


if __name__ == '__main__':
    main()


Fixed, accepted submission:
from collections import Counter


def main():

    N = int(input())
    lst = []

    for _ in range(N):
        lst.extend(input().split())

    c = dict(Counter(lst))


    for i in ["AC", "WA", "TLE", "RE"]:
        c.setdefault(i, 0)
        print(f"{i} x {c[i]}")


if __name__ == '__main__':
    main()
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):
L = list(map(int, input().split()))
L.sort()
print(L)
for i in range(2):
  if not L[i] == 5:
    print("NO")
    exit()
if not L[2] == 7:
  print("NO")
  exit()
print("YES")

Fixed, accepted submission:
L = list(map(int, input().split()))
L.sort()
for i in range(2):
  if not L[i] == 5:
    print("NO")
    exit()
if not L[2] == 7:
  print("NO")
  exit()
print("YES")
Problem:
There is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either `.` or `*`. The character representing the pixel at the i-th row from the top and the j-th column from the left, is denoted by C_{i,j}.  Extend this image vertically so that its height is doubled. That is, print a image with a height of 2H pixels and a width of W pixels where the pixel at the i-th row and j-th column is equal to C_{(i+1)/2,j} (the result of division is rounded down).

Incorrect submission (verdict: Wrong Answer):
import copy
h, w = list(map(int, input().split()))
p = [input().split() for _ in range(h)]
ans = copy.deepcopy(p)
for i in range(h):
  ans.insert(i*2, p[i])
for i in range(h*2):
  print(ans[i])

Fixed, accepted submission:
import copy
h, w = list(map(int, input().split()))
p = [input().split() for _ in range(h)]
ans = copy.deepcopy(p)
for i in range(h):
  ans.insert(i*2, p[i])
for i in range(h*2):
  print(ans[i][0])
Problem:
You are given a grid with 2 rows and 3 columns of squares. The color of the square at the i-th row and j-th column is represented by the character C_{ij}.  Write a program that prints `YES` if this grid remains the same when rotated 180 degrees, and prints `NO` otherwise.

Incorrect submission (verdict: Wrong Answer):
Ca=input()
Cb=input()
if Ca[0]==Cb[2] and Ca[1]==Cb[1] and Ca[2]==Cb[0]:
    print("Yes")
else:
    print("No")

Fixed, accepted submission:
Ca=input()
Cb=input()
if Ca[0]==Cb[2] and Ca[1]==Cb[1] and Ca[2]==Cb[0]:
    print("YES")
else:
    print("NO")