随笔分类 - 数学问题
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1005思路:找规律题 1 #include 2 main() 3 { 4 int s[100]; 5 int a,b,n,i; 6 while(scanf("%d%d%d",&a,...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1014 1 //hdu1014 0ms 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 int a[1...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1290思路:n条直线最多能将一个平面分成几个区域其递推公式即为:f(n)=f(n-1)+n;递推一下,就得到f(n)=1/2*(n*n+n)+1;n个平面最多能将一个空间分成几个区域递推公式即为:g(n)...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1249part=3*s*(s-1)+2 1 #include 2 #include 3 main() 4 { 5 int n,s,i,p,m; 6 while(~scanf("%d",&n...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1279 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #inc...
阅读全文
摘要:题目链接:http://www.bnuoj.com/v3/problem_show.php?pid=24252这是四川2012年省赛的一道题,背景:海盗分宝藏。大概题意:给你N种价值的物品,物品有两个属性,一个是数量,一个是价值(价值是以2的ai次方表示的)。为了公平起见,求出宝藏分配的最小差(二进...
阅读全文
摘要:一道简单的规律题,画出二维表将数字分别相加可以发现很明显的对称性题目链接:http://www.bnuoj.com/v3/problem_show.php?pid=24251 1 #include 2 #include 3 #include 4 #include 5 #include 6 usin...
阅读全文