Asteroids! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3159 Accepted Submission(s): 2106 Problem Description You're in space.You want to get home.There are asteroids.You don't want to hit…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5163 题目意思:有 n 个车站,给出相邻两个车站的距离,即车站 i 和车站 i+1 的距离为 di (1≤ i <n).然后是 m 个人从他的出发点到他想去的终点(都是车站),约定轮到处理第 i 个人的时候,车站的出发点满足:((i-1) mod n) + 1 ,假设车每走一个单位的距离花费一个单位的时间,车开始的时候是从左到右开的.如果车走到最右的车站即车站 n 会调头,此时方向为从右到左开:如果…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5154 题目意思:有 n 门 processes(编号依次为1,2,...,n),然后给出 m 种关系: a,b.表示 process b 要在 process a 之前完成.问经过 m 种关系之后,有没有可能完成所有的 process. 可以利用拓扑排序的思想做.遍历所有 process,处理所有入度为 0 的点,然后把与该点关联的点,即度数都减一.这样处理完之后,每个点的度数应该都是-1,否则就代…
Asteroids! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2599 Accepted Submission(s): 1745 Problem Description You're in space. You want to get home. There are asteroids. You don't want to…
题目链接 Problem Description You're in space.You want to get home.There are asteroids.You don't want to hit them. Input Input to this problem will consist of a (non-empty) series of up to 100 data sets. Each data set will be formatted according to the…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1963 题目意思:有 本金 money,还有一些股票的种类,第 i 种股票买入需要 value[i] 这么多钱,相应会有一定的利息interest[i],问经过若干年 year 后,每年都以最优的方案投资,总的资金有多少? 完全背包题,不过要看清楚 这句话:The value of a bond is always a multiple of $1 000,否则TLE了 #include <iostr…
Asteroids! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6174 Accepted Submission(s): 3876 Problem Description You're in space.You want to get home.There are asteroids.You don't want to hit…
普通的三维广搜,须要注意的是输入:列,行,层 #include<iostream> #include<cstdio> #include<cstring> #include<queue> #include<algorithm> #define M 11 using namespace std; int dir[6][3]={{0,1,0},{0,-1,0},{1,0,0},{-1,0,0},{0,0,1},{0,0,-1}};//6个方向 int…
233 Matrix Time Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Description In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And here is the quest…
Number Sequence Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Problem Description There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules: ● a i ∈ [0,n] ● a i ≠ a j ( i…
Dice Time Limit:1000MS Memory Limit:65536KB Description There are 2 special dices on the table. On each face of the dice, a distinct number was written. Consider a 1.a 2,a 3,a 4,a 5,a 6 to be numbers written on top face, bottom face, left face, r…
Game Time Limit:1000MS Memory Limit:65536KB Description Here is a game for two players. The rule of the game is described below: ● In the beginning of the game, there are a lot of piles of beads. ● Players take turns to play. Each turn, player ch…
Post Robot Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K Problem Description DT is a big fan of digital products. He writes posts about technological products almost everyday in his blog. But there is such few comments of his…
HDU 4303 Hourai Jeweled 解题报告 评测地址: http://acm.hdu.edu.cn/showproblem.php?pid=4303 评测地址: https://xoj.red/contests/view/1155/1 题目描述 Kaguya Houraisan was once a princess of the Lunarians, a race of people living on the Moon. She was exiled to Earth over…