(最近水题刷的比较多,不过还是有些收获,所以还是做个记录比较好)
http://acm.hdu.edu.cn/showproblem.php?pid=1282
分析:
题目理解起来还是简单的,基本上有两种思路:1) 将int转为string来实现; 2)直接用int做(回文串判断,相加)
第二中思路比较直接,将一个数倒置得到新的数,然后判断是否是回文数...
分类:
其他好文 时间:
2014-05-05 13:26:07
阅读次数:
276
By Long Luo
最近遇到一个算法题:
仿照Excel的列编号,给出一个数字,输出该列编号字符串。
例如:A对应1,Z对应26,AA对应27,AZ对应52 ......
这个题目是一个典型的26进制思路去处理,但是这个题目里面有很多陷阱,在1, 26, 52等特殊情况进行考虑,经过晚上接近1个小时的编写,完成的代码如下:
C++代码如下:
#inclu...
分类:
其他好文 时间:
2014-05-03 17:09:18
阅读次数:
344
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
typedef不常见但值得一提的用途:
1. 用typedef来定义与平台无关的类型。
比如定义一个叫 REAL 的浮点类型,在目标平台一上,让它表示最高精度的类型为:
typedef long double REAL;
在不支持 long double 的平台二上,改为:
typedef double REAL;
在连 double 都不支持的平台三上,改为:
typedef ...
分类:
其他好文 时间:
2014-05-03 16:12:35
阅读次数:
289
Chef wrote some text on a piece of paper and now he wants to know how many holes are in the text. What is a hole? If you think of the paper as the plane and a letter as a curve on the plane, then each...
分类:
其他好文 时间:
2014-05-03 15:49:18
阅读次数:
412
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
看到这个名称我惊呆了...
SQL不是希望快速查询取得结果吗,怎么什么时候会有这个概念。
问了一个哥们,哥们认为是漫查询:同时多查询。
于是Google得出了如下结果:
慢查询其实对应的是MySQL慢查询日志系统,用来记录执行比较慢的SQL。
怎么去判断执行慢呢,MySQL中你show variables like '%quer%';时,你可以看到long_query_time 属性,对应的就是设置的比较时间。
当看到long_query_time 属性时,你同时可以看到log_slow_queries状态...
分类:
数据库 时间:
2014-05-03 15:23:59
阅读次数:
500