1.一般用C语言节约空间,要用C++库函数或STL时才用C++; cout、cin和printf、scanf最好不要混用。 大数据输入输出时最好不要用cin、cout,防止超时。 (或加上 2.有时候int型不够用,可以用long long或__int64型(两个下划线__)。 值类型表示值介于 - ...
分类:
其他好文 时间:
2017-04-16 22:25:12
阅读次数:
245
CString中Format函数与格式输入与输出 Format是一个非经常常使用。却又似乎非常烦的方法,下面是它的完整概貌。以供大家查询之用: 格式化字符串forma("%d",12)意思是将一个整形的格式化的字符(我觉得是保持其形状不变) 1).格式说明总是以%字符開始,下面是不同类型数据的格式方 ...
分类:
其他好文 时间:
2017-04-16 15:12:01
阅读次数:
151
#include #include #include using namespace std; const int N=405; struct rec { int v,w; }; vector edge[N*N]; int n,st,ed; __int64 dis[N*N]; bool vis[N*... ...
分类:
其他好文 时间:
2017-04-08 17:06:05
阅读次数:
131
1 program j01; 2 const times=50; 3 var n:int64; 4 fac:array[0..6000]of int64; 5 num:array[0..6000]of record w,m:int64;end; 6 ans:int64; 7 i,cnt,top:lo... ...
分类:
其他好文 时间:
2017-04-04 14:28:30
阅读次数:
219
F(n) = (n % 1) + (n % 2) + (n % 3) + ...... (n % n)。其中%表示Mod,也就是余数。 例如F(6) = 6 % 1 + 6 % 2 + 6 % 3 + 6 % 4 + 6 % 5 + 6 % 6 = 0 + 0 + 0 + 2 + 1 + 0 = 3 ...
分类:
其他好文 时间:
2017-03-28 23:34:03
阅读次数:
204
#elif define _WIN32 typedef __int64 int64; //Portable signed long integer 8 bytes typedef int int32; typedef signed short int int16; ty... ...
分类:
其他好文 时间:
2017-03-27 21:04:37
阅读次数:
124
http://acm.hdu.edu.cn/showproblem.php?pid=2057 涉及到16进制内的加法,可以用%I64x直接来处理,要注意到16进制中负数是用补码来表示的。一个比较困惑的事实是,这道题再输出时,%64X中‘X’必须是大写,小写是过不了的。 注意:__int64 %I64 ...
分类:
其他好文 时间:
2017-03-17 14:37:38
阅读次数:
115
仍然是32位。曾经是这样的:16位操作系统中,int 占16位;在32位操作系统中,int 占32位。但是现在人们已经习惯了 int 占32位,因此在64位操作系统中,int 仍为32位。64位整型用 long long 或者 __int64 仍然是32位。曾经是这样的:16位操作系统中,int 占 ...
分类:
其他好文 时间:
2017-03-15 13:34:39
阅读次数:
143
/* HDU4869 http://acm.hdu.edu.cn/showproblem.php?pid=4869 费马小定理+快速幂 求逆元 暴力组合数 奇偶性 */ #include #include using namespace std; const __int64 Nmax=100005L... ...
分类:
其他好文 时间:
2017-03-08 21:07:19
阅读次数:
132
首先来看一看int、long、long long的取值范围 int 所占字节数为4 表示范围为:-2147483648~2147483647 long 所占字节数为4 表示范围为:-2147483648~2147483647 long long 所占字节数为8 表示范围为:9223372036854 ...
分类:
其他好文 时间:
2017-02-28 22:46:37
阅读次数:
228