symons

___________每一天都是幸福的!!

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

2013年3月20日

摘要: 本题就直接模拟就OK啦,停止有2个条件,一个条件是达到目的串,另一个条件就是S1经过多次模拟又回到原始串。题意不太好懂。那我就说一下吧。就是经过shuffle,split,两个步骤,不断的进行这两个步骤,知道出现可以触发停止的条件位置。 1 #include <iostream> 2 #include <string> 3 #include <string.h> 4 #include <stdio.h> 5 using namespace std; 6 int l; 7 void split(string &t1,string & 阅读全文
posted @ 2013-03-20 21:15 symons 阅读(262) 评论(0) 推荐(0)

摘要: 这题就是宽搜,枚举每个点,但是要注意num[0](千位的位置)不能为0需要判断一下,然后再优化一下,就OK了。如果不优化的话,就会TLE。 1 #include <stdio.h> 2 #include <cmath> 3 #include <iostream> 4 #include <string.h> 5 #include <queue> 6 using namespace std; 7 struct node 8 { 9 int num[4];10 int step;11 };12 bool isPrim[10000+10];1 阅读全文
posted @ 2013-03-20 19:10 symons 阅读(160) 评论(0) 推荐(1)