自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 hdu 1548 A strange lift

bfs 不是太难的//12.8 bfs 已过 未记载 #include<iostream>#include<queue>#include<string.h>using namespace std;int map[205];int visited[205];int counted[205];int n;int nexted[2]={1,-1};void bfs(int a,

2017-12-12 18:01:28 97

原创 ccf 2014 12 4最优灌溉

一道并查集的题//ccf 201412-4 最优灌溉 比较困难的一道并查集 已过 #include<iostream>#include<algorithm>using namespace std;int pre[100000];struct Node{ int first; int end; int val;};int find(int x){

2017-12-12 17:57:56 198

原创 hdu 1026 Ignatius and the Princess I

备注:带路径的bfs 这道题与普通的bfs相比有两个要点: 1.hero将会在有数字的格子上停留,直接用个数组fright[105][105]来保存。 2.要输出他每走一步的路径。每走一步他的方向(后继)都是不确定的,但是 他的前驱是确定的。所以,保存前驱就好。 3.输出的是最短时间,bfs出来的是最短的路径却不是最短的时间,所以要用优先队列根据时间来排序。总结一下就是bfs+优先队列

2017-11-29 21:20:14 111

原创 hdu 1010

hdu 1010 Tempter of the Bone(骨头的诱惑 Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie

2017-11-28 19:55:23 142

原创 hdu 2037 今年暑假不AC

很经典的一道贪心问题。 应把每组数据按照结束时间排好。根据结束的时间来找下一个开始的时间。//2037#include<iostream>#include<algorithm>using namespace std;struct AC{ int beg; int end;};AC ac[105];bool cmd(AC a,AC b){ return a.e

2017-11-21 20:36:35 138

原创 hdu 2111 Saving HDU

贪心。 稍想一下就知如何做,话不多说,附上代码。#include<iostream>#include<algorithm>#include<string.h>using namespace std;int main(){ int l,n; int j,i; int ans; int t; int *a=new int [n+1]; int

2017-11-21 20:28:50 112

原创 hdu 1272 小希的迷宫

hdu 1272 小希的迷宫 要点: 任意两个房间有且仅有一条路径可以相通。 1.不能形成环。 2.只能有一棵树,不能有多颗树。//1272 并查集 已过 #include<iostream>#include<string.h>using namespace std;#define Maxn 100005 int pre[100005];int used[Maxn];

2017-11-21 20:12:36 163

原创 hdu 1009 FatMouse' Trade

贪心。。。。。。#include#includeusing namespace std;int main()    //0 1不行了 { int M,N;//M 老鼠有的猫粮 N 仓库的数目  double ans=0; double c; int t1,t2,t=N; int i=1,z=1; while(scanf("%d%d",&M,&N)==2)

2017-11-21 19:56:17 104

原创 hdu 1257 最少拦截系统

贪心   注意前面用来拦截的后面也可以拦。//1257 最少拦截系统 #include#includeusing namespace std;int main(){   int n;   int k=1;   int i;      while(scanf("%d",&n)==1)   {   int a;   int *temp=new i

2017-11-18 09:03:16 84

原创 hdu 1061 Rightmost Digit

N^N的最后一个数,就等于N的最后一个数的N次方。而从1到9的n次方是成规律出现的。。。。。。//1061  #include#includeusing namespace std;int main(){ int n=1; int count; int i=1; int t,y; long long m; vector a[10]; w

2017-11-18 08:46:01 144

空空如也

空空如也

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

TA关注的人

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