- 博客(219)
- 收藏
- 关注
原创 Ural 1309 Dispute (递推)
题意:给你一个数列:f(0) = 0f(n) = g(n,f(n-1))g(x,y) = ((y-1)*x^5+x^3-xy+3x+7y)%9973让你求f(n) n 思路:令m = 9973容易观察g(x,y) = g(x%m,y)f(x+m) = g( (x+m) %m , f(x+m-1))........可以得到 f(x+m) = (A*f
2014-11-09 19:27:58
1177
原创 UVa 12683 Odd and Even Zeroes(数论+数位DP)
UVa 12683 Odd and Even Zeroes(数论+数位DP)
2014-10-19 17:37:42
1334
原创 UVa 12716 GCD XOR (简单证明)
题意: 问 gcd(i,j) = i ^ j 的对数(j 思路:容易想到 形如 (2,3) (4,5).....这种互质相邻且二进制位数相同的数一定满足要求。那么对于gcd为2情况进行分析:从gcd(a,b) = 2得到a/2,b/2互质,可以想到a/2与b/2相差只能是1,因为要使a^b = 2 a,b只有在第1位有差别,即差别为2,如果a/2与b/2相差超过1,那么a,b就不
2014-10-15 14:19:28
1299
原创 UVa 12587 Reduce the Maintenance Cost(Tarjan + 二分 + DFS)
题意:n个城市(n 思路:首先边的费用可以通过Tarjan求桥之后求得(利用桥的性质),然后就是二分答案了!对于每个点,如果有个儿子不能维护,那么不可行,否则,试着让儿子去维护边权,如果不可行,只能让父亲承担。#include #include #include #include #include #include #include #include #include u
2014-10-12 12:30:43
857
原创 UVa 12585 Poker End Games
题意:Alice和Bob这对狗男女又开始玩游戏了!!!!一开始前者有a元,后者有b元,每次玩,每个人赢得概率是对半开的,令c为a,b中的最小值,那么每次玩,谁输了就给赢的人c元,问Alice赢的概率和游戏的盘数期望值!思路:貌似会迭代!公式也不好推。。。发现概率是0.5 然后误差范围是1e-5, 那么只要到达一定深度以后概率就可以忽略不计了! #include #include
2014-10-11 12:30:30
901
原创 UVa 12589 Learning Vector
题意:有n个向量(0 思路:先确定一点,对于选出的k个向量,按斜率从大到小的顺序摆放,面积最大。(不然会损失几个平行四边形的面积) 然后DP , DP[id][cur][height] 分别表示前id个向量,已经选出了cur个向量,高度为height的最大面积。面积计算公式为 x0*y0 + 2*x1*y0+x1*y1 + 2*x2*(y0+y1)........用记忆化搜索注意初始化的优化
2014-10-11 12:23:31
1107
原创 HDU 5047 Sawtooth(有趣的思维题+证明)
SawtoothTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 979 Accepted Submission(s): 375Problem DescriptionThink about a plane
2014-09-29 13:41:22
1304
原创 HDU 5017 Ellipsoid(模拟退火)
EllipsoidTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1015 Accepted Submission(s): 359Special JudgeProblem DescriptionGive
2014-09-23 15:12:34
830
原创 HDU 5027 Help!(三分+圆与线段的交点)
Help!Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 180 Accepted Submission(s): 32Problem Description“Help! Help!”While
2014-09-23 14:12:18
1319
原创 SGU 120 Archipelago (简单几何)
120. Archipelagotime limit per test: 0.25 sec. memory limit per test: 4096 KBArchipelago Ber-Islands consists of N islands that are vertices of equiangular and equilateral N-gon. Islands are
2014-09-17 15:17:09
780
原创 SPOJ 417 The lazy programmer(贪心)
417. The lazy programmerProblem code: LAZYPROGA new web-design studio, called SMART (Simply Masters of ART), employs two people. The first one is a web-designer and an executive
2014-09-16 15:07:25
1211
原创 HDU 4286 Data Handler (双端队列)
Data HandlerTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2455 Accepted Submission(s): 616Problem Description You are in
2014-09-12 21:47:49
763
原创 SGU 271 Book Pile(双端队列)
271. Book Piletime limit per test: 0.25 sec.memory limit per test: 65536 KBinput: standardoutput: standardThere is a pile of N books on the table. Two types of operations are p
2014-09-12 17:37:13
1164
原创 POJ2103 Jackpot(容斥+高精度)
JackpotTime Limit: 20000MS Memory Limit: 64000KTotal Submissions: 1044 Accepted: 216Case Time Limit: 2000MSDescriptionThe Great Dodgers company has recently
2014-09-04 10:53:32
1137
原创 HDU4288-Coder(线段树+离线+离散化)
CoderTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3183 Accepted Submission(s): 1254Problem Description In mathematics a
2014-09-03 13:19:22
928
原创 POJ2185-Milking Grid(KMP,next数组的应用)
Milking GridTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 6317 Accepted: 2648DescriptionEvery morning when they are milked, the Farmer John's cows for
2014-09-01 18:39:57
724
原创 UVa1635 - Irrelevant Elements(质因数分解)
Young cryptoanalyst Georgie is investigating different schemes of generating random integer numbers ranging from 0 to m - 1. He thinks that standard random number generators are not good enough, s
2014-08-29 20:46:22
1659
原创 LA3700 Interesting Yang Hui Triangle(Lucas定理)
Harry is a Junior middle student. He is very interested in the story told by his mathematics teacher about the Yang Hui triangle in the class yesterday. After class he wrote the following numbers to s
2014-08-29 14:18:12
1712
原创 HDU4746 Mophues(莫比乌斯反演)
MophuesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 327670/327670 K (Java/Others)Total Submission(s): 647 Accepted Submission(s): 263Problem DescriptionAs we know, any po
2014-08-27 19:48:04
1321
原创 HDU4372-Count the Buildings(第一类Stirling数+组合计数)
Count the BuildingsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 528 Accepted Submission(s): 171Problem DescriptionThere ar
2014-08-25 22:17:29
1347
原创 HDU3723-Delta Wave(Catalan数+组合计数)
Delta WaveTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 741 Accepted Submission(s): 243Problem DescriptionA delta wave is a
2014-08-25 19:08:28
842
原创 UVa10325 - The Lottery(容斥+最小公倍数)
The Lottery The Sports Association of Bangladesh is in great problem with their latest lottery 'Jodi laiga Jai'. There are so many participants this time that they cannot manage all the nu
2014-08-25 16:57:31
773
原创 HDU3240-Counting Binary Trees(Catalan数+求逆元(非互质))
Counting Binary TreesTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 564 Accepted Submission(s): 184Problem DescriptionThere
2014-08-25 15:41:18
1609
原创 POJ3525-Most Distant Point from the Sea(二分+半平面交)
Most Distant Point from the SeaTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 3955 Accepted: 1847 Special JudgeDescriptionThe main land of Japan ca
2014-08-20 21:06:23
999
原创 POJ1584-A Round Peg in a Ground Hole(凸包,判圆在凸包内)
A Round Peg in a Ground HoleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5301 Accepted: 1662DescriptionThe DIY Furniture company specializes in assem
2014-08-20 21:01:00
948
原创 POJ1408-Fishnet(线段求交)
FishnetTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1788 Accepted: 1144DescriptionA fisherman named Etadokah awoke in a very small island. He could s
2014-08-20 20:54:02
862
原创 POJ1228-Grandpa's Estate(凸包)
Grandpa's EstateTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 10851 Accepted: 2953DescriptionBeing the only living descendant of his grandfather, Kamr
2014-08-20 20:52:59
1167
原创 POJ2540-Hotter Colder(半平面交)
Hotter ColderTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2523 Accepted: 1045DescriptionThe children's game Hotter Colder is played as follows. Playe
2014-08-20 20:35:44
1281
原创 HDU4719-Oh My Holy FFF(DP线段树优化)
Oh My Holy FFFTime Limit: 5000/2500 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 606 Accepted Submission(s): 141Problem DescriptionN soldiers fr
2014-08-19 21:04:02
1241
原创 HDU4038-Stone(思维题)
StoneTime Limit: 3000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 2267 Accepted Submission(s): 568Problem DescriptionGiven an array of int
2014-08-18 17:48:23
742
原创 URAL1306-Sequence Median(优先队列)
1306. Sequence MedianTime limit: 1.0 secondMemory limit: 1 MBLanguage limit: C, C++, PascalGiven a sequence of N nonnegative integers. Let's define the median of such sequence. If N is
2014-08-15 20:30:51
932
原创 HDU4509-湫湫系列故事——减肥记II(线段树)
湫湫系列故事——减肥记IITime Limit: 5000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2395 Accepted Submission(s): 1018Problem Description 虽然制定了减肥食谱,
2014-08-15 18:34:36
644
原创 ZOJ2507-Let's play a game(Anti-Nim)
Let's play a gameTime Limit: 2 Seconds Memory Limit: 65536 KBElves from the Lothvain forest have created a very interesting game. The rules are very simple:There are two players.
2014-08-15 16:37:30
859
原创 HDU4289-Control(最小割定理)
ControlTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1606 Accepted Submission(s): 705Problem Description You, the head of
2014-08-15 14:54:24
582
原创 POJ2762-Going from u to v or from v to u?(Tarjan缩点,DAG判直链)
Going from u to v or from v to u?Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14474 Accepted: 3804DescriptionIn order to make their sons brave, Jiaji
2014-08-15 13:37:09
572
原创 HDU4902-Nice boat(线段树)
Nice boatTime Limit: 30000/15000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1455 Accepted Submission(s): 645Problem DescriptionThere is an o
2014-08-14 17:11:22
737
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人