题意:给你地图‘X’是墙,‘.’是路,和两只公母企鹅的坐标,开始两只企鹅不会在墙里。他们如果没被困,或者没走到地图边缘,或者没被墙挡住,那么都是同时走的,上下同相走,左右反向走。求同时走到H点的最小时间。同时走耗时5s。图里有蜘蛛网‘O’,如果有一只被困,那么另一只可能是笨企鹅,也可能是聪明的企鹅,聪明的走一步耗时2s,笨的3s。如果一只企鹅走到另一只企鹅的旁边,可以把另一只救出来,让他到自己的位置。耗时11s。
两只企鹅如果都被困,就失败了。
做法:
bfs,因为不知道哪只是笨的,所以要bfs两次。打...
分类:
其他好文 时间:
2015-04-07 21:43:49
阅读次数:
142
F - Count the Colors
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu
Submit Status Practice ZOJ 1610
Description
Painting some colored segments on a line, some previously pain...
分类:
其他好文 时间:
2015-04-07 10:05:31
阅读次数:
164
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3706
题意:
给你两个标准重量的物体(质量为整数),你可以选择将其中一个分成两块(整数),求用这三个物体最多可以称出多少种重量。
其实一共就13种情况,数据量又比较小,用set排除一下重复的,注意下0就好。
代码:
#include ...
分类:
其他好文 时间:
2015-04-07 09:59:26
阅读次数:
156
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3712
题意:
一款游戏,高手玩家不会miss,得分至少为50。记分公式为P = Point * (Combo * 2 + 1),求最多得多少分,最低得多少分。
简单的贪心,贪心策略:最高分先50,再100,最后300。最低分反之即可。
...
分类:
其他好文 时间:
2015-04-07 09:58:05
阅读次数:
143
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3708
题意:
题意挺简单的,就是数一下有多少种线路,并处以公交车的数量。题目的图很吓人,如果被这唬了的话就惨了,省赛的时候每道题都应该仔细看过,以免造成不必要的损失。
解法一:
队友用的方法是用一张二维图来表示,如果对应位置已经被标记过了...
分类:
Web程序 时间:
2015-04-07 09:58:05
阅读次数:
157
ZOJ 2952 Find All M^N Please(数学啊 )...
分类:
其他好文 时间:
2015-04-06 23:23:34
阅读次数:
342
ZOJ 2954 Hanoi Tower(模拟啊 )...
分类:
其他好文 时间:
2015-04-06 23:22:31
阅读次数:
386
ZOJ 2949 Coins of Luck(概率dp求期望)...
分类:
其他好文 时间:
2015-04-06 20:22:45
阅读次数:
166
Count the ColorsTime Limit:2000MSMemory Limit:65536KB64bit IO Format:%lld & %lluSubmitStatusPracticeZOJ 1610DescriptionPainting some colored segments ...
分类:
其他好文 时间:
2015-04-06 12:40:24
阅读次数:
134
zoj 3202 Second-price Auction
水题,不解释了,直接贴代码
#include
#include
#include
#include
using namespace std;
struct node{
int x;
int y;
};
struct node number[105];
int cmp(struct node a,struct node b){...
分类:
其他好文 时间:
2015-04-06 01:08:18
阅读次数:
231