Problem:


Score : 100 points

Problem Statement

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.

Constraints

C_{i,j}(1 \leq i \leq 2, 1 \leq j \leq 3) is a lowercase English letter.

Input

Input is given from Standard Input in the following format:

C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}

Output

Print YES if this grid remains the same when rotated 180 degrees; print NO otherwise.

Sample Input 1

pot
top

Sample Output 1

YES

This grid remains the same when rotated 180 degrees.

Sample Input 2

tab
bet

Sample Output 2

NO

This grid does not remain the same when rotated 180 degrees.

Sample Input 3

eye
eel

Sample Output 3

NO



Sample input:
pot
top


Sample output:
YES

Submission status: Runtime Error

Solution code:
import sys
import math
import queue
import copy
import bisect#2分探索

def input():
    return sys.stdin.readline()[:-1]
def inputi():
    return int(input())
def inputl():
    return list(map(int, input().split()))
def printl(li):
    print(*li, sep="\n")
def argsort(s):
    return sorted(range(len(s)), key=lambda k: s[k])

#mod = 10**9+7

N = inputi()
#N, K = inputl()
#L = [int(input()) for i in range(N)]
A = inputl()
B = inputl()
C = inputl()
#S = [inputl() for i in range(H)]
#q = queue.Queue() #q.put(i) #q.get() 
#q = queue.LifoQueue() #q.put(i) #q.get() 

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b=copy.deepcopy(a)  #2次元配列はこうコピーする
#w.sort(key=lambda x:x[1],reverse=True)  #二個目の要素で降順並び替え

#素数リスト
# n = 100
# primes = set(range(2, n+1))
# for i in range(2, int(n**0.5+1)):
#     primes.difference_update(range(i*2, n+1, i))
# primes=list(primes)

#bisect.bisect_left(a, 4)#aはソート済みである必要あり。aの中から最も左の4位置を返す。
#bisect.insort_left(a, 4)#挿入
A.sort(reverse=True)
B.sort()
C.sort()
tot=0
cut=N

for a in A:
    cut=bisect.bisect_right(B[0:cut], a)
    cut2=N
    for i in reversed(range(cut,N)):
        b=B[i]
        cut2=bisect.bisect_right(C[0:cut2], b)
        tot+=N-cut2
print(tot)

Submission status: Runtime Error

Solution code:
S1=int(input())
S2=int(input())
if S1 == S2[2]+S2[1]+S2[0]:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)

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

def main():
    n = int(input())
    la = list(map(int, input().split()))
    lb = list(map(int, input().split()))
    lc = list(map(int, input().split()))
    
    la.sort()
    lb.sort()
    lc.sort()

    ans = 0
    for a in la:
        if a < lb[-1]:
            idxb = bisect.bisect_right(lb, a)
            for b in lb[idxb:]:
                if b < lc[-1]:
                    idxc = bisect.bisect_right(lc, b)
                    ans += (n - idxc)
    print(ans) 

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a = list(input())
b = list(input())
if a == reverse(b):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a = input().split()
b = input().split()
if a == reverse(b):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
c11, c12, c13 = map(int, input())
c21, c22, c23 = map(int, input())
if (c11 == c23) and (c12 == c22) and (c13 == c21):
 print("YES")
else:
 print("NO")

Submission status: Runtime Error

Solution code:
c11, c12, c13 = map(int, input())
c21, c22, c23 = map(int, input())
if (c11 == c23) and (c12 == c22) and (c13 == c21):
 print("YES")
else:
 print("NO")

Submission status: Runtime Error

Solution code:
#二分探索...ソートした配列を二つに分けて、どちらに入るか調べることで高速化
import bisect

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

#リストを整列する
a.sort()
b.sort()
c.sort()

#二分探索で、それぞれのbについて、a<bになるaの個数を調べる
#二分探索で、それぞれのbについて、c>bになるcの個数を調べる
ans = 0
for i in range(n):
	ab = bisect.bisect_left(a,b[i])	#a==bの場合を除外する
	tmpbc = bisect.bisect_right(c,b[i])#b==cの場合を一度含んでおく
	bc = n-tmpbc
	
	ans += ab*bc
	
