
C
文章平均质量分 69
kzzhr
蒟蒻小小鸟
展开
-
C语言初探 之 %p
先看代码:int a=16,b=17,c=18; int *p,*q,*g; p=&a;q=&b;g=&c; printf("%p %p %p\n",a,b,c); printf("%p %p %p\n",&a,&b,&c); printf("%8x %8x %8x\n",&a,&b,&c); printf("%8x %8x %8x\n",p,q,g);%x原创 2013-01-04 13:37:02 · 4045 阅读 · 0 评论 -
C语言初探 之 printf压栈顺序
写在篇头:在不同的编译器下结果不同,本例测试的环境为 devcpp5.3.0.1 。 —————————————————————————————————————————————————————————————————————— 先看一段代码,猜猜会是什么输出:x=1; printf("%d %d\n",x,x++);x=1; printf("%d %d\n",x原创 2013-01-08 19:53:44 · 8228 阅读 · 7 评论 -
点集配对问题 集合DP 按位DP
以前就开始看刘汝佳的白皮书了,不过眼高手低,没有码过,发现问题好多。于是开始敲一敲。题意:空间有n个点,分成n/2对,使得所有点集的两点之间的距离之和最小。d(s) = min{ d(s-i-j) } i,j 属于 s只有20个点,每个点可以取可以不取,所以用20位的二进制数来表示每个状态。#include #include #includ原创 2013-09-22 12:53:49 · 3363 阅读 · 0 评论 -
USACO Section 1.4.3 The Clocks
很简单却容易被忽视的一个技巧The Clocks [ IOI'94 - Day 2 ]find a minimal sequence of moves to return all the dials to 12 o'clock. Nine different ways to turn the dials on the clocks are supplied via a table below; each way is called a move. Select for each move a numb原创 2013-11-28 16:37:01 · 1251 阅读 · 0 评论 -
USC 1329 Decode 坑坑坑gets
其实一贯都是用string来着。。其实后来看刘汝佳的书又喜欢上了fe原创 2014-10-08 10:09:31 · 1124 阅读 · 0 评论