摘要: 转帖自:http://blog.csdn.net/gaotong2055/article/details/8637745集合R={1,2,3,4}的全排列可以分解为:1,{2,3,4}的全排列 + 2,{1,3,4}的全排列 + 3,{1,2,4}的全排列 + 4,{1,2,3}的全排列。继续分解:{2,3,4} 为 2,{3,4}的全排列,3,{2,4}, 4,{2,3}…………………………………………直到集合里只有一个元素,就可直接输出了.c语言代码: 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include < 阅读全文
posted @ 2013-03-10 21:41 hacker_hzh 阅读(159) 评论(0) 推荐(0)
摘要: a.Python1.6 中只适用于Unicode 字符串,2.0 中适用于所有字符串b. 1.5.2 版本中string 模块没有该方法c. 在Jython2.1 有d. 仅对Unicode 字符串有效,e.Python2.5 或者以上版本string.capitalize() 把字符串的第一个字符大写string.center(width) 返回一个原字符串居中,并使用空格填充至长度width 的新字符串string.count(str, beg=0,end=len(string)) 返回str 在string 里面出现的次数,如果beg 或者end 指定则返回指定范围内str 出... 阅读全文
posted @ 2013-03-09 15:42 hacker_hzh 阅读(223) 评论(0) 推荐(0)
摘要: 超级水题 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <math.h> 4 int main() 5 { 6 int T, n; 7 8 scanf( "%d", &T ); 9 10 while( T -- )11 {12 scanf( "%d", &n );13 printf( "%d\n", ( int )( pow( 2, n ) - 1 ) );14 }15 return 0;16 } 阅读全文
posted @ 2013-03-09 13:23 hacker_hzh 阅读(103) 评论(0) 推荐(0)
摘要: 二维费用的背包。。。。。我的第一道背包啊啊啊啊啊 代码如下:::::(*^__^*) 嘻嘻 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 5 int main() 6 { 7 int n, m, k, s, i, j, l; 8 int v[101], wi[101]; 9 int f[101][101];10 11 while( scanf( "%d%d%d%d", &n, &m, &k, &s ) != EOF )1 阅读全文
posted @ 2013-03-09 13:11 hacker_hzh 阅读(128) 评论(0) 推荐(0)
摘要: 今天去踢球进了一个。。。。(*^__^*) 嘻嘻。。。。不过就是开场的时候进的。。。之后立马不行了。。。。然后暴露弱菜本质,不停的被大四的鄙视。。。。。不过感觉挺好的。。。。有人带。。。。马上校里面比赛了 加油了话说今天一题都没A出来啊啊啊啊啊,明天先A了,然后把我要做的解决掉!!!滚会宿舍看书! 阅读全文
posted @ 2013-03-08 21:01 hacker_hzh 阅读(103) 评论(0) 推荐(0)
摘要: 递推就行啦啦啦啦啦代码如下: 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 double value[50000], sum; 7 int i, n; 8 9 value[1] = 1;10 value[2] = 3;11 for( i = 3, sum = 1.0 / 2 + 1.0 / 3; i < 50000; i ++ )12 {13 value[i] += value[i-1] + 1.0 + sum * 2.0;14 ... 阅读全文
posted @ 2013-03-06 16:56 hacker_hzh 阅读(124) 评论(0) 推荐(0)
摘要: 突然发现,一旦真真正正的学习(之前那真的不能算)起来就不那么纠结了。。。。加油!今天晚上,皇马和曼联都加油!!!加油,克里斯蒂亚诺*罗纳尔多!加油,马德里! 阅读全文
posted @ 2013-03-05 21:20 hacker_hzh 阅读(97) 评论(0) 推荐(0)
摘要: 递推。。。。fn[i] = fn[i-1] + fn[i-2] * 2代码如下: 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 int i, fn[1001]; 7 8 fn[3] = fn[2] = 2; 9 for( i = 4; i <= 1000; i ++ )10 {11 fn[i] = fn[i-1] + fn[i-2] * 2;12 fn[i] %= 10000;13 }14 while( scanf( "%d", ... 阅读全文
posted @ 2013-03-05 21:18 hacker_hzh 阅读(120) 评论(0) 推荐(0)
摘要: 话说PE了无数次啊啊啊啊啊请注意n==0的情况代码如下: 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 int n, i, j; 7 int myprint( int x ); 8 9 while( scanf( "%d", &n ) != EOF && n > 0 && n <= 10 )10 {11 if( n == 1 )12 {13 printf( " 1" );14 }15 el... 阅读全文
posted @ 2013-03-05 21:03 hacker_hzh 阅读(167) 评论(0) 推荐(0)
摘要: 好吧,好久没写博客了,哎,还记得寒假的时候说要每天写的,哎,坚持啊!一定要坚持啊,写下心得啊!!!话说这几天好纠结额,跟着老师做项目还是搞ACM真是纠结啊,当初不应该那么冲动,这种重要的事情以后一定要想好再做决定,当时真是一时激动,而且也没有认真想想,和找人当面聊一聊。这几天一直处于很纠结的状态。。。。。。。。。。而且我感觉这半年真的很重要,决定了后三年大学生活的状态,上学期做的还不够好,这学期要加油。这几天的状态真的是不行,我想:在做一件的时候就要马上投入进去,不要再考虑别的事情,不投入将一事无成。加油!!!还有今天晚上皇马对巴萨,虽然皇马估计会换下很多球星,但是还是那句话,加油!马德里!H 阅读全文
posted @ 2013-03-02 21:21 hacker_hzh 阅读(107) 评论(0) 推荐(0)