print(ans)

Submission status: Runtime Error

Solution code:
a = input().split()
print('YES' if list(a[0]) == list(reversed(a[1])) else 'NO')

Submission status: Runtime Error

Solution code:
moziretu1 = input()
change_type = list(moziretu1)
a1 = change_type[0]
a2 = change_type[2]
b1 = change_type[3]
b2 = change_type[5]
c1 = change_type[1]
c2 = change_type[4]
list1 = print(b2,moziretu1[1],b1)
list2 = print(a2,moziretu1[4],a1)
if a1 == b2 and a2 == b1 and c1 == c2:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
print("6文字の言葉を造ってください")
moziretu1 = input()
change_type = list(moziretu1)
a1 = change_type[0]
a2 = change_type[2]
b1 = change_type[3]
b2 = change_type[5]
c1 = change_type[1]
c2 = change_type[4]
list1 = print(b2,moziretu1[1],b1)
list2 = print(a2,moziretu1[4],a1)
if a1 == b2 and a2 == b1 and c1 == c2:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
A = list(map(int,input().split()))
B = list(map(int,input().split()))
if A[0] == B[2] and A[1] == B[1] and A[2] == B[0]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
C1 = list(input().split())
C2 = list(input().split())

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
l = list(input().split())
if l[0] == l[1][::-1]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
l = list(input().split())
if l[0][0] == l[1][2] and l[0][1] == l[1][1] and l[0][2] == l[1][0]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
#二分探索
from bisect import bisect_left
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()

#3重を考えるとC<B<A
ans = 0
for i in range(N):
    M = bisect_left(B, C[i])
    if M == 0:
        continue
    #ans += M
    for j in range(M):
        ans += bisect_left(A,B[j])


print(ans)

Submission status: Runtime Error

Solution code:
C11, C12, C13 = map(str, input().split())
C21, C22, C23 = map(str, input().split())
if C11+C12+C13==C23+C22+C21:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
m = input().split()

a = m[0]

if a[::-1] == m[1]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
m = input().splilt()

a = m[0]

if a[::-1] == m[1]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a= (input()) 
b=(input()) 
if(a[0]==b[2] &&a[1] ==b[1] && a[2] ==b[0] ):
       print("Yes")
else:
        print ("No" )

Submission status: Runtime Error

Solution code:
a=list(map(input(). split() ) )
b=list(map(input(). split() ) )
if(a[0]==b[2]&&a[1] ==b[1] & & a[2] ==b[0] ):
       print ("Yes" )
else:
      print("No" )

Submission status: Runtime Error

Solution code:
a=list(map(input(). split() ) )
if(a[0]==a[5]&&a[1] ==a[4] & & a[2] ==a[3] ):
       print ("Yes" )
else:
print("No" )

Submission status: Runtime Error

Solution code:
a=list (map(input()) )
 if(a[0]==a[5] &&a[1]==a[4]&&a[2]==a[3]):
        print("Yes" )
else:
       print("No")

Submission status: Runtime Error

Solution code:
#include<string>
#include<iostream>
using namespace std;

int main () {
	string r1,r2;
	cin >> r1;
	cin >> r2;
	// A B C
	// D E F
	// Rotate 180 Degrees
	// FED, CBA?
	if (r2[2] == r1[0] && r2[1] == r1[1] && r2[0] == r1[2])
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	return 0;
}

Submission status: Runtime Error

Solution code:
a=[]
a[1]=[]
a[2]=[]
for i in range (3):
	a[1].append(input())
for i in range (3):
	a[2].append(input())
for i in range (3):
	if a[1][i]!=a[2][2-i]:		
		print("NO")
 		break
 	else:
 		if i==2:
 			print("YES")
  		continue

Submission status: Runtime Error

Solution code:
x,y,z = map(int, input().split())
ret = (x-z)//(y+z)
print(ret)

Submission status: Runtime Error

Solution code:
l = input().split()
m = input().split()
if l[0] == m[2] and l[2] == m[2] and l[1] == l[0]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
print(int(n**.5))

