摘要: 地址:http://acm.uestc.edu.cn/#/problem/show/1324 卿学姐与公主 Time Limit: 2000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) 某日,百无聊赖的卿学姐打开了某1 阅读全文
posted @ 2016-05-03 18:04 weeping 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 1 void init(long long n,long long m) 2 { 3 long long i,j; 4 memset(c,0,sizeof(c)); 5 for(i=0;i<=m;i++) 6 c[0][i]=c[1][i]=1; 7 for(i=0;i<=m;i++) 8 c[i][i]=1; 9 ... 阅读全文
posted @ 2016-04-28 17:34 weeping 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 线段树:简单的说就是把【1,n】的区间二分,【1,(1+n)/2】左子树,【(1+n)/2+1,n】右子树 就这样一直分下去,直到都是【x,x】这样的区间。这样就构成了一颗树了^-^ 有这样一棵树,我们就可以在节点中储存区间的和啊,区间内的最大值啊,最小值等等。。这就是线段树的附加信息了,也是题目中 阅读全文
posted @ 2016-04-23 00:18 weeping 阅读(203) 评论(0) 推荐(0) 编辑
摘要: ps:代码对应的题目是杭电1874 flyod算法: 对于起点与终点,引入第三点p,d[s][t]=min(d[s][t],d[s][p]+d[p][t]); 代码://k为引入点 1 for(int i=0;i<=n;i++) 2 for(int j=0;j<=n;j++) 3 if(i==j)d 阅读全文
posted @ 2016-04-16 13:34 weeping 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/status.php?user=Honor&pid=1874&status=5 题目: Problem Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方 阅读全文
posted @ 2016-04-16 13:27 weeping 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1027 题目: Problem Description Now our hero finds the door to the BEelzebub feng5166. He opens the door and 阅读全文
posted @ 2016-04-14 19:53 weeping 阅读(890) 评论(0) 推荐(0) 编辑
摘要: 遇到了就查了下:地址:http://www.cnblogs.com/BeyondAnyTime/archive/2012/05/18/2508189.html 求一个组合数Cnm的值,Cnm= n! /(n-m)!*m!化简的结果为 Cnm = (n*(n-1)*…*(n-m+1))/m! 这个直接 阅读全文
posted @ 2016-04-09 17:49 weeping 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 地址:http://codeforces.com/contest/660/problem/C 题目: You are given an array a with n elements. Each element of a is either 0 or 1. Let's denote the leng 阅读全文
posted @ 2016-04-09 16:15 weeping 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 地址:http://codeforces.com/contest/660/problem/B 题目: B. Seating On Bus time limit per test 1 second memory limit per test 256 megabytes input standard i 阅读全文
posted @ 2016-04-09 16:08 weeping 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 地址:http://codeforces.com/contest/660/problem/A 题目: A. Co-prime Array time limit per test 1 second memory limit per test 256 megabytes input standard i 阅读全文
posted @ 2016-04-09 16:05 weeping 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1025 题目: Problem Description JGShining's kingdom consists of 2n(n is no more than 500,000) small cities w 阅读全文
posted @ 2016-04-08 19:37 weeping 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 地址:http://www.codeforces.com/problemset/problem/118/D 题目: Gaius Julius Caesar, a famous general, loved to line up his soldiers. Overall the army had n 阅读全文
posted @ 2016-04-07 16:02 weeping 阅读(515) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1024 题目: Problem Description Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a br 阅读全文
posted @ 2016-04-06 21:11 weeping 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1023 题目: Train Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others 阅读全文
posted @ 2016-04-05 22:28 weeping 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 地址:http://codeforces.com/problemset/problem/659/D 题目: D. Bicycle Race time limit per test 1 second memory limit per test 256 megabytes input standard 阅读全文
posted @ 2016-04-04 15:55 weeping 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 地址:http://codeforces.com/problemset/problem/659/C 题目: C. Tanya and Toys time limit per test 1 second memory limit per test 256 megabytes input standar 阅读全文
posted @ 2016-04-04 15:51 weeping 阅读(225) 评论(2) 推荐(0) 编辑
摘要: 地址:http://codeforces.com/problemset/problem/659/B 题目: B. Qualifying Contest time limit per test 1 second memory limit per test 256 megabytes input sta 阅读全文
posted @ 2016-04-04 15:45 weeping 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 第一场cf比赛,,,今天才写博客0.0 地址:http://codeforces.com/problemset/problem/659/A 题目: A. Round House time limit per test 1 second memory limit per test 256 megaby 阅读全文
posted @ 2016-04-04 15:40 weeping 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1022 题目: Problem Description As the new term comes, the Ignatius Train Station is very busy nowadays. A l 阅读全文
posted @ 2016-04-04 15:19 weeping 阅读(468) 评论(2) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1021 题目: Problem Description There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n 阅读全文
posted @ 2016-04-04 14:05 weeping 阅读(231) 评论(0) 推荐(0) 编辑