要求:就是建一个带一个头结点的链表,然后将链表逆置即可。。。主要就是讲插入方式变一下即可。。
代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define eps 1e-9
#define ll long long
#define INF 0x3f3f3f3f
using...
分类:
其他好文 时间:
2014-09-30 02:39:41
阅读次数:
166
----- 有时候如果枚举起点超时,那么试试枚举终点。枚举每一个i为终点(0i内相同字母的个数不超过k 1 #include 2 #include 3 const int N = 100000 + 10; 4 typedef __int64 LL; 5 char str[N]; 6 LL c...
分类:
其他好文 时间:
2014-09-29 21:07:21
阅读次数:
179
插空法 大组合数取余
#include
#include
using namespace std;
typedef long long LL;
//求整数x和y,使得ax+by=d, 且|x|+|y|最小。其中d=gcd(a,b)
void gcd(LL a, LL b, LL& d, LL& x, LL& y)
{
if(!b)
{
d = a;
x = 1;
y = ...
分类:
其他好文 时间:
2014-09-29 19:37:31
阅读次数:
218
I‘ll list some of the ones I‘m reading, via RSS: Blog aggregators: http://java.dzone.com http://javacodegeeks.com http://www.programcreek.com/2012/11/top-100-java-developers-blogs/ Blogs: http://re...
分类:
编程语言 时间:
2014-09-29 18:20:31
阅读次数:
232
现象如下所示:[root@HNMH~]#ll?荤.?.92-rw-r--r--1rootroot14499?.2111:41anaconda-ks.cfgdrwxr-xr-x2rootroot409611?.1316:47Desktop-rw-r--r--1rootroot588379?.2111:41install.log-rw-r--r--1rootroot59129?.2111:41install.log.syslog本地支持字符集如下:[root@HNMH~]#lo..
分类:
系统相关 时间:
2014-09-29 12:40:20
阅读次数:
177
#include
#include
#include
#include
using namespace std;
typedef long long ll;
/*
* 完全大数模板
* 输出cin>>a
* 输出a.print();
* 注意这个输入不能自动去掉前导0的,可以先读入到char数组,去掉前导0,再用构造函数。
* by kuangbin GG.
*/
#defi...
分类:
编程语言 时间:
2014-09-28 23:31:29
阅读次数:
397
gg,y一下就是每一个点到根的距离用rank维护,,#include #include #include #include #include #include #include #include using namespace std;#define mod 1000000007#define ll...
分类:
其他好文 时间:
2014-09-28 22:42:25
阅读次数:
140
直接lucas降到10w以内搞组合数
#include
#include
typedef __int64 LL;
LL f[110010];
LL pow(LL a, LL b, LL c)
{
LL ans = 1;
while(b)
{
if(b&1)
ans = (ans*a) % c;
b >>= 1;
a = (a*a) % c;
}
return an...
分类:
其他好文 时间:
2014-09-28 21:49:55
阅读次数:
216
HDU5053the Sum of Cube(水题)
题目链接
题目大意:给你L到N的范围,要求你求这个范围内的所有整数的立方和。
解题思路:注意不要用int的数相乘赋值给longlong的数,会溢出。
代码:
#include
#include
const int N = 10005;
typedef long long ll;
ll t[N];
void ...
分类:
其他好文 时间:
2014-09-28 21:30:25
阅读次数:
164
http://acm.hdu.edu.cn/showproblem.php?pid=5053
ll就不超范围
写一道BFS题写的烦了 来水一道
//#pragma comment(linker, "/STACK:102400000,102400000")
#include
#include
#include
#include
#include
#include
#include ...
分类:
其他好文 时间:
2014-09-28 20:08:56
阅读次数:
200