Submission status: Runtime Error

Solution code:
S=input()
T=input()
pront('YES' if S==T[::-1] else 'NO')

Submission status: Runtime Error

Solution code:
C=[list(input()) for i in range(2)]
if C[0]==reverse(C[1]):
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
C1 = input()
C2 = input()
C1_r = C1[2] + C1[1] + C1[0]
C1_r
print('YES' iC1 = input()

Submission status: Runtime Error

Solution code:
C1,C2 = input().split()
C1_reverse = C1[2] + C1[1] + C[0]
print('YES' if C1_reverse == C2 else 'NO')

Submission status: Runtime Error

Solution code:
c1=input()
c2=input()
c2.reverse()
if c1==c2:
    print("YES")
else:
    print("No")

Submission status: Runtime Error

Solution code:
C1 = input()
C2 = input()
C1s = sorted(C1, reversed=True)
C2s = sorted(C2, reversed=True)
if C1s == C2 and C2s == C1:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
c1, c2, c3 = input().split()
c4, c5, c6 = input().split()

if c1 == c6 and c2 == c5 and c3 == c4:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
a=input()
b=input()
ret='YES'
for i in range(3):
  if a[i]!=b[2-i]
    ret='NO'
    break
print(ret)

Submission status: Runtime Error

Solution code:
import math
x=int(input())
print(int(math.sqrt(x))**2)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
ans="NO"
if a==f and b==e and c==d:
  ans="YES"
print(ans)

Submission status: Runtime Error

Solution code:
a,b,c=map(str,input().split())
d,e,f=map(str,input().split())
ans="NO"
if a==f and b==e and c==d:
  ans="YES"
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
for i in range(0,n):
    if n==1 or n==2:
        print(n)
        break
    if n>=i*i:
        pass
    else:
        print((i-1)*(i-1))
        break

Submission status: Runtime Error

Solution code:
from collections import deque
n = int(input())
mins = [1000 for i in range(n+1)]
used = [0 for i in range(n+1)]
deq = deque()
deq.append((1,1))
while deq:
  x,cnt = deq.popleft()
  mins[x] = min(mins[x],cnt)
  used[x] = 1
  if used[10*x%n] == 0:
    deq.appendleft((10*x%n,cnt))
  if used[(x+1)%n] == 0:
    deq.append(((x+1)%n,cnt+1))
print(mins[0])

Submission status: Runtime Error

Solution code:
A=input().split()
B=input().split()
if A[0]==B[2] and A[1]==B[1] and A[2]==B[2]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
s = input()
i = input()
print("YES" if s==t[::-1] else "NO")

Submission status: Runtime Error

Solution code:
a, b, c = (i for i in input().split())
d, e, f = (i for i in input().split())

if a == f and b == e and c == d:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
a, b, c = (int(i) for i in input().split())
d, e, f = (int(i) for i in input().split())

if a == f and b == e and c == d:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
c1 = input()
c2 = input()

if c1 == c[2]+c[1]+c[0]:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
c1=input()
c2=input()
if c1[0]==c2[2],c1[1]==c2[1],c1[2]==c2[0]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
c11, c12, c13 = input().split()
c21, c22, c23 = input().split()

if c11==c23 and c12==c22 and c13==c21:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
c1 = input()
c2 = input()

print("YES" if c1 = c2[::-1] else "NO")

Submission status: Runtime Error

Solution code:
c1 = input()
c2 = input()

print("Yes" if c1 = c2[::-1] else "No")

Submission status: Runtime Error

Solution code:
c11, c12, c13 = int(input().split())
c21, c22, c23 = int(input().split())

if c11==c23 and c12==c22 and c13==c21:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
import math
s = int(input())
for i in range(s):
    if math.sqrt(s - i).is_integer():
        print(s - i)
        break

Submission status: Runtime Error

Solution code:
import bisect

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

count = 0
a1 = sorted(a)
b1 = sorted(b)
c1 = sorted(c)
for i in c1:
    prior_c = bisect.bisect_right(b1,i)
    prior_c_list = b1[:prior_c]
    for j in prior_c_list:
        count += bisect.bisect_right(a1,j)

print(count)

Submission status: Runtime Error

Solution code:
A = list(map(str, input().split()))
B = list(map(str, input().split()))

REA = (A[0] + A[1] + A[2])
REB = (A[2] + A[1] +A[0])

if REA == REB:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
A = [input() for _ in range(N)]
B = [input() for _ in range(N)]

REA = (A[0] + A[1] + A[2])
REB = (A[2] + A[1] +A[0])

if REA == REB:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
C11,C12,C13 = map(str, input().split())

C21,C22,C23= map(str, input().split())

hoge = (C13 + C12 + C11)
hoge2 =(C21 + C22 + C23)

if hoge == hpge2:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
from sys import stdin
s1 = (stdin.readline().rstrip())
s2 = int(stdin.readline().rstrip())
if s1 == s2[::-1]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
import bisect
point=0
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
for i in range(N):
  m=bisect.bisect_left(A,B[i])
  n=bisect.bisect_left(C,B[i])
  point+=m*n
print(point)

Submission status: Runtime Error

Solution code:
C = []
for i in range(2):
  C.append(list(int, input().split()))

if C[0][0] == C[1][2] and C[0][1] == C[1][1] and C[0][2] == C[1][0]:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
s,t=input()
if s[0]==t[2] and s[1]==t[1] and s[2]==t[0]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
s,t=input()
if s[0]==t[2] and s[1]==t[1] and s[2]=t[0]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
C = [input().split() for i in range(2)]
if C[0][0] == C[1][2] and C[0][1] == C[1][1] and C[0][2] == C[1][0]:
  print('YES')
else:print('NO')

Submission status: Runtime Error

Solution code:
C = [input().split() for i in range(2)]
if (C[0][0] == C[1][2]) and (C[0][1] == C[1][1]) and (C[0][2] == C[1][0]):
  print('YES')
else:print('NO')

Submission status: Runtime Error

Solution code:
c1 = input()
c2 = input()
c2.reverse()

if c1 == c2:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n = int(input())
print(int(n**.5)**2)

Submission status: Runtime Error

Solution code:
a=input()
b=input'()
print('YES' if a[-1::-1]==b else 'NO')

Submission status: Runtime Error

Solution code:
a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("YES")
else:
    priont("NO")

Submission status: Runtime Error

Solution code:
C11,C12,C13 = map(str, input().split())
C21,C22,C23 = map(str, input().split())

if C11==C23 & C12==C22 & C13==C21:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
N = int(input())
A = input()
B = input()
C = input()
A = sorted(list(map(int, A.strip("¥n").split(" "))))
B = sorted(list(map(int, B.strip("¥n").split(" "))))
C = sorted(list(map(int, C.strip("¥n").split(" "))))
l_a = len(A)
l_b = len(B)
l_c = len(C)
p_a = 0
p_b = 0
p_c = 0
ss = 0
for b in B:
  for i in range(p_a, l_a):
    if A[i] >= b:break
    p_a = i
  for i in range(p_c, l_c):
    p_c = i
    if C[i] > b:break
  s = (p_a + 1) * (l_c - p_c)
  ss += s
print (ss)

Submission status: Runtime Error

Solution code:
c = [input() for i in range(2)]
print("YES" if c[0] == c[1][::-1]) else "NO")

