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 numpy as np
import itertools
import bisect

n=int(input())
a=sorted([int(i) for i in input().split()])
b=sorted([int(i) for i in input().split()])
c=sorted([int(i) for i in input().split()])

count=0
index_b=0
index_c=0
for i in range(n):
        index_c=bisect.bisect_left(b,c[i])
        for j in range(index_c):
                count+=bisect.bisect_left(a,b[j])
print(count)

Submission status: Runtime Error

Solution code:
c1 = input()
c2 = input()
res = "YES" if c1[0] == c2[0] and c1[2] == c2[2] "NO"
print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
flag=1

a=input()
b=input()

c=""
d=""

c[0]=b[2]
c[1]=b[1]
c[2]=b[0]

d[0]=a[2]
d[1]=a[1]
d[3]=a[0]

i=0

while i<3:
    if a[i]!=c[i]:
        flag=0
    i+=1

while j<3:
    if b[j]!=d[j]:
        flag=0
    j+=1

if flag=1:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a, b = input().split()

X =[list(a),list(b)]
import numpy as np
X = np.array(X)
X1 = np.rot90(X, k=1)
X2 =np.rot90(X1, k=1)

if (X == X2).any():
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
c11, c12, c13 = map(int, list(input()))
c21, c22, c23 = map(int, list(input()))
if c11 == c23 and c12 == c21 and c13 == c21:
    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())
if c11==c23 and c12==c22 and c13==c21:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

