码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
POJ 2241 The Tower of Babylon
DP求解。对Blocks的先按照X降级,再按照Y降级排序,可以转化为最长公共子序列问题,即求子序列权值之和最大。 #include #include #include using namespace std; #define MAX_SIZE 300 struct Block{ int x; int y; int height; }; int nums...
分类:其他好文   时间:2014-06-03 04:39:44    阅读次数:223
STL的队列和栈简单使用
STL的队列和栈简单使用 #include #include #include #include #include #include using namespace std; int main() {  queue Q;  stack S;  int i;  for(i=1;i  {Q.push(i);S.push(i);}  while(...
分类:其他好文   时间:2014-06-03 03:51:26    阅读次数:238
C语言学习_test2
1.互满数 #include #include int fun(int n); int main(void) { int x, y; for(x = 1; x { for(y = 1; y { if(fun(x) == y && fun(y) == x) printf("%d %d\t", x, y); } } return 0; } ...
分类:编程语言   时间:2014-06-03 03:28:21    阅读次数:274
C语言学习_test1
1.从键盘上输入5个数,输出最大的、最小的元素以及他们的下标 #include int main(void) { int i, j, k, max, min; int a[10] = {0}; printf("input number:"); for(i = 0; i scanf("%d", &a[i]); max = min = a[0]; j = k = 0; ...
分类:编程语言   时间:2014-06-03 02:43:47    阅读次数:241
Exceptional C++: [Item 47. Control Flow] [条款47 控制流]
条款47控制流 难度:6 你到底有多了解C++代码的执行顺序呢?通过这个问题来测试一下你的知识。 “恶魔藏在细节里。”尽量指出下面(人为)代码的问题,请集中在控制流相关的问题上。 #include #include #include #include using namespace std; // The following lines come from other...
分类:编程语言   时间:2014-06-03 02:30:46    阅读次数:342
hdu-4605-Magic Ball Game-线段树+离线操作
以前用树状数组做过一次,现在用线段树再刷一次。。。 首先必须先离散化。。。 然后建立2颗线段树,第一颗表示往左走,每个节点的值的分布。       第二颗表示往右走,每个节点的值的分布。 然后根据左右走的关系,判断出x,y的值。 #pragma comment(linker, "/STACK:1024000000,1024000000") #include #include #inclu...
分类:其他好文   时间:2014-06-03 01:25:54    阅读次数:315
Trie 字典树 删除操作
字典树的删除操作: 1 没找到直接返回 2 找到叶子节点的时候,叶子节点的count标志清零,代表不是叶子节点了 3 如果当前节点没有其他孩子节点的时候,可以删除这个节点 判断是否需是叶子节点,就检查叶子节点的count标志就可以了。 判断是否有其他孩子节点就需要循环26个节点了,如果都为空,那么就没有其他孩子节点了。 #include #include #include ...
分类:其他好文   时间:2014-06-03 00:49:49    阅读次数:279
Iterative (non-recursive) Quick Sort
An iterative way of writing quick sort: #include #include #include using namespace std; void quickSort(int A[], int n) { stack> stk; stk.push(make_pair(0, n-1)); while (!stk.empty()) { pair ...
分类:其他好文   时间:2014-06-03 00:16:43    阅读次数:357
HDU 3436 Queue-jumpers
从一开始学离散化就对它没有半毛钱好感,感觉出这种题纯属恶心人。 可以将Top x全部取出来然后离散化,缩点。剩下的就是伸展了,不再赘述。 也有人拿线段树过,一直没有想明白. . . #include #include #include #include #include #include #include #include #include #pragma comment...
分类:其他好文   时间:2014-06-02 23:24:50    阅读次数:338
PIC18F4520 UART模板
如题 #define USE_AND_MASKS #include #include #include #include #pragma config OSC = INTIO67 //internal oscillator #pragma config WDT = OFF //watchdog timer off #pragma config LVP = OFF...
分类:其他好文   时间:2014-06-01 11:16:04    阅读次数:246
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!