symons

___________每一天都是幸福的!!

  博客园  ::  :: 新随笔  ::  :: 订阅 订阅  :: 管理
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 22 下一页

2013年9月20日

摘要: ...................... 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 bool vit[21];10 bool prim[10000];11 int n;12 bool isprim(int n){13 int i;14 for(i=2;i>n)68 // if(prim[n]==1) cout>n){71 while(~scanf("%d",&n)){72 // ... 阅读全文
posted @ 2013-09-20 18:40 symons 阅读(165) 评论(0) 推荐(0)

摘要: 1 /* 2 * dfs 3 * esc capslock 4 */ 5 6 #include 7 #include 8 #include 9 #include 10 using namespace std;11 int num[20],n;12 int l;13 bool success;14 string haha;15 bool vit[20];16 bool cmp(int a,int b){17 return a>b;18 }19 20 void init(string str){21 int i,j;22 l=str.length... 阅读全文
posted @ 2013-09-20 16:47 symons 阅读(194) 评论(0) 推荐(0)

2013年9月19日

摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define aabs(x) (x)>0?(x):-(x) 7 using namespace std; 8 int dir[4][2]={ 9 1,0,-1,0,10 0,1,0,-1};11 char gird[10][10];12 int m,n,t;13 bool vit[10][10];14 bool success;15 void init(){16 int i,j;17 success=0;18 for(i=0;i... 阅读全文
posted @ 2013-09-19 16:57 symons 阅读(171) 评论(0) 推荐(0)

摘要: 命令行方式,得每次用终端输入命令行设置,不方便。sudo rmmod psmouse #用来禁用触摸板sudo modprobe psmouse #用来启用触摸板想要永久禁用触摸板可以这样: 打开终端,然后sudo gedit /etc/modprobe.d/blacklist.conf加入一行blacklist psmouse重启电脑,就可禁用触控板了,以后如果想启用就删除该行。 阅读全文
posted @ 2013-09-19 02:21 symons 阅读(881) 评论(0) 推荐(0)

2013年9月13日

摘要: 1 /* 2 宽搜+记忆化搜索 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #define leftedge 1 10 #define rightedge 5 11 #define topedge 1 12 #define downedge 6 13 using namespace std; 14 struct status{ 15 int map[7][6]; 16 int step; 17 }; 18 bool success; 19 int res... 阅读全文
posted @ 2013-09-13 01:29 symons 阅读(271) 评论(0) 推荐(0)

2013年9月9日

摘要: 这题卡了一天,上午开始看算法导论,然后实现了,一开始是wa,后来TLE,由于我开始的实现方式比较笨,而且在递归调用的时候很是混乱,用了好多数组。导致我的代码不断的出问题。具体是算法导论33-4. 后来改动了一点,也是看到别人代码改的,我把两个代码都写上,大家一看便知! 在实现分治的时候,我是把左右两个分组都复制了,然后传递的是一个数组,好慢啊。。。改动就是把参数传递改成传的是地址了,这样就不用复制结构体数组啦,不知道节省了多少力气,(⊙o⊙)…首先是AC代码 1 #include 2 #include 3 #include 4 #include 5 #include 6 #defi... 阅读全文
posted @ 2013-09-09 22:47 symons 阅读(702) 评论(0) 推荐(0)

2013年9月4日

摘要: 1 #include 2 #include 3 /* 4 int fuc(int n){ 5 if(n%9==0) return 9; 6 else return n%9; 7 } 8 */ 9 10 int fuc(int n){11 return (n-1)%9+1;12 }13 14 int main(){15 int n,l,i;16 char str[10000];17 while(scanf("%s",&str)&&str[0]!='0'){18 n=0;19 l=strlen(str);2... 阅读全文
posted @ 2013-09-04 17:30 symons 阅读(331) 评论(0) 推荐(0)

2013年9月3日

摘要: 本体有2种方法,一种是矩阵快速幂,一种是找规律。我用的是矩阵快速幂。f(1)=1; f(2)=1; f(n)=( A*(f(n-1)) + B*(f(n-2)) )mod7;[ f(n) ] = [ A B ] * [ f(n-1) ] => [ f(n) ] = [ A B ] (n-2) * [ f(1) ][ f(n-1) ] [ 1 0 ] [ f(n-2) ] => [ f(n-1) ] [ 1 0 ] [ f(2) ] 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 struct 阅读全文
posted @ 2013-09-03 11:22 symons 阅读(147) 评论(0) 推荐(0)

摘要: 1 //*代表的是矩阵乘的运算,res是结果矩阵2 while(n){3 if(N&1)4 res=res*A;5 n>>=1;6 A=A*A;7 } 阅读全文
posted @ 2013-09-03 00:57 symons 阅读(108) 评论(0) 推荐(0)

2013年8月29日

摘要: for:shell_test1 #!/bin/bash2 var=13 var=$var+14 echo $var5 mkdir only_a_jokeshell_joke1 #!/bin/bash2 ./shell_test3 for((i=1;i<10;i++));4 do5 6 ./shell_test7 cp ./shell_test ./only_a_joke/8 cd only_a_joke9 done 阅读全文
posted @ 2013-08-29 19:28 symons 阅读(114) 评论(0) 推荐(0)

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 22 下一页