数学题. 题意是问你能不能逃脱. 当V1的 角速度大于 V2的时候,能够一直保持 V1,O(圆心),V2 三点一线. 跑到一定距离.角速度小于的时候,就以三点一线为初始状态直接跑直线. #include<cstdio> #include<cstring> #include<string> #include<queue> #include<algorithm> #include<map> #include<stack> #i…
题目传送门 /* 题意:把N个数分成两组,一组加起来是A,一组加起来是B,1<=A,B<=9,也可以全分到同一组.其中加是按照他给的规则加,就是一位一位加,超过一位数了再拆分成一位一位加. DP:dp[i][j]记录前i个数累加和为j的方案数,那么状态转移方程:dp[i][j+a[i]] += dp[i-1][j]; 当然,dp[i][a[i]] = 1; 然后考虑几种特殊情况:都前往S1门或S2门,方案数+1.另外,比赛时我写出正确的转移方程,结果答案输出dp[n][s1]+dp[n][s2…
find a way to escape Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1738 Accepted Submission(s): 655 Problem Description 一日.话说0068与***泛舟湖上.忽见岸边出现他的一大敌人elnil.0068当然不想落入elnil的魔爪,于是他就得想办法逃脱. 这个湖是一个非…
题目传送门 题意:一个人从(0, 0)逃往(n, m),地图上有朝某个方向开炮的炮台,问最少逃脱步数 分析:主要在状态是否OK,当t时刻走到(x,y),炮台是否刚好打中,因为只能是整数,所以用整除判断.题意不清楚,有些坑点. #include <bits/stdc++.h> using namespace std; const int N = 1e2 + 5; struct Point { int dir, t, v; //N 1 E 2 S 3 W 4 }p[N][N]; struct No…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5389 大体题意是:有两个门A和B,还有一群人,每个人都有一个数字, 疯了一样的T..比赛的时候十连T也是醉醉的. 这道题感觉像DP,但是不知道从何下手,看别人敲出来才知道怎么去用. 在比赛过程中还有一个问题,想法对了,样例过了,但是T了 原因是因为数组开大了,在dp的过程中用了memset,导致T 在标程里,用了滚动数组,感觉很巧妙,因为dp只需要知道上一状态即可, 利用异或的性质,不断滚动0101…
bfs预处理一点到边界的最小距离,IDA*求出可行方案.注意按字典序初始化dir数组.并且存在中间点全为1,边界含0的可能性(wa了很多次).此时不输出任何命令. /* 1813 */ #include <iostream> #include <queue> #include <algorithm> #include <cstdio> #include <cstring> #include <cstdlib> using namesp…
bfs.题目做的不细心,好多小错误.尤其注意起始点就是边界的情况.wa了八次. #include <iostream> #include <cstdio> #include <cstring> #include <queue> using namespace std; #define MAXN 85 typedef struct node_st { int x, y; int d, s; node_st() {} node_st(int xx, int yy…
Problem Description Given a positive integer n and the odd integer o and the nonnegative integer p such that n = o2^p. Example For n = 24, o = 3 and p = 3. Task Write a program which for each data set: reads a positive integer n, computes the odd int…
哎 真的是懒得动脑子还是怎么滴... 题目如下 Problem Description 有如下方程:Ai = (Ai-1 + Ai+1)/2 - Ci (i = 1, 2, 3, .... n).若给出A0, An+1, 和 C1, C2, .....Cn.请编程计算A1 = ?   参考网上题解... 因为:Ai=(Ai-1+Ai+1)/2 - Ci,       A1=(A0  +A2  )/2 - C1;       A2=(A1  +  A3)/2 - C2 , ... =>    A1…
HDOJ 题目分类 /* * 一:简单题 */ 1000:    入门用:1001:    用高斯求和公式要防溢出1004:1012:1013:    对9取余好了1017:1021:1027:    用STL中的next_permutation()1029:1032:1037:1039:1040:1056:1064:1065:1076:    闰年 1084:1085:1089,1090,1091,1092,1093,1094, 1095, 1096:全是A+B1108:1157:1196:1…