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 ...
随机推荐
- Ubuntu16.04启动tomcat缓慢问题之解决方案
问题信息: -May- ::] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of Secur ...
- 《sicp》模块化程序设计 笔记
<sicp>模块化程序设计 2.2.3 序列作为一种约定界面 学习笔记 这节中,讲述了一种模块化的程序设计思想,也就是将程序设计为如同信号处理过程一样,采用级联的方式将程序各个部分组合在一 ...
- sysfs 控制gpio
按照下面的命令点亮及熄灭LED pi@raspberrypi:/sys/class/gpio $echo 26 > exportpi@raspberrypi:/sys/class/gpio $ ...
- sqlserver2016 kb补丁
1. win2012r2 安装时 总是提示: 然后费了半天劲 下载下来又提示 找了一下 需要先安装这么一个补丁才可以 KB2919442 然后才能安装上 KB2919355 然后就可以正常安装了:
- Oracle中的统计信息
一.什么是统计信息 统计信息主要是描述数据库中表,索引的大小,规模,数据分布状况等的一类信息.例如,表的行数,块数,平均每行的大小,索引的leaf blocks,索引字段的行数,不同值的大小等,都属于 ...
- nginx关闭日志
# access_log off; access_log /dev/null; error_log /dev/null;
- net.ipv4.tcp_fin_timeout的错误理解
按照文档的说法,貌似长久以来我对于tcp_fin_timeout的理解都是错误的 先备份在这里,再验证 提高Linux应对短连接的负载能力 在存在大量短连接的情况下,Linux的TCP栈一般都 ...
- Leetcode: Stream of Characters
Implement the StreamChecker class as follows: StreamChecker(words): Constructor, init the data struc ...
- Python3基础 内置函数 id
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
- php报错syntax error, unexpected T_GOTO, expecting T_STRING,报错文件与行数指向以下代码,是什么原因?
本机php版本是5.3.8,Apache/2.2.21public function goto($url, $msg=NULL) {if ($msg) {$this->jsAlert($msg) ...
题目链接: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 ...
问题信息: -May- ::] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of Secur ...
<sicp>模块化程序设计 2.2.3 序列作为一种约定界面 学习笔记 这节中,讲述了一种模块化的程序设计思想,也就是将程序设计为如同信号处理过程一样,采用级联的方式将程序各个部分组合在一 ...
按照下面的命令点亮及熄灭LED pi@raspberrypi:/sys/class/gpio $echo 26 > exportpi@raspberrypi:/sys/class/gpio $ ...
1. win2012r2 安装时 总是提示: 然后费了半天劲 下载下来又提示 找了一下 需要先安装这么一个补丁才可以 KB2919442 然后才能安装上 KB2919355 然后就可以正常安装了:
一.什么是统计信息 统计信息主要是描述数据库中表,索引的大小,规模,数据分布状况等的一类信息.例如,表的行数,块数,平均每行的大小,索引的leaf blocks,索引字段的行数,不同值的大小等,都属于 ...
# access_log off; access_log /dev/null; error_log /dev/null;
按照文档的说法,貌似长久以来我对于tcp_fin_timeout的理解都是错误的 先备份在这里,再验证 提高Linux应对短连接的负载能力 在存在大量短连接的情况下,Linux的TCP栈一般都 ...
Implement the StreamChecker class as follows: StreamChecker(words): Constructor, init the data struc ...
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
本机php版本是5.3.8,Apache/2.2.21public function goto($url, $msg=NULL) {if ($msg) {$this->jsAlert($msg) ...