Submission status: Runtime Error

Solution code:
a = input()
b = input()
print('YES' if a==b[::-1])

Submission status: Runtime Error

Solution code:
c1 = input()
c2 = input()
print('Yes' if c1 == c2.reverse() else 'No')

Submission status: Runtime Error

Solution code:
import numpy as np
import bisect
n = int(input())
A = sorted(list(map(int, input().split())))
B = list(map(int, input().split()))
C = sorted(list(map(int, input().split())))

ans = 0
for b in B:
    ans += bisect.bisect_left(A, b) * (n - bisect.bisect_right(C, b))
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())))
B = np.array(list(map(int, input().split())))
C = np.array(list(map(int, input().split())))

ans = 0
for b in B:
    ans += sum(A < b) * sum(C > b)
print(ans)

Submission status: Runtime Error

Solution code:
l=[input() for i in range()]
print("YES" if l[0][0]==l[1][2] and l[0][1]==l[1][1] and l[0][2]==l[1][0] else "NO")

Submission status: Runtime Error

Solution code:
N = int(input())
# [exit(0) if i ** 2 > N else print(i ** 2) if (i+1) ** 2 > N else print("", end="") for i in range(1, N)]
for i in range(1, N):
    if i ** 2 > N:
        print((i - 1) ** 2)
        break
    if i ** 2 == N:
        print(i ** 2)
        break

