Translation

Description

The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a little: it is spelled (and pronounced) reversely. For example, a Berlandish word code corresponds to a Birlandish word edoc. However, it's easy to make a mistake during the «translation». Vasya translated word s from Berlandish into Birlandish as t. Help him: find out if he translated the word correctly.

Input

The first line contains word s, the second line contains word t. The words consist of lowercase Latin letters. The input data do not consist unnecessary spaces. The words are not empty and their lengths do not exceed 100 symbols.

Output

If the word t is a word s, written reversely, print YES, otherwise print NO.

Sample Input

Input
code
edoc
Output
YES
Input
abb
aba
Output
NO
Input
code
code
Output
NO


#include<stdio.h>
#include<string.h>

int main(){
	int len,i,j,flag;
	char s1[110],s2[110];
	while(scanf("%s\n%s",&s1,&s2)!=EOF){
		flag=0;
		len=strlen(s1);
		for(i=0,j=len-1;i<len;i++,j--){
			if(s1[i]==s2[j]){
				flag=1;
			}
			else{
				flag=0;
				break;
			}
		}
		if(flag==1){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}


### Translation Vector 的概念 在编程和数据科学领域,Translation Vector 是指用于描述空间变换中的平移操作的一种向量表示形式。具体来说,在三维几何中,Translation Vector 表示物体从一个位置移动到另一个位置的方向和距离[^1]。 #### 数学定义 假设有一个点 \( P(x, y, z) \),通过应用翻译向量 \( T(t_x, t_y, t_z) \),该点的新坐标变为: \[ P'(x', y', z') = (x + t_x, y + t_y, z + t_z) \] 这种转换通常被应用于计算机图形学、机器人技术以及自动驾驶等领域。例如,在自动驾驶车辆定位过程中,Translation Vector 可以用来描述传感器相对于环境的变化位置[^3]。 以下是 Python 中实现简单二维平移的例子: ```python import numpy as np def apply_translation(vector, translation): """ Apply a 2D translation to a given point. :param vector: Original point coordinates [x, y]. :param translation: Translation vector [tx, ty]. :return: Translated point coordinates. """ translated_vector = np.array(vector) + np.array(translation) return translated_vector.tolist() # Example usage original_point = [1, 2] translation_vector = [3, 4] translated_point = apply_translation(original_point, translation_vector) print(f"Original Point: {original_point}") print(f"Translated Point: {translated_point}") ``` 此代码片段展示了如何利用 NumPy 库执行基本的矢量加法运算完成平移操作[^4]。 ### 实现方法扩展至高维场景 当涉及到更高维度的数据集时(如大数据处理),可以通过矩阵乘法或者张量计算框架(TensorFlow/PyTorch)来进行批量化的 Transformation 向量操作。这尤其适用于图像梯度分析等复杂任务中。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值