WUSTOJ 1335: Similar Word(Java)
题目链接: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)的更多相关文章
- WUSTOJ 1324: Base64 Coding(Java)未解决,求题解
题目链接:1324: Base64 Coding 资料:ASCII码表 原文是英文,而且篇幅较长.因此下面不粘贴原文,只写中文大意. Description Base64是一种编码算法.它的工作原理是 ...
- WUSTOJ 1346: DARK SOULS(Java)并查集
题目链接:1346: DARK SOULS 并查集系列:WUSTOJ 1319: 球(Java)并查集 Description CQ最近在玩一款游戏:DARK SOULS,这是一款以高难度闻名的硬派动 ...
- WUSTOJ 1246: 字符串排序(Java)
1246: 字符串排序 题目 输入n(n<100)个字符串,每个字符串长度不超过1000,将他们按字典顺序输出.更过内容点击标题. 分析 Java中的ArrayList()可以比较方便的 ...
- WUSTOJ 1251: 报数游戏(Java)
1251: 报数游戏 原题链接 Description n个人站成一行玩一个报数游戏.所有人从左到右编号为1到n.游戏开始时,最左边的人报1,他右边的人报2,编号为3的人报3,等等.当编号为n的人(即 ...
- WUSTOJ 1339: 土豪fcbruce(Java)
题目链接:1339: 土豪fcbruce Description 10年后,就职于Google的fcbruce赞助了武汉科技大学好多钱,学校因此决定扩建.第一步是新建宿舍楼,为了整洁美观,fcbruc ...
- WUSTOJ 1323: Repeat Number(Java)规律统计
题目链接:1323: Repeat Number Description Definition: a+b = c, if all the digits of c are same ( c is mor ...
- WUSTOJ 1321: Alphabet Cookies(Java)字符统计
题目链接:1321: Alphabet Cookies Description Kitty likes cookies very much, and especially the alphabet c ...
- WUSTOJ 1336: Lucky Boy(Java)博弈
题目链接:1336: Lucky Boy 参考博客:LUCKY BOY 博弈--HandsomeHow Description Recently, Lur have a good luck. He i ...
- WUSTOJ 1333: Sequential game(Java)
题目链接:1333: Sequential game Description Sequential detector is a very important device in Hardware ex ...
随机推荐
- 如何快速关联/修改Git远程仓库地址
如何快速关联/修改Git远程仓库地址?按照如下步骤即可快速实现关联/修改Git远程仓库地址: 删除本地仓库当前关联的无效远程地址,再为本地仓库添加新的远程仓库地址 git remote -v //查看 ...
- sql 数字转换为字符串补0
select right('00000000000'+convert(varchar(5),123),5) select right('00000000000'+cast(123 as var ...
- vue cli 静态资源导入 路径
1.public文件夹 使用绝对路径引入. 2.assets文件夹 使用相对路径引入. https://cli.vuejs.org/zh/guide/html-and-static-assets.ht ...
- python命令行传入参数
1.sys import sys a=eval(sys.argv[1])b=eval(sys.argv[2]) print(a+b) 1 2 3 4 5 6 evel() ...
- php foreach 无法改变数组的值的问题
转:http://www.cnblogs.com/yangwenxin/p/5845212.html 翻到PHP文档的foreach那页这样写道: “foreach 语法结构提供了遍历数组的简单方式. ...
- 【JDBC】仅输入表名和要插入的记录数,自动检测表的字段和类型,然后插入数据的全自动程序(Oracle版)
之前写的批量插值程序只是五六半自动版本,因为表的字段还需要手工填写,这回只要指定表名和要插多少数据就行了,类似于全自动突击步枪,扣动扳机就把字段打完为止. 全自动程序如下,诸位拿下去后可以修改成自己想 ...
- exp/imp 注释乱码问题或Oracle EXP-00091的解决方法
今天用imp 导入后,发现中注释乱码,源端.目的端数据库版本都是11.2.0.1 查看源端字符集: SQL> select userenv('language') from dual;USERE ...
- Python3基础 for-else break、continue跳出循环示例
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
- netty5心跳与阻塞性业务消息分发实例
继续之前的例子(netty5心跳与业务消息分发实例),我们在NettyClientHandler把业务消息改为阻塞性的: package com.wlf.netty.nettyclient.handl ...
- 一些有用的github收藏(持续更新中...)
1.facebook的c++开源库folly(Facebook open source library)介绍 https://github.com/facebook/folly 2.pprint 一个 ...
题目链接:1324: Base64 Coding 资料:ASCII码表 原文是英文,而且篇幅较长.因此下面不粘贴原文,只写中文大意. Description Base64是一种编码算法.它的工作原理是 ...
题目链接:1346: DARK SOULS 并查集系列:WUSTOJ 1319: 球(Java)并查集 Description CQ最近在玩一款游戏:DARK SOULS,这是一款以高难度闻名的硬派动 ...
1246: 字符串排序 题目 输入n(n<100)个字符串,每个字符串长度不超过1000,将他们按字典顺序输出.更过内容点击标题. 分析 Java中的ArrayList()可以比较方便的 ...
1251: 报数游戏 原题链接 Description n个人站成一行玩一个报数游戏.所有人从左到右编号为1到n.游戏开始时,最左边的人报1,他右边的人报2,编号为3的人报3,等等.当编号为n的人(即 ...
题目链接:1339: 土豪fcbruce Description 10年后,就职于Google的fcbruce赞助了武汉科技大学好多钱,学校因此决定扩建.第一步是新建宿舍楼,为了整洁美观,fcbruc ...
题目链接:1323: Repeat Number Description Definition: a+b = c, if all the digits of c are same ( c is mor ...
题目链接:1321: Alphabet Cookies Description Kitty likes cookies very much, and especially the alphabet c ...
题目链接:1336: Lucky Boy 参考博客:LUCKY BOY 博弈--HandsomeHow Description Recently, Lur have a good luck. He i ...
题目链接:1333: Sequential game Description Sequential detector is a very important device in Hardware ex ...
如何快速关联/修改Git远程仓库地址?按照如下步骤即可快速实现关联/修改Git远程仓库地址: 删除本地仓库当前关联的无效远程地址,再为本地仓库添加新的远程仓库地址 git remote -v //查看 ...
select right('00000000000'+convert(varchar(5),123),5) select right('00000000000'+cast(123 as var ...
1.public文件夹 使用绝对路径引入. 2.assets文件夹 使用相对路径引入. https://cli.vuejs.org/zh/guide/html-and-static-assets.ht ...
1.sys import sys a=eval(sys.argv[1])b=eval(sys.argv[2]) print(a+b) 1 2 3 4 5 6 evel() ...
转:http://www.cnblogs.com/yangwenxin/p/5845212.html 翻到PHP文档的foreach那页这样写道: “foreach 语法结构提供了遍历数组的简单方式. ...
之前写的批量插值程序只是五六半自动版本,因为表的字段还需要手工填写,这回只要指定表名和要插多少数据就行了,类似于全自动突击步枪,扣动扳机就把字段打完为止. 全自动程序如下,诸位拿下去后可以修改成自己想 ...
今天用imp 导入后,发现中注释乱码,源端.目的端数据库版本都是11.2.0.1 查看源端字符集: SQL> select userenv('language') from dual;USERE ...
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
继续之前的例子(netty5心跳与业务消息分发实例),我们在NettyClientHandler把业务消息改为阻塞性的: package com.wlf.netty.nettyclient.handl ...
1.facebook的c++开源库folly(Facebook open source library)介绍 https://github.com/facebook/folly 2.pprint 一个 ...