Submission status: Runtime Error

Solution code:
import numpy as np
l = [list(input()) for i in range(2)]
arr = np.array(l)
if arr == np.rot90(arr,k=2):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
r1 = input()
r2 = reverse(input())
print("YES" if r1 == r2 else "NO")

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0

for i in range(1,n+1):
  if i**2 <= n:
    ans = i**2

print(ans)

Submission status: Runtime Error

Solution code:
    s=input()
    t=input()
    print("YES" if s==t[::-1] else "NO")

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(n**0.5)
print(int(m**2))

Submission status: Runtime Error

Solution code:
C=[input().split(),input().split()]
res='YES'
for i in range(3):
  if C[0][i]!=C[1][2-i]: res='NO'
print(res)

Submission status: Runtime Error

Solution code:
x,y=map(str,input().split())
X=x[::-1]
if X==y:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(sorted(map(int, input().split())))
B = list(sorted(map(int, input().split()))
C = list(sorted(map(int, input().split())))
 
import bisect
upper_condition = [bisect.bisect_left(A, b) for b in B]
lower_condition = [N - bisect.bisect_right(C, b) for b in B]
 
print(sum(map(lambda x: x[0]*x[1], zip(upper_condition, lower_condition))))

Submission status: Runtime Error

Solution code:
import numpy as np
 
N = int(input())
A = np.array(list(sorted(map(int, input().split()))), dtype=int)
B = np.array(list(sorted(map(int, input().split()))), dtype = int)
C = np.array(list(sorted(map(int, input().split()))), dtype = int)
 
upper_condition = np.array([1 + np.max(np.where(A < b)[0]) for b in B])
lower_condition = np.array([N - np.min(np.where(C > b)[0]) for b in B])
 
print(np.sum(upper_condition*lower_condition))

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
A = np.array(list(sorted(map(int, input().split()))), dtype=int)
B = np.array(list(sorted(map(int, input().split()))), dtype = int)
C = np.array(list(sorted(map(int, input().split()))), dtype = int)

upper_condition = np.array([1 + np.max(np.where(A < b)[0]) for b in B])
lower_condition = np.array([N - np.min(np.where(C > b)[0]) for b in B])

ret = np.sum(upper_condition*lower_condition)

Submission status: Runtime Error

Solution code:
C1=input()
C2=input()

if (C1[0]==C[2]) and (C1[0]==C2[2]) and (C1[1]==C2[1]):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
x = list(map(input().split()))
y = list(map(input().split()))

if x[0]==y[2] and x[1]==y[1] and x[2]==y[0]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
if input()[0]=input()[2]:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
import bisect

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

a.sort()
c.sort()

ans = 0

for i in b:
	ans += (bisect.bisect_left(a,i)) * (len(c) - bisect.bisect_right(c,i))

print(ans)

Submission status: Runtime Error

Solution code:
f = input()
s = input()
if list(s) == list(reversed(f)):
	print('YES')
else;
	print('NO')

Submission status: Runtime Error

Solution code:
f = input()
s = input()
if list(s) == list(reversed(f)):
  print('YES')
else;
  print('NO')

Submission status: Runtime Error

Solution code:
a,b,c=input().split()
d,e,f=input().split()
if a==f 
  if b==e:
    if c==d:
      print'YES'
    else:
      print'NO'
  else:
    print'NO'
else:
  print'NO'

Submission status: Runtime Error

Solution code:
a,b,c=input().split()
d,e,f=input().split()
if a==f and b==e and c==d:
  print'YES'
else:
  print'NO'

Submission status: Runtime Error

Solution code:
a,b,c=input().split()
d,e,f=input().split()
if a==f and b==e and c==d:
  print'Yes'
else:
  print'No'

Submission status: Runtime Error

Solution code:
def binary_search_A(N,A,b):
    upper = N - 1
    lower = 0
    
    while upper - lower > 1:
        middle = upper + lower // 2
        if A[middle] > b:
            upper = middle
        else:
            lower = middle
            
    if b >= A[upper]:
      return upper+1
    elif b >= A[lower]:
      return lower+1
    else:
      return lower

def binary_search_C(N,C,b):
    upper = N - 1
    lower = 0
    
    
    while upper - lower > 1:
        middle = upper + lower // 2
        if C[middle] > b:
            upper = middle
        else:
            lower = middle
            
            
    if b < C[lower]:
      return N-lower
    elif b < C[upper]:
      return N - (lower+1)
    else:
      return N - (upper+1)
    


N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
A.sort()
B.sort()
C.sort()

ans = 0

for i in range(N):
    j = binary_search_A(N, A, B[i])
    #print(j)
    k = binary_search_C(N, C, B[i])
    #print(k)
    ans += j * k
    
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
m=[s[0],s[1],s[2]]
a=m.reverce()
if str(a)==input():
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

if a == b[::-1]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

if a = b[::-1]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
a = input()
b = input()

if a == b.reverse():
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
a = input()
b = input()
if a = b.reverse():
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
def lower_elements(A, b):
    ''' リストAの要素のうち，b未満のものの個数を返す関数 '''
    lower_bound = -1
    upper_bound = len(A)
    while upper_bound - lower_bound > 1:
        middle = (lower_bound + upper_bound) // 2
        if A[middle] < b:
            lower_bound = middle
        else:
            upper_bound = middle
    return lower_bound + 1


def upper_elements(C, b):
    ''' リストCの要素のうち，cより大きいものの個数を返す関数 '''
    i = -1
    j = len(C)
    while j - i > 1:
        m = (i + j) // 2
        if C[m] > b:
            j = m
        else:
            i = m
    return len(C) - j


def answer(N, A, B, C):
    A.sort()
    B.sort()
    C.sort()
    count = 0
    for b in B:
        count += lower_elements(A, b) * upper_elements(C, b)
    return count


N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
print(answer(N, A, B, C))

Submission status: Runtime Error

Solution code:
from sys import stdin

a = list(map(char, input().split()))
b = list(map(char, input().split()))

def rot(a,b):
  if a[0] == b[2]:
    if a[1]==b[1]:
      if a[2]==b[0]:
        return 'YES'
  return 'NO'

print(rot(a,b))

Submission status: Runtime Error

Solution code:
from sys import stdin

a = list(map(char, input().split()))
b = list(map(char, input().split()))

def rot(a,b):
  if a[0] == b[2]:
    if a[1]==b[1]:
      if a[2]==b[0]:
        return 'YES'
  return 'NO'

rot(a,b)

Submission status: Runtime Error

Solution code:
a = {int(s) for s in input().split()}
b = {int(s) for s in input().split()}

c = 0
for i in range(3):
  if a[i] == b[2-i]:
    c += 1
  else:
    print('NO')
    break
    
if c == 2:
	print('YES')

Submission status: Runtime Error

Solution code:
import bisect
import numpy as np
n = int(input())
abc = [sorted(list(map(int, input().split()))) for i in range(3)]

unko = np.zeros(n)
for c in abc[2]:
  unko[:bisect.bisect_left(abc[1], c)] += 1
s = 0

for i in range(len(abc[1])):
  s += bisect.bisect_left(abc[0], abc[1][i])*unko[i]
  
print(int(s))

Submission status: Runtime Error

Solution code:
A=input()
B=input()
if A[0]=B[2] and A[1]=B[1] and A[2]=B[0]:
  print("YES")
else:print("NO")

Submission status: Runtime Error

Solution code:

def main():
    num = int(input())
    data_a = list(map(int, input().split()))
    data_a.sort()
    data_b = list(map(int, input().split()))
    data_b.sort()
    data_c = list(map(int, input().split()))
    data_c.sort()

    shita_b = [0 for i in range(num)]

    ind = 0
    for i in range(num):
        now_b = data_b[i]
        while data_c[ind] <= now_b:
            ind += 1
            if ind >= num:
                ind = num
                break
        if ind == num:
            break
        shita_b[i] = num - ind


    ans = 0
    tasu_now = sum(shita_b)
    ind = 0
    for i in range(num):
        now_a = data_a[i]
        while now_a >= data_b[ind]:
            tasu_now -= shita_b[ind]
            ind += 1
            if ind >= num:
                ind = num
                break
        if ind == num:
            break
        ans += tasu_now

    print(ans)



if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a = list(map(str, input().split()))
b = list(map(str, input().split()))
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
c1 = input()
c2 - input()

if c1[0]==c2[2] and c1[1]==c2[1] and c1[2]==c2[0] :
	print('YES')
	
else:
	print('NO')

Submission status: Runtime Error

Solution code:
c1 = input()
c2 - input()

if c1[0]==c2[2] and c1[1]=c2[1] and c1[2]==c2[0] :
	print('YES')
	
else:
	print('NO')

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main(){
  string c1,c2;
  cin >>c1>>c2;
  string c3=c1,c4=c2;
  reverse(c1.begin(),c1.end());
  reverse(c2.begin(),c2.end());
  if (c1==c4 and c2==c3) cout <<"YES"<<endl;
  else cout <<"NO"<<endl;
}

Submission status: Runtime Error

Solution code:
# sys.stdin.readline()
import sys
import math
input = sys.stdin.readline

bcd = input()
efg = input()
if b == g and c == f and d == e:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

Submission status: Runtime Error

Solution code:
C1 = input()
C2 = input()

if C1[0] == C[2] and C1[1] == C2[1] and C1[2] == C2[0]:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
read = lambda: sys.stdin.readline().rstrip()
s1 = read()
s2 = read()
if s1[0] == s2[2] and s1[1] == s2[1] and s1[2] == s2[0]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
s=input()
t=input()
for c in range(3):
    if s[c]!=t[2-c]:
        print("NO")
        sys.exit(0)
print("YES");

Submission status: Runtime Error

Solution code:
s=input()
t=input()
for c in range(3):
    if s[c]!=t[2-c]:
        print("NO")
        sys.exit()
print("YES");

Submission status: Runtime Error

Solution code:
R = int(input())
G = int(input())
print(2*G-R)

Submission status: Runtime Error

Solution code:
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a, b, c = map(str, input().split())
e,f,g = map(str, input().split())
if a==g and b==f and c==e:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a, b, c = map(int, input().split())
e,f,g = map(int, input().split())
if a==g and b==f and c==e:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
li = list(input())
if li[0]==li[5] && li[1]==li[4] && li[2]==li[3]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
c1,c2 = map(str, input(),split())
c1 = list(c1)[::-1]
c2 = list(c2)
if c1 == c2:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
#coding:utf-8

a = int(input())
i=0
while i*i <= a:
  i=i+1

i=i-1

print(i*i)

Submission status: Runtime Error

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    a1 = list(int(_) for _ in input())
    a2 = list(int(_) for _ in input())
    if a2[2] == a1[0] and a1[1] == a2[1] and a1[2] == a1[0]:
        print('YES')
    else:
        print('NO')
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import numpy as np
import math

k=int(input())
a_t=1/k
a=a_t*10**(len(str(k))-1)
c=100
buf=0
index=0
b=a
for i in range(1,10):
        b=b-math.floor(b)
        buf=math.floor(b*10)
        #print(i,buf)
        if c>buf:
                index=i
        c=min(c,buf)
        b=b*10
#print(index)
m=math.ceil(a*10**index)
#print(m)
product=k*m
print(sum(int(i) for i in str(product)))