- 博客(15)
- 资源 (2)
- 收藏
- 关注
原创 poj 1094 Sorting It All Out_拓扑排序
题意:是否唯一确定顺序,根据情况输出#include #include#include#includeusing namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */#define N 30int n,m;i
2013-07-31 15:44:18 571
原创 poj 1734 Sightseeing trip_ 最小环记录路径
题意:求最出小环,输出路径#include #includeusing namespace std;#define N 110#define INF 0xffffffint map[N][N],n,m,dist[N][N],pre[N][N],path[N];/* run this program using the console pauser or add your own g
2013-07-31 11:04:20 474
原创 hdu 1599 find the mincost route_最小环
#include #includeusing namespace std;#define N 110#define INF 0xffffffint map[N][N],n,m,dist[N][N];/* run this program using the console pauser or add your own getch, system("pause") or input lo
2013-07-31 10:08:49 402
原创 hdu 4619 Warm up 2_最大独立集
三个人整个下午都想不出这题后来看题解,竟然用匈牙利算法的最大独立集,我顿时晕了。题意:给竖着和横着的方块,除去重叠的,最多能留下几个方块#include #include using namespace std;#define N 1010struct Point{ int x,y; Point(){} Point(int a,int b){x=a;y=
2013-07-25 21:47:50 496
原创 poj 1573 Robot Motion_模拟
又是被自己的方向搞混了题意:走出去和遇到之前走过的就输出。#include #include #includeusing namespace std;#define N 110int map[N][N],visit[N][N],n,m,flag;//n为x轴 m为y轴 int dir[][2]={{0,1},{1,0},{0,-1},{-1,0}};//e,s,w,nint
2013-07-24 22:01:22 447
原创 poj 2632 Crashing Robots_模拟
做的差点想吐,调来调去,编译器都犯毛病,wlgq,幸好1a。题意:给你机器人怎走的路线,碰撞就输出#include #include #include#include#define N 110using namespace std;struct Rob{ int x,y,dire;//dire 1为e,2为s,3为w,4为n}rob[N];int n,m
2013-07-24 18:09:35 526
原创 poj 1328 Radar Installation_贪心
翻出一年多前的代码看,发现以前的代码风格很糟糕题意:给你n个点 m为圆的半径,问需要多少个圆能把全部点圈到#include #include #include using namespace std; struct ss{ double x,y; }a[1005]; int cmp(ss x,ss y) { if(x.x==y.x)return x.
2013-07-21 22:01:46 435
转载 DevC++ 工程没有调试信息的解决办法
DevC++4.9.9.2中,按 F8 开始调试。提示信息为:工程没有调试信息,您想打开工程的调试选项并重新生成吗?选择是后,再按F8,仍旧是这个信息。什么原因呢?按照帮助,Frequently Asked Questions (FAQ)中提示How do i enable Debugging mode ?Go to Compiler Options and click on
2013-07-20 16:16:12 3552
原创 poj 2704 Pascal's Travels_记忆化搜索
一道简单但是题意蛋疼的题目题意:给你个n*n的图,开始在左上角,要求走到右下角有多种走法,图上的数表示走几步,只能向右或向下走。 #include#includeusing namespace std;#define N 40char map[N][N];int n;__int64 dp[N][N];__int64 solve(int x,int y){
2013-07-07 16:52:01 503
原创 hdu 1242 Rescue_bfs+优先队列
翻出以前的代码看看题意:走迷宫,遇到敌人要花一分钟。#include#includeusing namespace std;char map[205][205];int N = 999999999;int dir[4][2]={{0,1},{1,0},{-1,0},{0,-1}};int n,m;struct node{ int x; int y; int step;
2013-07-07 11:41:54 389
原创 hdu 1078 FatMouse and Cheese_记忆搜索
做这类型的搜索比较少,看懂题意花了半天题意:给你个n*n的图,老鼠一次最远走k步,老鼠起初在(0,0),每次偷吃的东西必须比之前偷吃的总和都要大。#include#includeusing namespace std;#define N 110int map[N][N],dp[N][N];int n,k;int dir[][2]={{1,0},{0,1},{-1,0
2013-07-06 21:04:47 552
原创 hdu 1253 胜利大逃亡_三维
第一次做三维的题,这题跑g++超时了,c++过了.#include#include#includeusing namespace std;#define N 52int map[N][N][N],visit[N][N][N],a,b,ttime,c;struct Node{ int i,j,k; int time;};int dir[][3]={{1,0,0},{0,1,
2013-07-06 16:32:18 510
原创 hdu 1072 Nightmare
一道简单的bfs,练练手,好久没敲bfs的题题目的意思是有个炸弹,必须在6分钟内逃出迷宫,途中有重置炸弹时间的装置。#include#include#includeusing namespace std;int map[10][10],n,m,num;struct Node{ int x,y; int BomTime; int time;} start;Node vi
2013-07-06 16:30:07 477
原创 poj 3070 Fibonacci
#include#includeusing namespace std;struct node{ int v[2][2];};node mult(node ma,node mb){ int i,j,k; node ans; for(i=0;i<2;i++) for(j=0;j<2;j++) { ans.v[i][j]=0; for(k=0;k<2;k++)
2013-07-05 20:15:08 545
原创 poj 3233 Matrix Power Series
A为一个n*n的矩阵,求A+A^2+A^3+...+A^n Sk = A + A2 + A3 + … + Ak =(1+Ak/2)*(A + A2 + A3 + … + Ak/2 )+{Ak} =(1+Ak/2)*(Sk/2 )+{Ak}// k为偶数时无 {Ak}Ak 可用二分迭代求出因此,只要求出 上面的三部
2013-07-05 19:48:17 467
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人