hdu 2579】的更多相关文章

题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2579 题目大意:走迷宫.对于障碍点,只有当前(dep+1)%k才能走,问最少时间. 解题思路: 只有一个关键: 每个点不是只可以走一次.最多可以走k次. 原因是对于一个点,可能是通过障碍点在k的倍数(即余数为0)步到达的,也可能是通过其它途径到达的,但是不是k的倍数(余数为1~k). 这样,判断状态是否重叠的依据就是看在(x,y)点的余数状态了.vis的第三维非常重要. #include "cst…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2579 Dating with girls(2) Description If you have solved the problem Dating with girls(1).I think you can solve this problem too.This problem is also about dating with girls. Now you are in a maze and th…
Dating with girls(2) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1812    Accepted Submission(s): 505 Problem Description If you have solved the problem Dating with girls(1).I think you can s…
题目链接 /* 题意是是传统的迷宫加上一个条件,墙壁在k的整倍数时刻会消失,那么求到达出口的最短时间. 关键点在于某个点最多被走k次,标记vis[x][y][time%k]即可. */ #include<queue> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int maxn=100+5;…
#include<stdio.h> #include<queue> #include<iostream> #include<string.h> #include<algorithm> #define N 200 using namespace std; struct node { int x,y,time; }start,end,cur,next; char map[N][N]; int visit[N][N][N],k,r,c; int dis…
#include<stdio.h> #include<string.h> #include<queue> #define N 110 int m, n, k, x1, x2, y1, y2; char map[N][N]; int v[N][N][N];//当时间是k的倍数时,障碍消失,之后又重现,所以在平时使用的二维标记数组中再加一维 ][] = {{-, }, {, }, {, -}, {, }}; using namespace std; struct node…
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember history, King plans to play losephus problem in the parade gap.He calls n(1≤n≤5000) soldiers, counterclockwise in a circle, in label 1,2,3...n. The firs…
Quicksum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3516 Accepted Submission(s): 2579 Problem Description A checksum is an algorithm that scans a packet of data and returns a single number. T…
Dating with girls(1) Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2127    Accepted Submission(s): 730 Problem Description Everyone in the HDU knows that the number of boys is larger than the…
Dating with girls(1) Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3869    Accepted Submission(s): 1196 Problem Description Everyone in the HDU knows that the number of boys is larger than the…