symons

___________每一天都是幸福的!!

  博客园  ::  :: 新随笔  ::  :: 订阅 订阅  :: 管理

2013年4月27日

摘要: 就是看相邻一定位置的两个char组成的字符串是不是出现过。 1 #include <iostream> 2 #include <map> 3 using namespace std; 4 string str; 5 map<string,int>haha; 6 bool check(int n) 7 { 8 haha.clear(); 9 int l=str.length();10 int i,j;11 string t="11";12 for(i=0;i<l-n-1;++i)13 {14 t[0]=str[i];15 ... 阅读全文
posted @ 2013-04-27 01:21 symons 阅读(132) 评论(0) 推荐(0)

摘要: 1 /* 2 * algorithm : math 3 * 4 * Memory 392K Time 0MS Language G++ 5 * 6 * code by : zhyu 7 */ 8 #include <cstdio> 9 10 const int N = 31;11 12 int c[N][N],pow2[N];13 bool bin[N];14 15 inline void init(void)16 {17 for(int i=0;i<N;i++) c[i][0]=c[i][i]=1,pow2[i]=(1<<i);18 for(i... 阅读全文
posted @ 2013-04-27 00:23 symons 阅读(186) 评论(0) 推荐(0)