题目链接: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

分析

最新文章

  1. python smtp 群发邮件
  2. Daily Scrum Meeting ——SixthDay(Beta)12.14
  3. mysql 表迁移
  4. PHP的运行机制与原理(底层) [转]
  5. 【bzoj1922】 Sdoi2010—大陆争霸
  6. android 入门 002 (拨打电话,发送短信)
  7. C++ 空类默认产生成员函数
  8. js new Date().Format
  9. WebGL 支持测试,并已支持的浏览器版本摘要
  10. ubuntu 配置ftp服务器 vsftpd
  11. vue 组件的定义
  12. Web API中的路由(一)——约定路由
  13. c# Mongodb创建自增列
  14. 01.hadoop集群环境搭建
  15. .NET MVC 学习笔记(六)— 数据导入
  16. AOP实现拦截对象以及获取切入目标方法和注解
  17. poj - 1191 - 棋盘切割(dp)
  18. 使用c语言调用python小结
  19. Ionic3 UI组件之 PhotoViewer
  20. Oracle主表列表上显示从表字段拼成的字符串

热门文章

  1. springboot+vue实现文件上传
  2. python中list和dict
  3. 设定rsync开机自启动
  4. Mini学习之mini.DataGrid使用说明
  5. viewSwitcher 切换视图
  6. (转)golang获取当前时间、时间戳和时间字符串及它们之间的相互转换
  7. Windows10安装NTP服务器
  8. 【转】Python读取PDF文档,输出内容
  9. Flutter常用库:
  10. vs webapi 取消controller