自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 poj 1135 Domino Effect

Domino EffectTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12325 Accepted: 3083DescriptionDid you know that you can use domino bones for other things besides playing Dominoes? Take a numbe...

2018-05-12 17:47:32 189

转载 最短路模板:使用priority_queue实现的Dijkstra算法

原文链接https://blog.csdn.net/synapse7/article/details/19218865测试数据:8 154 5 0.355 4 0.354 7 0.375 7 0.287 5 0.285 1 0.320 4 0.380 2 0.267 3 0.391 3 0.292 7 0.346 2 0.403 6 0.526 0 0.586 4 0.93测试结果:1 1.052...

2018-05-12 11:37:56 214

转载 c++ 数字与字符串的相互转换

转自https://blog.csdn.net/michaelhan3/article/details/75667066首先推荐用用C++的stringstream。 主要原因是操作简单。数字转字符串,int float类型 同理#include <string>#include <sstream>int main(){ double a = 123.32;...

2018-04-16 20:36:22 188

原创 P1095 守望者的逃离

题目描述恶魔猎手尤迪安野心勃勃,他背叛了暗夜精灵,率领深藏在海底的娜迦族企图叛变。守望者在与尤迪安的交锋中遭遇了围杀,被困在一个荒芜的大岛上。为了杀死守望者,尤迪安开始对这个荒岛施咒,这座岛很快就会沉下去。到那时,岛上的所有人都会遇难。守望者的跑步速度为17m/s,以这样的速度是无法逃离荒岛的。庆幸的是守望者拥有闪烁法术,可在1s内移动60m,不过每次使用闪烁法术都会消耗魔法值10点。守望者的魔法...

2018-04-06 15:16:37 351

原创 P1002 过河卒

棋盘上A点有一个过河卒,需要走到目标B点。卒行走的规则:可以向下、或者向右。同时在棋盘上C点有一个对方的马,该马所在的点和所有跳跃一步可达的点称为对方马的控制点。因此称之为“马拦过河卒”。棋盘用坐标表示,A点(0, 0)、B点(n, m)(n, m为不超过20的整数),同样马的位置坐标是需要给出的。现在要求你计算出卒从A点能够到达B点的路径的条数,假设马的位置是固定不动的,并不是卒走一步马走一步。...

2018-04-06 15:09:14 175

原创 poj 2376 cleaning shifts

Cleaning ShiftsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 27628 Accepted: 6814DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores ...

2018-04-06 13:09:48 111

原创 hdu 1198Farm Irrigation

Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square has a different type of ...

2018-04-03 21:59:17 89

原创 poj 2559 Largest Rectangle in a Histogram

Largest Rectangle in a HistogramTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 24218 Accepted: 7830DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a comm...

2018-04-02 23:29:44 73

原创 poj 3246 Balanced Lineup

Balanced LineupTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 59869 Accepted: 28040Case Time Limit: 2000MSDescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line...

2018-03-30 20:34:58 142

原创 poj 1742 coins

DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nice watch...

2018-03-29 19:28:16 74

原创 Find a way

Find a wayTime Limit : 3000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 7   Accepted Submission(s) : 6Problem DescriptionPass a year learning in Hangzhou, yifen...

2018-03-27 20:30:10 121

原创 集合的二进制表示 && 状态压缩dp

按位与 & 可以表示集合的交集;按位或 | 表示集合的并集;按位异或 ^表示集合对称差;~按位取反  二进制中用01表示,如果说一个元素i存在,那他在集合中就表示1;空集  ………………0只含有第i个元素的集合{i}:…………………………1<<i    从右往左数,从0开始;含有全部n个元素的集合{0,1,2,……,n-1}…………………………(1<<n)-1;判断...

2018-03-26 22:56:15 486

原创 P1230 智力大冲浪

这题应该是贪心吧,对于每一个游戏,当然是扣钱扣得多的先玩,按照价值从大到小排序,对于当前的价值,从当前的t时段开始遍历,如果说t时段已经被占用了,看看前面的t-1是否被占用,一直到1;如果都被占用了,说明这个游戏不能进行#include <iostream>#include <algorithm>using namespace std;struct node{ ...

2018-03-25 22:45:04 435

原创 Find The Multiple哈夫曼思想

题目的意思是求解一个数(只由0,1组成),这个数是n的倍数;最开始应该是mod[i]=mod[i/2]*10+i%2求这个数模n是否等于0;如果说等于0就说明这个数是n的倍数但因为mod[i]中储存的数字会过大,所以可以根据同余方程采取一步一模的思想    同余模定理(a*b)%n = (a%n *b%n)%n(a+b)%n = (a%n +b%n)%n两个数乘积的模等于两个数模的余数的乘积#in...

2018-03-25 16:01:13 167

转载 哈夫曼树

SSSSSSS://

2018-03-25 14:27:33 88

原创 Aggressive cows poj2456

对于这道题的看法  二分答案 加上一点贪心二分搜索的是两头牛之间的最大能够达到的距离#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int L,M,N,k=1,s;int a[505],b[505],c[505],kk[250005];int ma...

2018-03-23 21:22:56 119

原创 hdu 2141 Can you find it?

对于这道题,当时在程序挑战竞赛这本书上看到过类似的他的优化就是分治加二分,这道题也一样, 先把a,b两个数加起来进行优化#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int L,M,N,k=1,s;int a[505],b[505],c[505],...

2018-03-23 21:17:49 63

原创 Need for Speed

对于这道题,当时wa了很多次,当我在while循环里面取mid的时候,就wa,当把mid先放在外面取的时候就过了#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int n;int d[1005],s[1005];double t;bool c(d...

2018-03-23 21:02:54 157

空空如也

空空如也

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

TA关注的人

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