自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Dillonh的博客

励志成为一名优秀的数学选手!(博客园地址:http://www.cnblogs.com/Dillonh/)

  • 博客(16)
  • 收藏
  • 关注

原创 Dungeon Master(三维bfs)

题目链接:http://poj.org/problem?id=2251题目:DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. ...

2018-04-30 21:23:46 240

原创 食物链(带权并查集)

题目链接:http://poj.org/problem?id=1182题目:Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"...

2018-04-30 00:35:38 262

原创 Chinese Rings (九连环+矩阵快速幂)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2842题目:Problem DescriptionDumbear likes to play the Chinese Rings (Baguenaudier). It’s a game played with nine rings on a bar. The rules of this game are...

2018-04-29 22:22:20 310

原创 Plant (矩阵快速幂)

题目链接:http://codeforces.com/problemset/problem/185/A题目:Dwarfs have planted a very interesting plant, which is a triangle directed "upwards". This plant has an amusing feature. After one year a triangle...

2018-04-29 22:10:40 325

原创 Tr A(矩阵快速幂)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1575题目:Problem DescriptionA为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。  Input数据的第一行是一个T,表示有T组数据。每组数据的第一行有n(2 <= n <= 10)和k(2 <= k < 10^9)两...

2018-04-29 21:59:48 313 2

原创 湘潭校赛——又见斐波那契(矩阵快速幂)

题目链接:https://www.nowcoder.com/acm/contest/105/G思路:这题一看数据范围就知道是个矩阵快速幂,通过构造矩阵知我们需要的转移矩阵为下图形式,不过需要特判1然后输出的是n-1的结果哦,因为这个我本题WA了==!矩阵快速幂最难得就是构造矩阵,当矩阵构造出来之后基本上就好做了~代码实现如下:#include <cstdio> #include &lt...

2018-04-27 17:32:19 170

原创 高精减模板

这个的意思是将a翻转过来与a相减的绝对值 int t; string a, b; int m[maxn; void BigInteger_subtract(string a, string b) { memset(m, 0, sizeof(m)); int len = a.size(); for(int i = len - 1; i >= 0;...

2018-04-22 19:37:21 349

原创 最短路之spfa系列

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2544Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?  Input输入包括多组数据。每组数据第一行是两个...

2018-04-20 22:46:56 254

原创 Exponial (欧拉定理+指数循环定理+欧拉函数+快速幂)

题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=2021DescriptionEverybody loves big numbers (if you do not, you might want to stop reading at this point). There are many ways of constructing re...

2018-04-20 16:54:55 435

原创 Farey Sequence (欧拉函数+前缀和)

题目链接:http://poj.org/problem?id=2478DescriptionThe Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 < a < b <= n and gcd(a,b) = 1 arrang...

2018-04-20 16:52:29 367

原创 POJ3090 Visible Lattice Points(欧拉函数)

欧拉函数欧拉函数的定义:1~N中与N互质的数的个数被称为欧拉函数,我们用phi[i]来记录与i互质的数的个数。根据算数基本定理(唯一分解定理),即N可以分解成N=p1^c1*p2^c2*…pm^cm,其中pi为质数可以推出phi[N]=N * (p1 - 1) / p1 * (p2 - 1) / p2*…(pm - 1) / pm。欧拉函数的部分性质:phi[n] = phi[n / p] * (...

2018-04-17 19:17:39 210

原创 2018年长沙理工大学第十三届程序设计竞赛

昨天参加了我校的ACM校赛,感谢队友的帮助,成功夺得第四名。比赛结束之后,整理了一下比赛时写的代码,并将分给队友的题都自己敲了一遍,然后写了一篇不完全的题解(正在更新中),博客链接为:http://www.cnblogs.com/Dillonh/p/8835074.html。如果有什么意见,还请指点,谢谢~...

2018-04-15 23:23:50 323

原创 Piggy-Bank(多重背包+一维和二维通过方式)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1114题面:Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this ac...

2018-04-12 23:17:25 392

原创 Intersecting Lines (计算几何基础+判断两直线的位置关系)

题目链接:http://poj.org/problem?id=1269题面:DescriptionWe all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no int...

2018-04-11 13:34:41 617

原创 Morley's Theorem (计算几何基础+向量点积、叉积、旋转、夹角等+两直线的交点)

题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2119题面:Morleys theorem states that that the lines trisecting the angles of an arbitrary...

2018-04-10 17:01:08 678

原创 TOYS(计算几何基础+点与直线的位置关系)

题目链接:http://poj.org/problem?id=2318题面:DescriptionCalculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away whe...

2018-04-09 19:24:26 220

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除