n = math.sqrt(int(input()))
print(math.floor(n)**2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
num = 0
for i in range(1,N):
    if i*i> N:
        break
    else:
        num = i*i
print(num)

Submission status: Runtime Error

Solution code:
import bisect
ans = 0
n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
for i in range(n):
    ans += bisect.bisect_left(a, b[i]) * (n - bisect.bisect_right(c, b[i]))
print(ans)

Submission status: Runtime Error

Solution code:
print("YES" if input() == reversed(input()) else "No)

Submission status: Runtime Error

Solution code:
a,b,c = map(str,raw_input().split())
d,e,f = map(str,raw_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 = map(str,raw_input().split())
d,e,f = map(str,raw_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 = map(raw_input().split())
d,e,f = map(raw_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 = map(raw_input().split())
d,e,f = map(raw_input().split())
if a==f and b==e and c==d :
	print "YES" 
else :
	print "NO"

Submission status: Runtime Error

Solution code:

fun main(args: Array<String>) {
    var (a,b) = (0..1).map{readLine()!!}
    if(a.reversed() == b) println("YES")
    else println("NO")
    }

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print("YNEOS"[input()!=input()[::-1])

Submission status: Runtime Error

Solution code:
x,y=input().split();print("=><"[(x>y)-(x<y)])

Submission status: Runtime Error

Solution code:
def bisect_left(array, i, left, right):
    n = right - left + 1
    mid = (left+right) // 2
    if n == 1:
        if array[mid] < i:
            return 1
        else:
            return 0
    if i <= array[mid]:
        return bisect_left(array,i,left,mid)
    else:
        return (mid-left+1) + bisect_left(array,i,mid+1,right)

def bisect_right(array, i, left, right):
    n = right - left + 1
    mid = (right+left) // 2
    if n == 1:
        if i < array[mid] :
            return 0
        else:
            return 1
    if array[mid] <= i:
        return  (mid-left+1) + bisect_right(array,i,mid+1,right)
    else:
        return bisect_right(array,i,left,mid)

N = int(input())
L = []
for _ in range(3):
    l = list(map(int,input().split()))
    L.append(sorted(l))
ans = 0
for x in L[1]:
    n = bisect_left(L[0],x,0,N-1)
    m = bisect_right(L[2],x,0,N-1)
    m = N - m
    ans += n*m
print(ans)

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:
f = list(input())
s = list(input())
for i in range(1,4):
  if f[i] != s[4-i]:
    print("NO")
    exit()
print("YES")

Submission status: Runtime Error

Solution code:
s1=list(input())
s2=list(input())
a=[s1,s2]
for x in range3:
    if a[0][x]!=a[1][2-x]:
        print("NO")
        exit()
print("YES")

Submission status: Runtime Error

Solution code:
n = int(input())
for i in range(n+1):
    if i**2 > n:
        print((i-1)**2)
        exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s1=input()
s2=input()
if s1[0] == s2[2] and s1[1]==s2[1] and s1[2]==s[0]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
s1=input()
s2=input()
if s1[0] == s2[2] and s1[1]==s2[1] and s1[2]==s[1]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
s1=input()
s2=input()
if s1[0] == s2[2] and s1[1]==s2[1] ans s1[2]==s[1]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a,b,c=map(str,input().split())
d,e,f=map(str,input().split())
if (a==f and b==e and c==d):
    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())

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()))

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:
c1 = list(input())
c2 = list(input())
for i in range(3):
    if c1[i]!=c[2-i]:
        print("NO")
        exit()
print("YES")

Submission status: Runtime Error

Solution code:
print([NO,YES][input().strip()[::-1]==input().strip()])

Submission status: Runtime Error

Solution code:
a=input()
b=input()
print(["NO","YES"][a==a[::-1] and b=b[::-1]])

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:
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:
c = [list(input().split()) for _ 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:
# -*- coding: utf-8 -*-
S = str(input())
T = str(input())
if T[::-1] = S:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = str(input())
M = str(input())
if N = M.reverse():
  print(YES)
else:
  print(NO)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

rev_a = a[::-1]

if rev_a == b:
  print('YES)
else:
  print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
c=[[]]
c[0].append(input())
c[1].append(input())
for i in range(3):
  if c[0][i]!=c[1][2-i]:
    print('NO')
    exit()
print('YES')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 'Yes'

for i in range(3):
    if C1[i] == C2[-i-1]:
        continue
    else:
        ans = 'No'
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
b = input()
if a[1] = b[3] and a[2] = b[2] and a[3] = c[1]:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
s1 = input().split()
s2 = input().split()

if(s1[0] == s2[2]):
    if(s1[1] == s2[1]):
        if(s1[2] == s2[0]):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
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())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

import bisect

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
c = []
for i in range(2):
	c.append(list(map(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:
c = []
for i in range(2):
	c.append(list(map(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:
c = [[list(map(int, input().split()))] for _ 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 = [list(map(int, input().split())) for _ 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:
import sys
lines = [xsys.stdin.readlines()]
tmp = []
for i in range(len(lines)):
  tmp.append(str(reversed(lines[i])))
if tmp == lines:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
#coding:utf-8
n1=str(input())
n2=str(input())
if(n1[0]==n2[2] and n1[2]==n2[0]):
  if(n1[1]==n2[1]):
    print("YES")
  else:
    print("NO)
else:print("NO")

Submission status: Runtime Error

Solution code:
#coding:utf-8
n1=str(input())
n2=str(input())
if(n1[0]==n2[2] and n1[2]==n2[0]　and n1[1]==n2[1]):
  print("YES")
else:print("NO")

Submission status: Runtime Error

Solution code:
#coding:utf-8
n1=input()
n2=input()
if(n1[0]==n2[2] & n1[2]==n2[0]):
  print("YES")
else:print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
"""
https://abc077.contest.atcoder.jp/tasks/abc077_b
"""
n=int(input())
i=1
while (i**2)<=n:
    i=i+1
print((i-1)**2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
c_11, c_12, c_13 = input()
c_21, c_22, c_23 = input()
if c_11 == c_23 and c_12 == c_22 and c_13 == c_21:
  print(YES)
else:
  print(NO)

Submission status: Runtime Error

Solution code:
x=input()
if x[0][0]==x[1][2] & x[0][1]==x[1][1] & x[0][2]==x[1][0]
    print YES
else
	print NO
end

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
A=input()
B=input()

B.reverse()

if A==B:
    print("Yes")
else:
    print("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:
    print("NO")

Submission status: Runtime Error

Solution code:
print('YES' if input() == ''.join([e for e in reversed(list(input()))] else 'NO')

Submission status: Runtime Error

Solution code:
N = int(input())

for i in range(1, N):
    if i*i > N:
        break
        
    res = i * i

print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
strlist1 = input()
strlist2 = input()

flag = True

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = false

if flag:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
strlist1 = input()
strlist2 = input()
print(strlist1)
print(strlist2)

flag = true

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = false

if flag:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = str(input())
b = str(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:
print(['NO','YES'][input()==input().reverse()])

Submission status: Runtime Error

Solution code:
print(['NO','YES'][input()=input().reverse()])

Submission status: Runtime Error

Solution code:
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()
c = c[::-1]
answer,x,y = 0,0,n-1
for j in b:
	for k in range(x,n):
		if a[k] >= j:
			x = k
			break
		elif k == n-1:
			x = n
	for k2 in range(y+1):
		if c[k2] <= j:
			y = k2
			break
		elif k2 == n-1:
			y = n
	answer += x*y
print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import heapq as hq

INF = 10_0000_0007
K = int(input())

dist = [INF for _ in range(K)]

h = []
hq.heappush(h, (1, 1))

while h:
    v, c = hq.heappop(h)
    if dist[v] <= c:
        continue
    dist[v] = c
    
    if dist[(v+1)%K] > c+1:
        hq.heappush(h, ((v+1)%K, c+1))
    if dist[(v*10)%K] > c:
        hq.heappush(h, ((v*10)%K, c))

print(dist[0])

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!

from datetime import datetime
K = int(input())
start = datetime.now()
def KSum(n):
    k = 0
    for i in str(n):
        k += int(i)
    return k

m = KSum(K)
j = 1
while((datetime.now()-start).total_seconds() < 1.8):
    for x in range(100):
	    P = KSum(K*j)
    	if m > P:
        	m = P
    	j += 1
print(m)

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:
c11,c12,c13=map(str,input().split())
c21,c22,c23=map(str,input().split())
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().split())
c21,c22,c23=map(int,input().split())
if c11==c23 and c12==c22 and c13==c21:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
b=input()
if a[0]==b[2] and a[1]==b[a] and a[2]==b[0]:
  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:
n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

count = 0


for c in C:
    for b in B:
        if b >= c:
            continue
        else:
            saidan = filter(lambda x: x<b ,A)
            count+=len(list(saidan))
                
print(count)

Submission status: Runtime Error

Solution code:
A,B,C=map(str,input().split(' '))
D,E,F=map(str,input().split(' '))
if (A==F) and (B==E) and (C==D):
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
# a = input()
# b = input()
a,b = input().split() 

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = map(int, input().split())
B = map(int, input().split())
C = map(int, input().split())

A = list(A)
B = list(B)
C = list(C)

count = 0
for a in A:
    for b in B:
        if a < b:
            for c in C:
                if b < c:
                    count += 1

print(count)

Submission status: Runtime Error

Solution code:


N = int(raw_input())
As = [(int(i), 2) for i in raw_input().split(" ")]
Bs = [(int(i), 1) for i in raw_input().split(" ")]
Cs = [(int(i), 0) for i in raw_input().split(" ")]

l = sorted(As + Bs + Cs, key=lambda x: (x[0], x[1]))

ac = 0
bc = 0
cc = 0

for i in l:
    if i[1] == 2:
        ac += 1
    elif i[1] == 1:
        bc += ac
    elif i[1] == 0:
        cc += bc
print cc

Submission status: Runtime Error

Solution code:


N = int(raw_input())
As = [(int(i), 2) for i in raw_input().split(" ")]
Bs = [(int(i), 1) for i in raw_input().split(" ")]
Cs = [(int(i), 0) for i in raw_input().split(" ")]

l = sorted(As + Bs + Cs)

ac = 0
bc = 0
cc = 0

for i in l:
    if i[1] == 2:
        ac += 1
    elif i[1] == 1:
        bc += ac
    elif i[1] == 0:
        cc += bc
print cc

Submission status: Runtime Error

Solution code:
# using sort

n = int(input())
count = 0
a = [[0 for i in range(n)] for i in range(3)]

for i in range(3):
    a[i] = [int(x) for x in input().split()]
    a[i].sort()

# Brute force
for i in a[0]:
    for j in a[1]:
        if i < j:
            index = 0
            for k in a[2]:
                if j < k:
                    count += n - index
                    break
                else:
                    index += 1

print(count)

Submission status: Runtime Error

Solution code:
# using sort

n = int(input())
count = 0
a = [[0 for i in range(n)] for i in range(3)]

for i in range(3):
    a[i] = [int(x) for x in input().split()]
    a[i].sort()

# Brute force

index = 0

for i in a[0]:
    for j in a[1]:
        if i < j:
            for k in a[2]:
                if j < k:
                    count += n - index
                    break
                else:
                    index += 1

print(count)

Submission status: Runtime Error

Solution code:
a,b=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:
a,b=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:
""" small multiple """

K = int(input())

def get_sum_each_digits(number):
    """
    get sum.
    """
    chars = list(str(number))
    int_map = map(int, chars)
    result = sum(int_map)
    # print("number:{0}, result:{1}".format(number, result))
    return result

def main():
    """
    main function.
    """

    min = K
    multiple = 0
    while multiple < 100000:
        multiple += 1
        temp = get_sum_each_digits(K * multiple)
        if temp < min:
            min = temp
        if min == 1:
            break

    # print("ans ---")
    print(min)

main()

Submission status: Runtime Error

Solution code:
"""
snuke festival
"""

def input_list():
    """
    returns list from stdin
    """
    input_map = map(int, input().split())
    return list(input_map)

def get_bigger_index(base_num, sub_list):
    """
    returns first index that is bigger than base number
    """
    bigger_index = -1
    for index, item in enumerate(sub_list):
        if base_num < item:
            bigger_index = index
            break
    return bigger_index

def main():
    """
    main function.
    """
    base_len = int(input())
    top = input_list()
    mid = input_list()
    btm = input_list()

    top.sort()
    mid.sort()
    btm.sort()

    result = 0

    for i in range(base_len):
        mid_index = get_bigger_index(top[i], mid)
        if mid_index < 0:
            break
        else:
            btm_index = get_bigger_index(mid[mid_index], btm)
            if btm_index >= 0:
                result += (base_len - mid_index) * (base_len + btm_index)

    print(result)

main()

Submission status: Runtime Error

Solution code:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        String w1=sc.nextLine();
        String w2=sc.nextLine();
        for(int i=0;i<3;i++){
            if(w1.charAt(i)!=w2.charAt(2-i)){
                System.out.println("NO");
                break;
            }
            if(i==2)System.out.println("YES");
        }
    }
}

Submission status: Runtime Error

Solution code:
c11, c12, c13 = list(raw_input())
c21, c22, c23 = list(raw_input())
result = c11 == c23 and \
    c12 == c22 and \
    c13 == c21

ans = "YES" if result else "NO"
print ans

Submission status: Runtime Error

Solution code:
input1 = input().split(' ')
input2 = input().split(' ')

if input1[2] == input2[0] :
    if input1[1] == input2[1] :
        if input1[0] == input2[2] :
            print("YES")
        else :
            print("NO")
    else :
        print("NO")
else :
    print("NO")

Submission status: Runtime Error

Solution code:
input1 = input().split(' ')
input2 = input().split(' ')

if input1[2] == input2[0] :
    if input1[1] == input2[1] :
        if input1[0] == input2[2] :
            print("Yes")
        else :
            print("No")
    else :
        print("No")
else :
    print("No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

c = a[::-1]
d = b[::-1]

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

Submission status: Runtime Error

Solution code:
a = int(input())
import math
b = math.sqrt(a)
c = math.floor(b)
d = c**2
print(d)

Submission status: Runtime Error

Solution code:
    a=input()
    a=list(a)
    b=input()
    b=list(b)
    n=len(a)
    j=1
    for i in range(n):
      if(a[i]!=b[-(i+1)]):
        j=0
    if(j==1):
      print("YES")
    else:
      print("NO")

Submission status: Runtime Error

Solution code:
    a=input().split()
    a=list(a)
    b=input().split()
    b=list(b)
    n=len(a)
    N=1
    for i in range(n):
      if(a[i]!=b[-(i+1)]):
        N=0
    if(N==1):
      print("YES")
    else:
      print("NO")

Submission status: Runtime Error

Solution code:
a=input().split()
a=list(a)
b=input().split()
b=list()
n=len(a)
N=1
for i in range(n):
  if(a[i]!=b[-(i+1)]):
    N=0
if(N==1):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
line1 = list(raw_input())
line2 = list(raw_input())
overall = list1 + list2

gyaku = overall[::-1]

if overall == gyaku:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
from bisect import bisect_left, bisect_right
br, bl = bisect_right, bisect_left
n = input()
a = sorted([int(x) for x in raw_input().split()])
b = sorted([int(x) for x in raw_input().split()])
c = sorted([int(x) for x in raw_input().split()])
ans = 0
for bi in b:
	ans += (bl(a, bi) * (n - br(c, bi)))
print ans

Submission status: Runtime Error

Solution code:

import operator

def snuke_fest(top_arr, middle_arr, bottom_arr):
    sorted_arrs = list(sorted(arr) for arr in (top_arr, middle_arr, bottom_arr))
    del top_arr
    del middle_arr
    del bottom_arr
    pointers = [0] * 3
    ended = [False] * 3
    min_posi = [None] * len(sorted_arrs[0]) * 3
    min_posi_pointer = 0
    while not all(ended):
        nums = [0] * 3
        mins = [10**9] * 3
        for i in range(3):
            if not ended[i]:
                mins[-(i+1)] = sorted_arrs[i][pointers[i]]
        min_index, min_val = min(enumerate(mins), key = operator.itemgetter(1))
        min_index = 2 - min_index
        pointers[min_index] += 1
        min_posi[min_posi_pointer] = min_index
        min_posi_pointer += 1
        if pointers[min_index] == len(sorted_arrs[0]):
            ended[min_index] = True
    del sorted_arrs
    del pointers
    count = 0
    count_arr = [0, 0, 0]
    count_one_two = 0
    for i in range(len(min_posi)):
        count_arr[min_posi[-(i+1)]] += 1
        try:
            if min_posi[-(i+1)] == 1:
                count_one_two += count_arr[2]
            elif min_posi[-(i+1)] == 0:
                count += count_one_two
        except Exception as e:
            return 0
    return count


if __name__ == "__main__":
    # run_test(find_even, test_pair)
    _ = input()
    top_arr = [int(i) for i in input().split(" ")]
    middle_arr = [int(i) for i in input().split(" ")]
    bottom_arr = [int(i) for i in input().split(" ")]
    print(snuke_fest(top_arr, middle_arr, bottom_arr))
# ===

Submission status: Runtime Error

Solution code:
text1 = raw_input()
text2 = raw_input()

if text1 == text2[::-1]:
    print("OK")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
def can_rotate(text):
    lines = text.split("\n")
    return lines[0] == lines[1][::-1]

text = raw_input()

if can_rotate(text):
    print("OK")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
from sys import stdin
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
	c1 = readLine_int_list()
	c2 = readLine_int_list()
	if c1[0] == c2[-1] and c1[1] == c2[1] and c1[-1] == c2[0]:
		print("YES")
	else:
		print("NO")
        
if __name__ == "__main__": main()

Submission status: Runtime Error

Solution code:
from sys import stdin
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
	c1 = readLine_int_list()
	c2 = readLine_int_list()
	
	if c1[0] == c2[-1] and c1[1] == c2[1] and c1[-1] == c2[0]:
	    print("YES")
    else:
        print("NO")
        
if __name__ == "__main__": main()

Submission status: Runtime Error

Solution code:
a=input()
b=input()
aa=a[::-1]

if aa[1]==b[0] and aa[2]==b[1] and aa[3]==b[2]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
in = [input().split(" "), input().split(" ")]
 
bool = True
for i in 0..1:
  for j in 0..2:
    if in[i][j] != in[1-i][2-j]:
      bool = False
      break
  if bool == False:
    break
 
if bool == True:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
in = [raw_input().split(), raw_input().split()]

bool = True
for i in 0..1:
  for j in 0..2:
    if in[i][j] != in[1-i][2-j]:
      bool = False
      break
  if bool == False:
    break

if bool == True:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
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()]

can_make = 0
for upp in range(N):
    for midd in range(N):
        for loww in range(N):
            if A[upp] < B[midd] < C[loww]:
                can_make += 1

print　can_make

Submission status: Runtime Error

Solution code:
in = [raw_input().split(), raw_input().split()]

bool = true
for i in 0..1:
  for j in 0..2:
    if in[i][j] != in[1-i][2-j]:
      bool = false
      break
  if bool == false:
    break

if bool == true:
  print("YES")
else:
  print("NO")