Sicily 14513. Aaah!
来源:互联网 发布:地理信息系统算法试卷 编辑:程序博客网 时间:2024/06/11 13:55
Jon Marius shouted too much at the recent Justin Bieber concert, and now needs to go to the doctor because of his sore throat. The doctor’s instructions are to say “aaah”. Unfortunately, the doctors sometimes need Jon Marius to say “aaah” for a while, which Jon Marius has never been good at. Each doctor requires a certain level of “aah” – some require “aaaaaah”, while others can actually diagnose his throat with just a “h”. (They often diagnose wrongly, but that is beyond the scope of this problem.) Since Jon Marius does not want to go to a doctor and have his time wasted, he wants to compare how long he manages to hold the “aaah” with the doctor’s requirements. (After all, who wants to be all like “aaah” when the doctor wants you to go “aaaaaah”?)
Each day Jon Marius calls up a different doctor and asks them how long his “aaah” has to be. Find out if Jon Marius would waste his time going to the given doctor.
The input consists of two lines. The first line is the “aaah” Jon Marius is able to say that day. The second line is the “aah” the doctor wants to hear. Only lowercase ’a’ and ’h’ will be used in the input, and each line will contain between 0 and 999 ’a’s, inclusive, followed by a single ’h’.
The input contains multiple test cases. End of file (EOF) indicates the end of input.
Output “go” if Jon Marius can go to that doctor, and output “no” otherwise.
aaahaaaaahaaahah
nogo
Problem Source: 2015年每周一赛第十场--省赛模拟赛I
#include<stdio.h>#include<string>#include<iostream>using namespace std;string s1,s2;const int INF = 4294967295; //表示找不到 int main(){ while(cin>>s1>>s2){ int ans = s1.find(s2); if(ans >= 0)printf("go\n"); else printf("no\n"); }}
- Sicily 14513. Aaah!
- Sicily 14513. Aaah!
- Sicily 14513 Aaah!
- BNU 26473 Aaah!【签到--->查找字符串】
- Sicily 1027
- sicily 1007
- sicily 1795
- sicily 1036
- sicily 1419
- sicily 1889
- sicily 1684
- sicily 1686
- sicily 1004
- sicily 1135
- sicily 1152
- sicily 1151
- sicily 1002
- sicily 1156
- May Challenge 2015(CodeChef 2015年5月月赛)
- FreeType 学习笔记
- filetimetosystemtime函数将filetime转化systemtime后所得的时间依旧是一种UTC时间
- eclipse修改web项目部署路径
- Robot: Set Log Level
- Sicily 14513. Aaah!
- Android添加快捷方式(ShortCut)到手机桌面
- Android实战--英文词典(API+GSON+Volley)
- Robot: Control Suite Level in Report
- 音频
- 更新Xcode 6之后插件失效的解决办法
- Reactive Cocoa在消息传输中的作用
- 设计模式之工厂模式(PHP实现)
- NGUI学习笔记(摘)