自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

kongming_acm的专栏

如果不能正常显示代码 ,请右键->查看源文件 来查看源代码 里面有代码部分 另外由于网站原因 \n在博客里都显示是/n 请自己更改

  • 博客(48)
  • 资源 (7)
  • 收藏
  • 关注

原创 hdu 3977 Evil teacher 求fibonacci数列的循环节

Problem DescriptionIn the math class, the evil teacher gave you one unprecedented problem!Here f(n) is the n-th fibonacci number (n

2011-08-31 19:30:18 1487

原创 hdu 3973 AC's String 字符串哈希处理 查询子串是否是模式串 可以修改

Problem DescriptionYou are given some words {Wi}. Then our stupid AC will give you a very long string S. AC is stupid and always wants t

2011-08-30 20:59:27 987

原创 hdu 3980 Paint Chain 博弈+SG函数 每次选连续M个

Problem DescriptionAekdycoin and abcdxyzk are playing a game. They get a circle chain with some beads. Initially none of the beads is pain

2011-08-28 21:28:17 825

原创 hdu 3974 Assign the task 树上操作,更改每棵子树的值,查询各节点当前值 线段树+时间戳

Problem DescriptionThere is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (excep

2011-08-28 21:08:49 649

原创 hdu 3972 1 M possible 从3*n+2中找出两个特殊的数 (其余3*n每三个相同)

Problem DescriptionThere are 3*N+2 nonnegative integers. Except two special integers, the rest 3*N integers can form N triple groups: { Vi

2011-08-25 21:22:57 863

原创 joj 2653 不同的数 从2*n中找出不相同的两个数

2653: 不同的数ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s65536K38778Standard原来有n对数字

2011-08-25 20:58:57 723

原创 poj 2472 106 miles to Chicago a->b有安全概率,求i->j安全概率最大的一条路

DescriptionIn the movie "Blues Brothers", the orphanage where Elwood and Jack were raised may be sold to the Board of Education if they do

2011-08-19 10:07:46 737

原创 zoj 2027 Travelling Fee 求a->b的最少花费(去除路上的最大花费后的费用)

Samball is going to travel in the coming vacation. Now it's time to make a plan. After choosing the destination city, the next step is to de

2011-08-19 09:54:17 560

原创 hdu 3501 Calculation 2 求所以小于n且与n不互质的数之和

Problem DescriptionGiven a positive integer N, your task is to calculate the sum of the positive integers less than N which are not copr

2011-08-18 21:32:23 698

原创 hdu 3952 Fruit Ninja 几何

#include#include#includeusing namespace std;struct Point{    int x,y;};struct Line{    Point a,b;};struct Polygon{

2011-08-18 19:35:58 640

原创 hdu 3951 Coin Game 博弈

The game goes like this: Two players start the game with a circle of n coins. They take coins from the circle in turn and every time the

2011-08-18 18:27:57 723

原创 hit 2813 Garden visiting 求C(a,b)%p p任意 a,b,p<=1e5

Problem DescriptionThere is a very big garden at Raven’s residence. We regard the garden as an n*m rectangle. Raven’s house is at the to

2011-08-17 21:11:59 864

原创 fzu 2038 2038 Another Postman Problem 在一棵树上求sigma sigma(i->j 距离)

Chinese Postman Problem is a very famous hard problem in graph theory. The problem is to find a shortest closed path or circuit that visits

2011-08-17 19:31:05 772

原创 fzu 2036 2036 Log Calculator JAVA 浮点数输出精度控制

http://acm.fzu.edu.cn/problem.php?pid=2036a>ba=log2(x)   x=2^ab=log2(y)   y=2^blog2(x+y)=b+log2(1+2^(a-b));/* * To change this

2011-08-17 19:19:17 1157

原创 hdu 3938 Portal 计算两点路上最大距离中的最小值<=L的路径个数 离线并查集

Problem DescriptionZLGG found a magic theory that the bigger banana the bigger banana peel .This important theory can help him make a po

2011-08-17 16:56:00 844

原创 hdu 3935 Dark Room 有n*m的灯,最少几次可以把所有的灯点亮,每次可点周围5个 m<=20

Problem DescriptionOne day Harry Potter came to a magic room, in which there are some shadow monsters sent by the black wizard waiting for

2011-08-17 13:09:48 1442

原创 joj 2732: Cow XOR 求最大异或段

Farmer John is stuck with another problem while feeding his cows. All of his N (1 ≤ N ≤ 100,000) cows (numbered 1..N) are lined up in front

2011-08-16 22:40:17 1013

原创 hdu 3037 Saving Beans 求Comb(n,m)%p p是素数且p<=10000

Problem DescriptionAlthough winter is far away, squirrels have to work day and night to save beans. They need plenty of food to get thro

2011-08-16 20:18:09 985

原创 hdu 3933 Dark Parth

Problem DescriptionIn the dark path, the single figure is walking difficultly in the listless rainfall. No one knows his real destination.

2011-08-16 11:41:14 434

原创 hdu 3920 Clear All of Them I 状态压缩DP

Problem DescriptionAcmers have been the Earth Protector against the evil enemy for a long time, now it’s your turn to protect our home.

2011-08-15 22:51:02 581

原创 poj 2253 Frogger 求从a到b路上的最大值中的最小值

DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He p

2011-08-15 22:10:49 507

原创 poj 2263 Heavy Cargo 求a到b路上最小值中的最大值

DescriptionBig Johnsson Trucks Inc. is a company specialized in manufacturing big trucks. Their latest model, the Godzilla V12, is so big

2011-08-15 21:55:09 457

原创 poj 2570 Fiber Network 一直每条边可以通过某些公司过去,问从a到b可以通过那几个公司(同一个)过去

DescriptionSeveral startup companies have decided to build a better Internet, called the "FiberNet". They have already installed many node

2011-08-15 21:34:56 411

原创 poj 2240 Arbitrage 是否存在套率 Bellman-ford

DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of

2011-08-15 21:16:24 574

原创 hdu 3939 Sticks and Right Triangle 求<=N的素勾股数的个数 容斥原理

不会做  直接贴Problem DescriptionWe have a stick with infinite length. Now we want to cut 3 sub-sticks with length x, y, z which is not

2011-08-15 19:46:06 1213

原创 poj 1305 Fermat vs. Pythagoras 求小于等于N的素勾股数的个数 暴力方法

DescriptionComputer generated and assisted proofs and verification occupy a small niche in the realm of Computer Science. The first proo

2011-08-15 19:15:13 1837

原创 hdu 3930 Broot x^k=b%m 已知k,b,m,求所有小于m的解x m是素数

Problem DescriptionThere is a way of encryption in the Digital planet. If the number x, who lives in M area, K layer, then it will chang

2011-08-15 18:25:51 1308

原创 斐波那契数列性质

不经意间,斐波那契数列中的斐波那契数会经常出现在我们的眼前——比如松果、凤梨、树叶的排列、某些花朵的花瓣数、黄金矩形、黄金分割、等角螺线等,有时也可能是我们对斐波那契额数过于热衷,把原来只是巧合的东西强行划分为斐波那契数。比如钢琴上白键的8,黑键上的5都是斐波那契数,因该把它看做

2011-08-15 11:24:44 2396

原创 hdu 3895 Inverting Cups 每次翻转b个杯子,最少多少次把所有杯子都翻转一次

Problem DescriptionWhen people drink some tea in the teahouse, they also play some casual games. Now, inverting cups is a popular game.

2011-08-14 11:53:54 837

原创 hdu 3925 Substring a至少加上多少,会含有b

Problem DescriptionGive you two number a, b. Output the smallest number that can be added to a to contain the number b as a substring.

2011-08-14 10:53:56 747

原创 hdu 3926 Hand in Hand 判断两个度最多是2的无向图是否同构

Problem DescriptionIn order to get rid of Conan, Kaitou KID disguises himself as a teacher in the kindergarten. He knows kids love games a

2011-08-13 22:30:33 969

原创 poj 2154 c种颜色染n个格子,旋转算一种

DescriptionBeads of N colors are connected together into a circular necklace of N beads (N<=1000000000). Your job is to calculate how many

2011-08-13 09:42:57 636

原创 poj 2409 Let it Bead 一串由n个珠子组成的项链用c种颜色染,旋转/翻转算一种方案,问一共有多少种不同的染色方案

#include const int mod=1000000007;int fun(int a,int n){    if(n==1) return a%mod;    if(n==0) return 1;    long long t=fun(a,n/2

2011-08-13 09:38:49 1905

原创 hdu 3923 Invoker c中颜色染n个格子,旋转和翻转算一种

Problem DescriptionOn of Vance's favourite hero is Invoker, Kael. As many people knows Kael can control the elements and combine them to i

2011-08-13 09:35:12 899

原创 hdu 3927 Math Geek 反幻方构造

Problem DescriptionSheldon's board has been changed! Someone drew a N * N grid on his board. Although he has no idea who's the bad guy, bu

2011-08-13 09:28:06 918

原创 poj 3764 The xor-longest Path 找异或值最大的两个数

DescriptionIn an edge-weighted tree, the xor-length of a path p is defined as the xor sum of the weights of edges onp:⊕ is the x

2011-08-12 12:22:37 1655

原创 hdu 3915 Game 求N个数中取若干个数字使得它们的异或值为0的方法数 高斯消元(mod2)

Problem Description  Mr.Frost is a child who is too simple, sometimes naive, always plays some simple but interesting games with his frien

2011-08-12 11:53:49 4480

原创 hdu 3911 Black And White 一串0 1的数字 操作将一段区间[ i , j ]的每个数字进行异或操作 问区间最长0|1串

Problem DescriptionThere are a bunch of stones on the beach; Stone color is white or black. Little Sheep has a magic brush, she can change

2011-08-12 11:09:19 1324

原创 求 a/b % p

http://acmpj.zstu.edu.cn/JudgeOnline/showproblem?problem_id=3076要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Inpu

2011-08-09 13:12:08 885

原创 hdu 1255 覆盖的面积 求矩形面积交

Problem Description给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积. Input输入数据的第一行是一个正整数T(1注意:本题的输入数据较多,推荐使用scanf读入数据.

2011-08-03 15:47:39 809

自己的ACM题库和模板

自己的ACM题库和模板

2012-02-04

java聊天室

java聊天室

2011-12-29

dancing links

DLX dancinglinks 跳舞链

2011-12-29

拓展 KMP edtend MP

给定一个串S,定义n=|S|,extend[i]表示S与S[i…n]的最长公共前缀长度。我们可以在线性时间内得到所有的extend[i]。 鉴于已有论文对这个算法进行细致、感性的描述,在此就不花费篇幅赘述这一算法。如果您想详细了解这一算法,可以参见《寻找最大重复子串》(作者林希德)和《求最长回文子串与最长重复子串》(作者何林)。

2011-04-14

joj 部分题目答案 自己做的 仅供参考

joj 部分题目答案 自己做的 仅供参考 joj 部分题目答案 自己做的 仅供参考 joj 部分题目答案 自己做的 仅供参考 joj 部分题目答案 自己做的 仅供参考 joj 部分题目答案 自己做的 仅供参考

2010-07-10

递推求解 集合了递推的一些题目

在一个平面上有一个圆和n条直线,这些直线中每一条在圆内同其他直线相交,假设没有3条直线相交于一点,试问这些直线将圆分成多少区域。

2010-07-10

空空如也

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

TA关注的人

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