Eddy的难题 Time Limit: 1000MS Memory Limit:
来源:互联网 发布:互联网金融数据分析师 编辑:程序博客网 时间:2024/06/07 12:07
Eddy的难题
Time Limit: 1000MS Memory Limit: 65536KB
Submit Statistic
Problem Description
<p align="\"LEFT\"" 0cm;="" widows:="" 2;="" orphans:="" 2\"="" style="box-sizing: border-box; margin-top: 0px; margin-bottom: 3px;">人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何 判断了,但是发现,现在长大了却不知道怎么去判断亲和串了,于是他只好又再一次来请教聪明且乐于助人的你来解决这个问题。
亲和串的定义是这样的:给定两个字符串s1和s2,如果能通过s1循环移位,使s2包含在s1中,那么我们就说s2 是s1的亲和串。
亲和串的定义是这样的:给定两个字符串s1和s2,如果能通过s1循环移位,使s2包含在s1中,那么我们就说s2 是s1的亲和串。
Input
本题有多组测试数据,每组数据的第一行包含输入字符串s1,第二行包含输入字符串s2,s1与s2的长度均小于100000。
Output
如果s2是s1的亲和串,则输出"yes",反之,输出"no"。每组测试的输出占一行。
Example Input
AABCDCDAAASDASDF
Example Output
yesno
import java.util.*;
public class Main{public static void main(String args[]){
Scanner st = new Scanner(System.in);
while(st.hasNext()){
String s1 = st.next();
String s2 = st.next();
String s3 = s1+s1;
if(s3.indexOf(s2)!=-1&&s2.length()<=s1.length()){ // in
System.out.println("yes");
}
else{
System.out.println("no");
}
}
}
}
/****************************************
1 0
- Eddy的难题 Time Limit: 1000MS Memory Limit:
- //Sticks Time Limit: 1000MS Memory Limit: 10000K POJ//
- 【基础试题】数组元素的操作 Time Limit:1000MS Memory Limit:65536K Total Submit:441 Accepted:225 Description
- 1-1 欢迎来的C++世界 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 通
- E - 排序 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
- SDUTACM Anohana: The Flower We Saw That Day Time Limit: 1000MS Memory Limit: 65536KB
- 最佳调度问题 Time Limit:10000MS Memory Limit:65536K Total Submit:89 Accepted:36 Case Time Limit:1000MS
- A - 求奇数的乘积 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Sta
- 【基础试题】求m与n之间的素数 Time Limit:1000MS Memory Limit:65536K Total Submit:1836 Accepted:572 Description
- 排名 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submiss
- B - 素数判定 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
- C - 字符串统计 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
- D - 折线分割平面 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
- A - A+B for Input-Output Practice (V) Time Limit:1000MS Memory Limit:32768KB 64bit IO Form
- C - Climbing Worm Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
- L - 空心三角形 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
- M - 人见人爱A+B Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
- N - 人见人爱A-B Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
- Android基础之Json解析(中)
- Linux 链接脚本分析
- 在Mac上安装 jdk node npm ionic Cordova
- 重磅 | 消灭所有马赛克,谷歌宣布机器学习图像锐化工具RAISR
- 线性表(下)之链式存储之双向,单向循环列表
- Eddy的难题 Time Limit: 1000MS Memory Limit:
- iOS命名规范(转载)
- 多线程学习笔记2
- 《精彩绝伦的CSS》——提示(一)属性值排序
- 栈(上)之顺序栈
- Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍
- RecyclerView的基本使用
- Cocoapods的安装和使用
- Hdu 1273 漫步森林【思维】水题~