C++类型转换
const_cast,字面上理解就是去const属性。
static_cast,命名上理解是静态类型转换。如int转换成char。
dynamic_cast,命名上理解是动态类型转换。如子类和父类之间的多态类型转换。
reinterpret_cast,仅仅重新解释类型,但...
分类:
编程语言 时间:
2014-08-26 19:16:26
阅读次数:
245
HDU 4972 A simple dynamic programming problem
题意:篮球比赛有1、2、3分球 现给出两队的分差序列(5:3 分差2 3:5分差也是2) 问有多少种可能的比分
思路:
比较简单的想法题 可以类一张表“从分差x到分差y一共有几种情况” 很容易发现只有1->2和2->1的时候会多一种情况 其他均是一种 所以只需要统计这种特殊分差即可 注...
分类:
其他好文 时间:
2014-08-26 17:32:16
阅读次数:
276
Problem Description
Dragon is watching NBA. He loves James and Miami Heat.
Here's an introduction of basketball game:http://en.wikipedia.org/wiki/Basketball. However the game in Dragon's version...
分类:
其他好文 时间:
2014-08-26 15:38:56
阅读次数:
183
Dynamic programming, or the "put shit in a table" technique, is an optimization for certain types of recurrence problems (specifically, those with ove...
分类:
其他好文 时间:
2014-08-26 11:17:25
阅读次数:
208
压缩感知介绍压缩感知(Compressive Sensing,CS),有时也叫成Compressive Sampling。相对于传统的奈奎斯特采样定理——要求采样频率必须是信号最高频率的两倍或两倍以上(这就要求信号是带限信号,通常在采样前使用低通滤波器使信号带限),压缩感知则利用数据的冗余特性,只采集少量的样本还原原始数据。这所谓的冗余特性,借助MLSS2014马毅老师的课件上的例子来说明,因为自...
分类:
其他好文 时间:
2014-08-25 17:10:25
阅读次数:
334
The ProblemWrite a function that takes two parameters n and k and returns the value of Binomial Coefficient C(n, k).For example, your function should ...
分类:
其他好文 时间:
2014-08-23 12:41:20
阅读次数:
169
因为是每次投篮后记录两队得分的差值,所以两个队伍的总分是不断增加的,可以发现只有差值由1-->2或者2-->1的情况才可能产生产生两种总分和的结果如 0:2可以变成2:3和1:2 其他的情况都只能是一种郜大可的代码: 1 #include 2 #include 3 #include 4 #inclu...
分类:
其他好文 时间:
2014-08-22 22:19:29
阅读次数:
330
(我自己使用的"笨办法", 就是 class point + 手动去除 (set/get这类抽象层次很低的函数 + onWin常见消息) + when hit 这样, 通过debug output, dynamic 输出了 call sequence. 但归根到底, 找到准确无误的 call sta...
分类:
其他好文 时间:
2014-08-22 21:08:19
阅读次数:
374
HDU 4972 A simple dynamic programming problem(数学思维题)...
分类:
其他好文 时间:
2014-08-22 16:16:39
阅读次数:
226
关于强制类型转换的问题,很多书都讨论过,写的最详细的是C++ 之父的《C++的设计和演化》。最好的解决方法就是不要使用C风格的强制类型转换,而是使用标准C++的类型转换符:static_cast, dynamic_cast。标准C++中有四个类型转换符:static_cast、dynamic_cast、reinterpret_cast、和 const_cast。下面对它们一一进行介绍。
I.st...
分类:
编程语言 时间:
2014-08-22 12:56:38
阅读次数:
202