poj 3096 Surprising Strings
来源:互联网 发布:中国网络接口 编辑:程序博客网 时间:2024/05/29 19:09
很简单的题了吧……
/* * Author: stormdpzh * POJ: 3096 Surprising Strings * Time: 2012/5/7 21:28:34 */#include <iostream>#include <cstdio>#include <cstring>#include <string>#include <cmath>#include <vector>#include <queue>#include <stack>#include <set>#include <algorithm>#include <functional>#define sz(v) ((int)(v).size())#define rep(i, n) for(int i = 0; i < n; i++)#define repf(i, a, b) for(int i = a; i <= b; i++)#define out(n) printf("%d\n", n)#define wh(n) while(scanf("%d", &n) != EOF)#define whz(n) while(scanf("%d", &n) != EOF && n != 0)#define lint long longusing namespace std;set<string> st;string str;int main(){ //freopen("data.in", "r", stdin); while(cin >> str && str != "*") { bool flag = true; int len = str.size(); for(int i = 0; i < len - 1; i++) { st.clear(); for(int j = 0; j < len - i - 1; j++) { string tmp = ""; tmp += str[j]; tmp += str[j + 1 + i]; if(st.find(tmp) == st.end()) { st.insert(tmp); } else { flag = false; break; } } if(!flag) break; } if(flag) cout << str << " is surprising." << endl; else cout << str << " is NOT surprising." << endl; } return 0;}
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- POJ 3096 Surprising Strings
- POJ 3096 Surprising Strings
- POJ 3096 Surprising Strings
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- POJ 3096:Surprising Strings
- Surprising Strings(POJ -3096
- poj 3096 Surprising Strings
- poj-3096-Surprising Strings
- poj 3096 Surprising Strings
- poj 3096 Surprising Strings
- POJ 3096 Surprising Strings
- poj 3096 Surprising Strings
- 如何在ndk开发环境下运行helloworld
- 微软发OFFER啦
- How to run HelloWorld on ndk r4 and r5
- 编程之美读书笔记:求一个字节(8bit)的无符号整型变量表示的二进制中1的个数
- fstream
- poj 3096 Surprising Strings
- 常用的sql语句---很全
- linux下alias命令详解
- 各种计算机语言的经典书籍
- /bin/sh:can't access tty;job control turned off
- arcgis中做掩膜mask
- find_first_of详解
- Linux TOP命令 按内存占用排序和按CPU占用排序
- 透视投影变换