摘要: 今天早上郁闷了,有种被骗的感觉,wa了N次,看了别人的解题报告才知道,输入有多组数据。what?输入有多组数据,题目有说明么?InputThe first line of the input file contains a number of stars N (1#include//#include#defineM33000#definelowbit(x)x&(-x)... 阅读全文
posted @ 2011-04-24 11:24 cchun 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 七种qsort排序方法一、对int类型数组排序intnum[100];Sample:intcmp(constvoid*a,constvoid*b){return*(int*)a-*(int*)b;}qsort(nu... 阅读全文
posted @ 2011-04-24 09:27 cchun 阅读(269) 评论(0) 推荐(0) 编辑
摘要: HD1715题目http://acm.hdu.edu.cn/showproblem.php?pid=1715;大的fibonacci,用数组模拟,其实也不难,可是要优化就没那么容易了。以前做过大数加法,这一次用的是int二维数组,没有用难缠的字符数组了(字符数组好计算数的长度)。。所以还是贴过来了,,呵呵。#includeusing namespace std;int fib[1000][100... 阅读全文
posted @ 2011-04-24 05:28 cchun 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 大数,水题来着,不过如果不够细心,非常容易出错,水题水题,如果不够细心,水题也能搞死你。自己写的,哎,水平确实还不好,当模板实在不行。留自己以后慢慢欣赏。#includeusing namespace std;int main(void){int n,i,j,k,carry,answer[50000];while(cin>>n){ memset(answer,0,sizeof(answer... 阅读全文
posted @ 2011-04-24 05:19 cchun 阅读(197) 评论(0) 推荐(0) 编辑