题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3442 题目大意:三国时期,刘备逃亡.给定一个最大为50*50的地图,刘备在地图中只能往4个方向走. 地图中,A代表瞭望塔,攻击范围是2,攻击伤害是1: B 代表堡垒,攻击范围是3,攻击伤害是2: C 代表火焰,对于走在该位置上的单位造成3点伤害: D 代表弓箭手,攻击范围是2,攻击伤害是4: E 代表士兵,攻击范围是1,攻击伤害是5: $ 代表刘备: ! 代表目的地: # 代表障碍物 . 代表地板…
The kth great number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 10390 Accepted Submission(s): 4153 Problem Description Xiao Ming and Xiao Bao are playing a simple Numbers game. In a roun…
题目:这里 题意: 两个类似于栈的列表,栈a和栈b,n个操作,push a x表示把数x放进a栈的栈底,pop b 表示将栈b的栈顶元素取出输出,并释放这个栈顶元素,merge a b表示把后面的那个 栈里的元素全部压进前面的那个栈里面,并且压入后前面的栈的所有元素按其进栈顺序排列然后后面的栈变为了空. push和pop操作都还好,就是优先队列或者栈的操作,主要是merge操作,如果啊按照题目来模拟每次将后面的栈元素取出放入前面的栈,可能会超时,而超时的主要因素是每次都将 元素多的栈压入了元素少…
Continuous Same Game (1) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 410 Accepted Submission(s): 143 Problem Description Continuous Same Game is a simple game played on a grid of colored…
翻纸牌游戏 Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description 有一种纸牌游戏,很有意思,给你N张纸牌,一字排开,纸牌有正反两面,开始的纸牌可能是一种乱的状态(有些朝正,有些朝反),现在你需要整理这些纸牌.但是麻烦的是,每当你翻一张纸牌(由正翻到反,或者有反翻到正)时,他左右两张纸牌(最左边和最右边的纸牌,只会影响附近一张)也必须跟着翻动,现…
题目大意:有个人想破解他邻居的密码,他邻居告诉了一些关于这个密码的信息,并且给他一个单词集合,他用这些信息判断一下最少有多少种密码. 1->, 所有的密码都是有小写字母组成. 2->,密码的长度是 n (1<= n <=25). 3->,密码至少包含 k 种字符集里面的单词. 比如,给集合{"she", "he"},单词长度是3,最少包含两个单词的密码,很明显只能是“she”(题目表述的不清楚). 分析:因为要统计记录到达每个点…
之前做过一个题,是在学贪心的时候做的,所以这个题就想当然的跑偏了,当看到N是<=16 的时候,状态压缩就理所当然了 #include<iostream> #include<cstring> #include<cstdio> using namespace std; #define INF 0x3f3f3f3f struct Dp { int reduce; int tim; int fa; }; struct Course { int d; int c; ]; }…
Doing Homework Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3595 Accepted Submission(s): 1424 Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lo…
题目链接: http://poj.org/problem?id=1170 Shopping Offers Time Limit: 1000MSMemory Limit: 10000K 问题描述 In a shop each kind of product has a price. For example, the price of a flower is 2 ICU (Informatics Currency Units) and the price of a vase is 5 ICU. In…
题目链接 Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after the deadline, the teacher w…