- 博客(11)
- 收藏
- 关注
原创 POJ 3270 Cow Sorting
Cow SortingTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3270DescriptionFarmer John's N (1 ≤ N ≤ 10,000) cows are lined
2016-01-23 16:19:54 381
原创 POJ 2689 Prime Distance
Prime DistanceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15305 Accepted: 4067DescriptionThe branch of mathematics called number theory is about properties of numbers. One of the areas
2016-01-22 14:54:52 444
原创 中国剩余定理(除数不互质)
对于 x%mod[1]=a[1]x%mod[2]=a[2]x%mod[3]=a[3]... mod[i] 之间不一定互质,求解最小x。对于 mod[i] 之间不一定互质的情况,需要将剩余定理修改一点。对于第一个方程 x[0]%mod[0]=a[0] ,可知 x[0] 的最小解即为 a[0] 。对于第二个方程 x[1]%mod[1]=a[1] ,假设 x[1]
2016-01-20 16:23:11 836
原创 中国剩余定理(除数互质版)
x%mod[1]=a[1]x%mod[2]=a[2]x%mod[3]=a[3]...已知mod之间相互互质,求解最小的x。中国剩余定理就是用于求解此类问题。反过来想,假设最小解为 x , mod 的最小公倍数为 Lcm ,可以很容易地想到通解为: x+Lcm*k(k>=0且为整数) 。因为对于 (x+Lcm*k)%mod[i]={x%mod[i]+(Lc
2016-01-20 10:39:20 592
原创 扩展欧几里得 解方程小记
本来以前学习的时候就懵懵懂懂,长时间不用就完全不会了。。首先对于扩展欧几里得,对于最一般的方程形式 ax+by=gcd(a,b),此方程一定有整数解,扩展欧几里便得能够求出其中的一组整数解x0,y0。对于欧几里得的代码:int exgcd(int a,int b){ if(b==0) return a; return exgcd(b,a
2015-10-15 15:27:53 1393
原创 POJ 1149 PIGS(最大流)
PIGSTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionMirko works on a pig farm that consists of M locked pig-houses and Mirko can
2015-08-03 20:26:02 402
原创 HDU 1532 Drainage Ditches(最大流)
Drainage DitchesTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionEvery time it rains on Farmer John's fields, a pond forms over
2015-08-03 20:19:30 348
原创 HDU 1150 Machine Schedule(最小点覆盖)
DescriptionAs we all know, machine scheduling is a very classical problem in computer science and has been studied for a very long history. Scheduling problems differ widely in the nature of t
2015-08-01 10:37:48 450
原创 POJ 1961 Period(KMP next数组巧用)
DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That
2015-07-31 16:49:37 376
原创 HDU 1158 Segment set(线段相交 并查集)
DescriptionA segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segments in it. The problem is to find the size of some segment
2015-07-31 16:22:27 426
原创 HDU 1542 Atlantis(线扫描求面积)
DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these map
2015-07-29 21:26:45 348
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人