(最近水题刷的比较多,不过还是有些收获,所以还是做个记录比较好)
http://acm.hdu.edu.cn/showproblem.php?pid=1282
分析:
题目理解起来还是简单的,基本上有两种思路:1) 将int转为string来实现; 2)直接用int做(回文串判断,相加)
第二中思路比较直接,将一个数倒置得到新的数,然后判断是否是回文数...
分类:
其他好文 时间:
2014-05-05 13:26:07
阅读次数:
276
hdu 1163 Eddy's digital Roots 九余数定理...
分类:
其他好文 时间:
2014-05-05 13:03:16
阅读次数:
232
Ignatius and the Princess IV
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32767K (Java/Other)
Total Submission(s) : 7 Accepted Submission(s) : 3
Font: Times New Roman | Verdana | ...
分类:
其他好文 时间:
2014-05-05 13:01:52
阅读次数:
325
代码:
#include
#include
#include
#include
using namespace std;
const int maxn=10003;
const int inf=0x7fffffff;
int num[maxn];
int n;
int main()
{
while(scanf("%d",&n)!=EOF&&n)...
分类:
其他好文 时间:
2014-05-04 12:39:16
阅读次数:
331
题意:有a个村庄、b个城镇, 编号分别为:1—a , a+1——a+b 。 有双神奇的鞋,可以瞬时移动,可以使用k次,每次可以移动L , 但穿这双鞋的时候,不能经过城镇 , 问:从a+b 到 1 最短距离是多少?
刚开始看这个题时 , 一点思路都没有 , dp类型的题目做得太少了。
解法:进行状态压缩, 用点+使用鞋子的次数 , 来表示一个状态 , d[i][k] , 表示到 ...
分类:
其他好文 时间:
2014-05-04 00:21:00
阅读次数:
383
Super Jumping! Jumping! Jumping!
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 6 Accepted Submission(s) : 5
Font: Times New Roman | Verdan...
分类:
其他好文 时间:
2014-05-03 16:47:07
阅读次数:
262
(为什么觉得越来越不行了,唉~果然脑子不够使啊~)
http://acm.hdu.edu.cn/showproblem.php?pid=1408
分析:
简单的模拟,不过学习了使用了ceil(double x) 函数 (math.h)
double ceil(double x) (天花板函数)
返回大于或者等...
分类:
其他好文 时间:
2014-05-03 16:20:05
阅读次数:
259
http://acm.hdu.edu.cn/showproblem.php?pid=1228
分析:
我只是想练习一下map的用法,不然又忘了。。。
代码:
//hdu 1228
#include
#include
#include
#include
#include
using namespace std;
map d;
void init()...
分类:
其他好文 时间:
2014-05-03 15:40:58
阅读次数:
232
hdu 1165 Eddy's research II (数学题,递推)...
分类:
其他好文 时间:
2014-05-03 15:34:41
阅读次数:
215
#include
#include
#include
#include
#include
using namespace std;
#define N 20020
struct node{
int from, to, dou, nex;
}edge[N];
int head[N], edgenum;
void add(int u, int v,int dou){
node E={u,v,dou...
分类:
其他好文 时间:
2014-05-03 15:25:32
阅读次数:
340