1. Type conversion:If we assign an out-of-range value to an object of unsigned type, the result is the remainder of the value modulo the number of val...
分类:
编程语言 时间:
2014-10-03 18:53:04
阅读次数:
198
简单贪心# include# include# includeusing namespace std;const int maxn=10000000+10;int n,k,t;unsigned long long tot;int num[maxn];int main(){ freopen("f...
分类:
其他好文 时间:
2014-10-03 11:33:44
阅读次数:
171
描述1101001000100001000001.......求第Ai位的数是什么Ai 2 # include 3 # include 4 # include 5 using namespace std; 6 typedef unsigned long long LL; 7 const int ma...
分类:
其他好文 时间:
2014-10-03 11:16:34
阅读次数:
243
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1319
题目大意:就是求最长递增子序列,并输出位置。。。。
思路:先把s进行升序排列,然后把b按降序排列,最后把找出b的最长递增子序列。。。。
先给两个最长递增子序列的模板:
时间复杂度:O(log(n*n))
unsigned int LISS(const...
分类:
其他好文 时间:
2014-10-01 23:13:41
阅读次数:
282
近日学习ATL,通过对宏定义offsetofclass的解惑过程,顺便分析下虚函数表,以及通过虚函数表调用函数的问题。
1 解开ATL中宏定义offsetofclass的疑惑
#define _ATL_PACKING 8
#define offsetofclass(base, derived) ((unsigned long)(static_cast ((derived...
分类:
其他好文 时间:
2014-10-01 20:06:21
阅读次数:
189
后面两种写法很巧妙。一种利用位域,一种利用取余。这里如果不用unsigned char来做位域的话,大小就为4. unsigned char才符合题目要求。 1 void chess1() { 2 struct { 3 unsigned char a:4; 4 ...
分类:
其他好文 时间:
2014-10-01 18:46:11
阅读次数:
168
壮烈的一天。。。第一题本意是水题,然后写了块状数组模拟,最后发现算法错了。。。然后其实快排一遍扫一遍完事。。。 100分#include #include #define min(a,b) ((a)int a[40],n,p,c,i;unsigned int k;void search(int f,...
分类:
其他好文 时间:
2014-10-01 18:20:41
阅读次数:
123
功 能: 将s所指向的某一块内存中的每个字节的内容全部设置为ch指定的ASCII值, 块的大小由第三个参数指定,这个函数通常为新申请的内存做初始化工作 用 法: void *memset(void *s, char ch, unsigned n);如果以这样的方式声明数组int a[256]={.....
分类:
其他好文 时间:
2014-10-01 17:38:41
阅读次数:
259
首先建立分类信息表:1 CREATE TABLE IF NOT EXISTS `category` (2 `categoryId` smallint(5) unsigned NOT NULL AUTO_INCREMENT,3 `parentId` smallint(5) unsigned N...
分类:
Web程序 时间:
2014-10-01 11:21:30
阅读次数:
280
char 与 unsigned char的本质区别
http://bbs.csdn.net/topics/270080484
同一个内存内容:10010000
你用char* 解释是-112
你用unsigned char* 解释是144
还是同样这个内存内容赋给整型值,用unsigned char 类型还是会得到144,用c...
分类:
其他好文 时间:
2014-10-01 05:42:40
阅读次数:
255