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: Accepted

Solution code:
c1 = input()
c2 = input()
c2 = c2[::-1]

import sys
for (a, b) in zip(c1, c2):
    if a != b:
        print('NO')
        sys.exit(0)

print('YES')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S=raw_input()
T=raw_input()

if S==T[::-1]:
	print "YES"
else:
	print "NO"

Submission status: Accepted

Solution code:
upper =list(input())
lower =list(input())
while upper[1] == lower[1]:
    if upper[0] == lower[2] and upper[2] == lower[0]:
        print("YES")
        break
    else:
        print("NO")
        break
else :
    print("NO")

Submission status: Accepted

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: Accepted

Solution code:
# coding: utf-8
# Your code here!
s=input()
s1=input()
if s==s1[::-1]:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

C = [input() for i in range(2)]

ans = True
for i in range(3):
    if C[0][i] != C[1][2 - i]:
        ans = False

print('YES' if (ans) else 'NO')

Submission status: Accepted

Solution code:
t1=raw_input()
t2=raw_input()
if t1[0]==t2[2] and t1[1]==t2[1] and t1[2]==t2[0]:
 print "YES"
else:
 print "NO"

Submission status: Accepted

Solution code:
a = []
a.append(input())
a.append(input())

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

Submission status: Accepted

Solution code:
a = raw_input()
b = raw_input()
judge = True
for i in xrange(3):
    if a[i] != b[-1-i]: judge = False
if judge:
    print 'YES'
else:
    print 'NO'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line1 = input()
