自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(103)
  • 收藏
  • 关注

原创 51nod 1096 距离之和最小【水题】【介个为毛分在20分档里边了】

X轴上有N个点,求X轴上一点使它到这N个点的距离之和最小,输出这个最小的距离之和。Input第1行:点的数量N。(2 <= N <= 10000)第2 - N + 1行:点的位置。(-10^9 Output输出最小距离之和Input示例5-1-3079Output示例20思路:因为要在N

2016-11-30 21:26:32 401

原创 51nod 1281 山峰和旗子【二分+dp】好题~

用一个长度为N的整数数组A,描述山峰和山谷的高度。山峰需要满足如下条件, 0 A[P + 1]。现在要在山峰上插上K个旗子,并且每个旗子之间的距离 >= K,问最多能插上多少个旗子(即求K的最大值)。两个山峰之间的距离为|P - Q|。以上图为例,高度为:1 5 3 4 3 4 1 2 3 4 6 2。其中可以作为山峰的点为:1 3 5 10。放2面旗子,

2016-11-30 19:01:52 532

原创 51nod 1524 可除图的最大团【dp】

对于一般的图,最大团问题是一个NP-难的问题。然而,对于一些特殊的图,最大团问题可以有比较有效的解决方案。关于最大团问题的概念,请百度之。^_^在一个正整数集合A上定义可除图。 A = {a1, a2, ..., an} ,图上的顶点就是集合A中的数字。两个数字 ai  和  aj (i ≠ j) 之间有一条边的条件是 ai 能够被  aj  整除,或者 aj  能够被  ai  

2016-11-30 16:43:33 480

原创 51nod 1770 数数字【模拟+思维】

统计一下 aaa ⋯ aaan个a × b 的结果里面有多少个数字d,a,b,d均为一位数。样例解释:3333333333*3=9999999999,里面有10个9。Input多组测试数据。第一行有一个整数T,表示测试数据的数目。(1≤T≤5000)接下来有T行,每一行表示一组测试数据,有4个整数a,b,d,n。 (1

2016-11-30 14:43:44 458

原创 Codeforces 344D Alternating Current【模拟】

B. Alternating Currenttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMad scientist Mike has just finished constructi

2016-11-30 13:17:07 470

原创 Codeforces 344C Rational Resistance【思维+贪心】

A. Rational Resistancetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMad scientist Mike is building a time machine i

2016-11-30 13:13:40 559

原创 51nod 1420 数袋鼠好有趣【贪心】

有n只袋鼠。每只袋鼠的大小用一个整数表示。一只小袋鼠能装进一只大袋鼠的条件是,大袋鼠的大小至少是小袋鼠的两倍。每只大袋鼠最多可以装一只袋鼠。小袋鼠被装进大袋鼠之后就不能再装其它的袋鼠了。小袋鼠被装进大袋鼠之后就不能被我们看见了。请找出一个装袋鼠的方案,使得被看见的袋鼠最少。Input单组测试数据。第一行包含一个整数n(1≤n≤5*10^5)。接下

2016-11-29 23:44:02 549

原创 51nod 1051 最大子矩阵和【dp】

一个M*N的矩阵,找到此矩阵的一个子矩阵,并且这个子矩阵的元素的和是最大的,输出这个最大的值。例如:3*3的矩阵:-1 3 -12 -1 3-3 1 2和最大的子矩阵是:3 -1-1 31 2Input第1行:M和N,中间用空格隔开(2 <= M,N <= 500)。第2 - N + 1行:矩阵中的元素,每行

2016-11-29 21:02:01 464 1

原创 Codeforces 377B Preparing for the Contest【二分查找+优先队列+贪心】

B. Preparing for the Contesttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSoon there will be held the world's larg

2016-11-29 19:13:16 530

原创 Codeforces 377A Maze【Bfs+逆向思维】

A. Mazetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPavel loves grid mazes. A grid maze is an n × m rectangle maz

2016-11-29 18:59:39 573

原创 Hrbust 2294 修建传送门【思维】

修建传送门Time Limit: 1000 MSMemory Limit: 32768 KTotal Submit: 56(14 users)Total Accepted: 12(10 users)Rating: Special Judge: NoDescription     

2016-11-28 23:14:54 571

原创 51nod 1390 游戏得分【贪心+思维+谨慎】

A与B两人玩一个游戏,这个游戏有若干个回合(可能0回合)。游戏的回合依次标号为1,2,3,4...。你不需要关心游戏的内容,现在只要知道第i回合胜者会获得2*i-1分,每回合游戏不存在平局。现在已知A和B在游戏结束时各获得了x分与y分的总分。问A在这个游戏中至少获胜了几盘?如果给出的x与y一定不会出现那么输出-1.Input多组测试数据,第一行一个整数T,表示测试数据数

2016-11-28 17:52:35 521

原创 51nod 1677 treecnt【Dfs+思维+数论】好题

给定一棵n个节点的树,从1到n标号。选择k个点,你需要选择一些边使得这k个点通过选择的边联通,目标是使得选择的边数最少。现需要计算对于所有选择k个点的情况最小选择边数的总和为多少。样例解释:一共有三种可能:(下列配图蓝色点表示选择的点,红色边表示最优方案中的边)选择点{1,2}:至少要选择第一条边使得1和2联通。 选择点{1,3}:至少要选择第二

2016-11-28 15:32:34 735

原创 Codeforces#382(Div. 2) D.Taxes【哥德巴赫猜想】

D. Taxestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMr. Funt now lives in a country with a very specific tax law

2016-11-28 12:56:05 802

原创 Codeforces#382(Div. 2) C.Tennis Championship【递推】

C. Tennis Championshiptime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFamous Brazil city Rio de Janeiro holds a tenn

2016-11-28 12:50:23 798

原创 Codeforces#382(Div. 2) B.Urbanization【贪心】

B. Urbanizationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLocal authorities have heard a lot about combinatoria

2016-11-28 12:42:37 410

原创 Codeforces 629B Far Relative’s Problem【模拟】

B. Far Relative’s Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFamil Door wants to celebrate his

2016-11-27 22:21:09 367

原创 Codeforces 682C Alyona and the Tree【Dfs+YY思维】好题

C. Alyona and the Treetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlyona decided to go on a diet and we

2016-11-25 19:31:18 863

原创 Hrbust 1212 乘积最大【Dp+bignumber】恶心题....

乘积最大Time Limit: 1000 MSMemory Limit: 65535 KTotal Submit: 57(28 users)Total Accepted: 10(10 users)Rating: Special Judge: NoDescription今年是国际数

2016-11-25 16:50:22 650

原创 hrbust 2249 开锁魔法II【概率dp】

开锁魔法IITime Limit: 3000 MSMemory Limit: 256000 KTotal Submit: 42(33 users)Total Accepted: 32(29 users)Rating: Special Judge: NoDescription一日,

2016-11-24 18:35:27 561

原创 Codeforces 357C Knight Tournament【并查集】

A. Knight Tournamenttime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHooray! Berl II, the king of Berland is making a

2016-11-24 16:45:56 535

原创 Codeforces 357D Xenia and Hamming【数学+思维】

B. Xenia and Hammingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia is an amateur programmer. Today on the IT l

2016-11-24 16:33:37 441

原创 Codeforces#381(Div. 2) C. Alyona and mex【思维】好题~

C. Alyona and mextime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlyona's mother wants to present an array of n non-

2016-11-24 13:18:10 544

原创 Codeforces#381(Div. 2) B.Alyona and flowers【思维+暴力】

B. Alyona and flowerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Alyona is celebrating Happy Birthday! He

2016-11-24 13:09:31 870

原创 Codeforces#381(Div. 2) A.Alyona and copybooks【暴力】

A. Alyona and copybookstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle girl Alyona is in a shop to buy some co

2016-11-24 13:01:54 303

原创 Codeforces 556D Case of Fugitive【排序+贪心】

B. Case of Fugitivetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndrewid the Android is a galaxy-famous detective

2016-11-23 21:14:45 961

原创 Codeforces 556C Case of Matryoshkas【模拟】

A. Case of Matryoshkastime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndrewid the Android is a galaxy-famous detect

2016-11-23 20:07:37 457

原创 Codeforces #380(Div.2)E.Subordinates【贪心】

E. Subordinatestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n workers in a company, each of them has a u

2016-11-23 18:26:47 758

原创 【哈理工OJ 750题纪念!】Hrbust 2200 Escaping【建图+最大流-------Dinic】

EscapingTime Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 36(19 users)Total Accepted: 5(5 users)Rating: Special Judge: NoDescriptionOne

2016-11-23 15:08:38 677 2

原创 Codeforces #380(Div.2)D.Sea Battle【贪心】好题~

D. Sea Battletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGalya is playing one-dimensional Sea Battle on

2016-11-22 23:45:05 973

原创 Codeforces #380(Div.2)C.Road to Cinema【思维+二分查找】好题~

C. Road to Cinematime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya is currently at a car rental service, and he w

2016-11-22 21:56:29 1003

原创 Codeforces #380(Div.2)B.Spotlights【思维+前缀和优化】

B. Spotlightstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTheater stage is a rectangular field of size n × m. The

2016-11-22 21:22:14 908

原创 Codeforces #380(Div.2)A.Interview with Oleg【模拟】水题

A. Interview with Olegtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has interviewed Oleg and has written t

2016-11-22 21:09:54 652

原创 hdu 3452 Bonsai【最大流最小割-------Dinic】

BonsaiTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 995    Accepted Submission(s): 499Problem DescriptionAfter being assaulted

2016-11-22 18:05:45 384

原创 Codeforces 368D Sereja ans Anagrams【思维+map计数】

B. Sereja ans Anagramstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSereja has two sequences a and b and number p

2016-11-21 19:27:46 753

原创 Codeforces 368C Sereja and Algorithm【思维】

A. Sereja and Algorithm time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSereja loves all sorts of algorithms. He has

2016-11-21 19:12:36 328

原创 Poj 3411 Paid Roads【Dfs】

Paid RoadsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6876 Accepted: 2552DescriptionA network of m roads connects N cities (numbered from 1 to N).

2016-11-21 16:00:24 681

原创 那年初春、梦

以安为本。他走在冬天寒冷的街边,令他觉得兴奋的是不久之后即将迎来的暖春。路不难走,只不过路上偶尔会有成片结冰的地方,会很滑。很明显冰是先化掉了的一层雪,他觉得这层冰在保护上边的一层雪,以至于他们不会很快的化成水,结成冰。他觉得是暖暖的。这一年是2016年,哈尔滨的冬天的某些早晨会格外的寒冷。还好他的心一直是暖和的。那一年是2015年,哈尔滨的冬天

2016-11-21 02:01:11 359

原创 Codeforces 581C Developing Skills【贪心】

C. Developing Skillstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya loves computer games. Finally a game that h

2016-11-18 13:13:40 407

原创 hrbust 1611 最强兵力【二维费用完全背包+分类处理】

最强兵力Time Limit: 2000 MSMemory Limit: 65535 KTotal Submit: 33(17 users)Total Accepted: 18(16 users)Rating: Special Judge: NoDescription《魔兽争霸》

2016-11-17 20:31:06 361

空空如也

空空如也

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

TA关注的人

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