题目链接:1335: Similar Word

Description

It was a crummy day for Lur. He failed to pass to the CET-6 (College English Test Band-6). Looking back on how it was in last year gone by, he gradually noticed he had fled too many English Lessons. But he determines to memorize words on his bed, not in the classroom. You know, it is not that easy to pass the test mainly because the large amount of born words.

Lur is intelligent on games, never English. He cann’t learn the similar words by heart. He always choose to select a word to learn from the similar words . For him, two words are similar if and only if one word can equal to the other by multiple cyclic shift(at least 1). For example, “car” and “arc” are similar words, while “car” and “rca” are also similar words. To save more time to play games, Lur want to know wether two words are similar words faster, he asks you to write a program to tell him, can you help him?

Input

There are multiple test cases. Each case contains two lines. Each line contains a word.

You can assume that length(W)<=105. Ended by EOF.

Output

Output “yes” in a single line if two words are similar, otherwise you should output “no” in a single line.

Sample Input

car
arc
car
cra
car
car

Sample Output

yes
no
no

分析

WUSTOJ 1335: Similar Word(Java)的更多相关文章

  1. WUSTOJ 1324: Base64 Coding(Java)未解决,求题解

    题目链接:1324: Base64 Coding 资料:ASCII码表 原文是英文,而且篇幅较长.因此下面不粘贴原文,只写中文大意. Description Base64是一种编码算法.它的工作原理是 ...

  2. WUSTOJ 1346: DARK SOULS(Java)并查集

    题目链接:1346: DARK SOULS 并查集系列:WUSTOJ 1319: 球(Java)并查集 Description CQ最近在玩一款游戏:DARK SOULS,这是一款以高难度闻名的硬派动 ...

  3. WUSTOJ 1246: 字符串排序(Java)

    1246: 字符串排序 题目   输入n(n<100)个字符串,每个字符串长度不超过1000,将他们按字典顺序输出.更过内容点击标题. 分析   Java中的ArrayList()可以比较方便的 ...

  4. WUSTOJ 1251: 报数游戏(Java)

    1251: 报数游戏 原题链接 Description n个人站成一行玩一个报数游戏.所有人从左到右编号为1到n.游戏开始时,最左边的人报1,他右边的人报2,编号为3的人报3,等等.当编号为n的人(即 ...

  5. WUSTOJ 1339: 土豪fcbruce(Java)

    题目链接:1339: 土豪fcbruce Description 10年后,就职于Google的fcbruce赞助了武汉科技大学好多钱,学校因此决定扩建.第一步是新建宿舍楼,为了整洁美观,fcbruc ...

  6. WUSTOJ 1323: Repeat Number(Java)规律统计

    题目链接:1323: Repeat Number Description Definition: a+b = c, if all the digits of c are same ( c is mor ...

  7. WUSTOJ 1321: Alphabet Cookies(Java)字符统计

    题目链接:1321: Alphabet Cookies Description Kitty likes cookies very much, and especially the alphabet c ...

  8. WUSTOJ 1336: Lucky Boy(Java)博弈

    题目链接:1336: Lucky Boy 参考博客:LUCKY BOY 博弈--HandsomeHow Description Recently, Lur have a good luck. He i ...

  9. WUSTOJ 1333: Sequential game(Java)

    题目链接:1333: Sequential game Description Sequential detector is a very important device in Hardware ex ...

随机推荐

  1. [Android] 安卓手机不用root删除自带app

    声明:本文档仅供测试,因删除引起的一切问题,本人概不负责 声明:本文档仅供测试,因删除引起的一切问题,本人概不负责 声明:本文档仅供测试,因删除引起的一切问题,本人概不负责 转载请注明出处:https ...

  2. html5中的fieldset/legend元素和keygen元素

    html5中的fieldset/legend元素和keygen元素 一.总结 一句话总结: fieldset/legend元素和figure和figcaption很像,只不过是作用于表单,前者表示内容 ...

  3. Android Mboot mmc命令介绍

    mmc command.         目前Mboot支持以下mmc命令: 1) mmc read/write.    读写命令.Addr = 内存地址, blk# = 起始block数, size ...

  4. ntpd服务

    yum -y install ntp 服务器端 [root@ip-172-31-6-148~]# vim /etc/ntp.conf ...# Use public servers from thep ...

  5. vue 日历组件

    Github 上很多点击弹出日历选择某个时间的组件,却没有找到单纯展示日历并且能点击获取时间的组件 npm i vue-calendar-component --save cnpm i vue-cal ...

  6. ES6深入浅出-9 Promise-3.Promise的细节

    await 拿到用户信息,函数前面加await await等待Promise成功或者失败. 如果Promise里面失败了 什么也拿不到.报了一个错误,叫做不认识. 如果想拿到正常错误,就绪try一下 ...

  7. ES6深入浅出-7 新版的类(上集)-1.介绍原型

    ES6新出的关键class BE受雇与网景开发了JS 当我们在写一个对象的时候,我们实际上内存的形式表示. obj等于一个空对象,可以直接toString.它为什么可以有toString window ...

  8. 软件定义网络基础---SDN的主流构架

    一:基于不同标准的主流构架 二: ONF定义的SDN基本构架 (一) 四个平面.两大接口 三:四个平面 (一)数据平面 数据平面是由若干网元(Netword Element)构成,每个网元包括一个或多 ...

  9. ABAP DMEO 通过工单号读取内部对象号

    *&---------------------------------------------------------------------* *& Report YDEMO_013 ...

  10. spring @Transactional的自调用失效问题与事务的典型错误用法剖析

    @Transactional的自调用失效问题 有时候配置了注解@Transactional,但是它会失效,这里要注意一些细节问题,以避免落入陷阱. 注解@Transaction的底层实现是Spring ...