line2 = input()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""077-a"""

import sys
import pprint
import re

import itertools
pp = pprint.PrettyPrinter(indent=2)

def main():
    """Main function."""
    c1 = input()
    c2 = input()

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


if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
import sys

C1 = input()
C2 = input()
for i in range(3):
    if C1[i] != C2[2-i]:
        print('NO')
        sys.exit()
print('YES')

Submission status: Accepted

Solution code:
#!/usr/bin/python

# AtCoder Beginner Contest 077
# A - Rotation

from sys import stdin

def solve(s1, s2):
    for i in range(len(s1)):
        if s1[i] != s2[- 1 - i]: return "NO"
    return "YES"

s1 = stdin.readline().strip()
s2 = stdin.readline().strip()
if len(s1) != 3 or len(s2) != 3: raise
print(solve(s1, s2))

Submission status: Accepted

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

Submission status: Accepted

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

    if C1 == C2[::-1]:
        print('YES')
    else:
        print('NO')

main()

Submission status: Accepted

Solution code:
import sys

a = sys.stdin.readline().strip()
b = sys.stdin.readline().strip()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c11,c12,c13 = list(input())
c21,c22,c23 = list(input())
C = [c11,c12,c13,c21,c22,c23]
invC = [c23,c22,c21,c13,c12,c11]

flag = True
for c,ic in zip(C,invC):
    if c != ic:
        flag = False
        break

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

Submission status: Accepted

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

a_list = list(a)
b_list = list(b)

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

Submission status: Accepted

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

for i in range(3):
    if a[i] != b[2-i]:
        c += 1

if c == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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: Accepted

Solution code:
c1 = input()
c2 = input()
n = len(c1)
t = True
for i in range(n):
    if c1[i] != c2[n - i - 1]:
        t = False
    
if t:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    C_1 = input()
    C_2 = input()
    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")

solve()

Submission status: Accepted

Solution code:
#http://abc077.contest.atcoder.jp/
# -*- coding: utf-8 -*-

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

Submission status: Accepted

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

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    C1 = list(input())
    C2 = list(input())
    if C1[0] == C2[2] and C1[1] == C2[1]and C1[2] == C2[0]:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
value = list(input())
value2 = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
m = input()

if (s[0] == m[2]) & (s[1] == m[1]) & (s[2] == m[0]) : print("YES")
else : print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
https://beta.atcoder.jp/contests/abc077/tasks/abc077_a

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    a = input().strip()
    b = input().strip()

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


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
def solve():
    c1 = list(input())
    c2 = list(input())
    c2.reverse()
    if c1 == c2:
        print("YES")
    else:
        print("NO")



solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = [str(x) for x in input()]
b = [str(x) for x in input()]
print("YES" if b[::-1] == a else "NO")

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

C =str(input())


if C[0] == C[5] and C[1] == C[4] and C[2] == C[3]:
    print('Yes')

else:
    print('No')

Submission status: Runtime Error

Solution code:

N = int(input())
for i in range(1,N):
    if(i * i > N):
        print((i -1) * (i - 1))
        break

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)



int main(){
    char c[2][3];
    rep(i,2) rep(j,3) cin>>c[i][j];

    bool ans=true;

    if(c[0][0]!=c[1][2]||c[0][1]!=c[1][1]||c[0][2]!=c[1][0]){
        ans=false;
    }
    if(ans) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

Submission status: Runtime Error

Solution code:
s = input()
t = input()
s.reverse()

if s==t :
  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:
A = input().split()
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()
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:
# 077a

def atc_077a(input_value: str) -> str:
    C1 = input_value[0]
    C2 = input_value[1]

    if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]
        return "YES"
    else:
        return "NO"


C1 = input()
C2 = input()
print(atc_077a([C1, C2]))

Submission status: Runtime Error

Solution code:
# 077a

def atc_077a(input_value: str) -> str:
    C1 = input_value[0]
    C2 = input_value[1]

    if C1[0] == C2[2] and C1[1] == C2[1]:
        return "YES"
    else:
        return "NO"

C1 = input()
C2 = input()
print(atc_077a(C1,C2))

Submission status: Runtime Error

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

if C1[0] == C2[1] and C1[1] == C2[2] and C1[2] == C2[3]:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n ,s = map(str,input().split())
if n[0]== s[2]and n[1]==s[1] and n[2]== s[0]:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=list(map(input().split()))
T=list(map(input().split()))
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=list(map(input()))
T=list(map(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:
S1 = input()
S2 = input()
if S1.reverse == S2:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
def bs_left(list, target):
    low = 0
    high = len(list)

    while low < high:
        mid = (low + high) // 2
        if target > list[mid]:
            low = mid + 1
        else:
            high = mid
    return low

def bs_right(list, target):
    low = 0
    high = len(list)
    while low < high:
        mid = (low + high) // 2
        if target < list[mid]:
            high = mid
        else:
            low = mid + 1
    return low

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 b in B:
    ans += (bs_left(A, b) * (n - bs_right(C, b)))
print(ans)

Submission status: Runtime Error

Solution code:
c1 = list(map(int,input().split()))
c2 = list(map(int,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(map(int,input().split()))
R=list(map(int,input().split()))
if L[0]==R[2] and L[1]==R[1] and L[2]==R[0]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = [list(map(str, input().split())) for i in range(2)]
if x[0][0] == x[1][2] and x[0][1] == x[1][1] and x[1][0] == x[0][2]:
  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 = 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] "NO")

Submission status: Runtime Error

Solution code:
a = [list(map(str, input().split())) for i in range(2)]
if a[0][0] == a[1][2] and a[0][1] == a[1][1] and a[0][2] == a[1][0]:
  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:
    print('YES')
elif c12==c22:
    print('YES')
elif c13==c31:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
c=input()
d=input()
if c[0]==d[3] and c[1]==d[1] and c[2]==d[0]:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
for x,y in zip(input(),reversed(input)):
  if x!=y:
    print('NO')
    break
else:
  print('YES')

Submission status: Runtime Error

Solution code:
from bisect import bisect_left, bisect_right

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

cnt = 0

for b_e in b:
    a_cases = bisect_left(a, b_e)
    c_cases = bisect_right(c, b_e)
    cnt += a_cases * (n - c_cases)
print(cnt)

Submission status: Runtime Error

Solution code:
def isSquare(x):
  return x == round(x**(1/2))**2

N = int(input())
l = (x if isSquare(x) else -1 for x in range(1,N+1))
print(max(l))

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

def binary_search(list_a,item):
  low=0
  high=len(list_a)-1
  flag=True
  while low<=high:
    mid=int((low+high)/2)
    guss=list_a[mid]
    if guss>item:
      high=mid-1
    elif guss<item:
      low=mid+1
    elif guss==item:
      return mid
  return mid

def main():
  ans=0    
  for b in B:
    p=binary_search(A,b)
    if A[p]>=b:
      tmp_p=p
    elif A[p]<b:
      tmp_p=p+1
    q=binary_search(C,b)
    if C[q]>b:
      tmp_q=N-q
    elif C[q]<=b:
      tmp_q=N-q-1
    ans+=tmp_p*tmp_q
  print(ans)
  
if __name__=="__main__":
  main()

Submission status: Runtime Error

Solution code:
C = []
C.append(list(map(int,input().split())))
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:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

C = sInLD(2)

b1 = C[0][0] == C[1][2]
b2 = C[0][1] == C[1][1]
b3 = C[0][2] == C[1][0]

ans = 'YES' if b1 and b2 and b3 else 'NO'

Submission status: Runtime Error

Solution code:
import sys


def main():
        n = sys.stdin.readline()

        astr = sys.stdin.readline()
        bstr = sys.stdin.readline()
        cstr = sys.stdin.readline()

        a = map(int, astr.strip().split(' '))
        b = map(int, bstr.strip().split(' '))
        c = map(int, cstr.strip().split(' '))

        a.sort()
        b.sort()
        c.sort()

        cnt = 0

        bc = []
        sum = 0
        for bi in reversed(b):
                ct = c[binary(bi, c):]
                sum += len(ct)
                bc.append(sum)
        bc.reverse()

        cnt = 0
        for ai in a:
                bi = binary(ai, b)
                cnt += bc[bi]

        print(cnt)


def binary(x, li):
    upper = len(li)
    lower = -1
    index = (upper + lower) / 2


    while upper - lower > 1:
        if (x < li[index]):
            upper = index
        else:
            lower = index
        index = (upper + lower)/2
    
    return upper


main()

Submission status: Runtime Error

Solution code:
x = str(input())
y = str(input())
z = x.reversed()
w = y.reversed()
if x==w and y==z:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
x = str(input())
y = str(input())
z = x.sorted()
w = y.sorted()
if x==w and y==z:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
import math
N = int(input())
N_square_root = math.floor(math.sqrt(N))
result = 0
for i in range(N_square_root + 1):
    if math.sqrt(i).is_integer() is True:
        result = i
print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if ''.join(list(c1).reverse()) == c2:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

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

if c1.reverse() == c2:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

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

if c1.reverse() == c2:
  print('YES')
else:
  print('NO)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = list(input().split())
b = list(input().split())
s = a + b
print("YES if s == s[::-1] else "NO")

Submission status: Runtime Error

Solution code:
N =int(input())
lisA =sorted(list(map(int,input().split())))
lisB = sorted(list(map(int,input().split())))
lisC = sorted(list(map(int,input().split())))



print(sum(bisect.bisect_left(lisA,b)*(N-bisect.bisect_right(lisC,b))for b in  lisB))

Submission status: Runtime Error

Solution code:
N=int(input())
i = 0
while N>=i*i :
    i+=1
print((i-1)*(i-1))

Submission status: Runtime Error

Solution code:
# -*- coding: <encoding name> -*-

line_1 = input
line_2 = input
line = line_1 + line_2
print('YES' if line == line[::-1] else 'NO')

Submission status: Runtime Error

Solution code:

# index が条件をみたかどうか
def isLess(index, key, a):
	if a[index] >= key:
		return True
	else: 
		return False
      
def isUpper(index, key, a):
	if a[index] > key:
		return True
	else: 
		return False
      
def binary_search(key, a, upper=True):
    left = -1 # index = 0 が条件を満たすこともあるので初期値は−１
    right= len(a) # index = len(a) -1 が条件満たさないこともある
 
    # どんな二分探索でもここの書き方を変えずにできる
    while right - left > 1 :
        mid = left + ((right - left + 1) // 2)
        if upper:
            if isUpper(mid, key, a): # isOKの名前でこの関数内の条件判定変えれば色々できそう
                right = mid
            else:
                left = mid
        else:
            if isLess(mid, key, a): # isOKの名前でこの関数内の条件判定変えれば色々できそう
                right = mid
            else:
                left = mid
    return right

import sys

def main():
    n = int(input())
    a_l = sorted(list(map(int, sys.stdin.readline().strip().split()))
    b_l = sorted(list(map(int, sys.stdin.readline().strip().split()))
    c_l = sorted(list(map(int, sys.stdin.readline().strip().split()))
    cnt = 0
    for b in b_l:
        a_under_b_idx = binary_search(b, a_l, upper=False)
        c_upper_b_idx = binary_search(b, c_l)
        cnt += len(a_l[:a_under_b_idx])*len(c_l[c_upper_b_idx:])
    print(cnt)
    
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
from bisect import bisect_left, bisect_right

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

count = 0
for b in B:
    upper = bisect_left(A, b)  # returns number of elements which satisfy a < b
    lower = bisect_right(C, b)
    count += upper * (len(C) - lower)

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
A, B, C = map(int, input().split())
print("YES" if a==C and b==B and c==A else "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:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

l = inputLs(2)

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

Submission status: Runtime Error

Solution code:
import bisect

n = int(input())
A = sorted(list(map(int,input().split())))
B = sorted(list(map(int,input().split())))
C = sorted(list(map(int,input().split())))

cnt = 0

for a in A:
    for b in B[bisect.bisect_left(B,a):]:
        for c in C [bisect.bisect_left(C,b):]:
            if a < b < c :
                cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
def ABC_77_A():
    A,B,C = map(str, input().split())
    A2,B2,C2 = map(str, input().split())
    
    if A == C2 and C == A2 and B == B2:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':

    ABC_77_A()

Submission status: Runtime Error

Solution code:
s1=input()
s2=input()
s3=s2[::-1]

if s1=s3:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

cnt=0
for i in range(len(l1)):
    print(l1[i])
    print(l2[-i-1])
    if l1[i]==l2[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
l1=list(map(str,input().split()))
l2=list(map(str,input().split()))

cnt=0
for i in range(len(l1)):
    if l[i]==l[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))

cnt=0
for i in range(len(l1)):
    if l[i]==l[-i-1]:
    cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))

cnt=0
for i in range(len(l1)):
    l[i]==l[-i-1]:
    cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:

c = input()
d = input()

print("YES" c==c[::-1] and d==d[::-1] else "NO")

Submission status: Runtime Error

Solution code:
import bisect
def I(): return int(input())
def LI(): return list(map(int,input().split()))
N = I()
A = sorted(LI())
B = sorted(LI())
C = sorted(LI())
ans = 0
for b in B:
    ok_a = bisect.bisect_left(A,b)
    ok_c = bisect.bisect_right(C,b)
    if ok_a!=0 and ok_c!=N:
        ans += ok_a*(N-ok_c)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

readline = sys.stdin.readline

n = int(input())
a = np.array(readline().split(),dtype=np.int64)
b = np.array(readline().split(),dtype=np.int64)
c = np.array(readline().split(),dtype=np.int64)

ans = 0
for i in range(n):
    ans += np.count_nonzero(a < b[i]) * np.count_nonzero(c > b[i])
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
print(int(N**(1/2))**2)

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)#挿入


##TLE
# 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

#right ans
tot=0
A.sort()
C.sort()
for b in B:
    cut1=bisect.bisect_left(A, b)
    cut2=bisect.bisect_right(C, b)
    tot+=cut1*(N-cut2)
print(tot)