http://poj.org/problem?id=1094
Description
An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to larges...
分类:
编程语言 时间:
2015-01-25 19:39:31
阅读次数:
185
【题目】
Divide two integers without using multiplication, division and mod operator.
If it is overflow, return MAX_INT.
【分析】
不能用乘除和取模,就只能用加减和位运算。
最简单的方法就是不断的减去被除数。这种方法的迭代次数是结果的大小,即比如结果为n,算法复杂度...
分类:
其他好文 时间:
2015-01-25 11:09:58
阅读次数:
106
Day1:输入输出语句:input、print控制语句:if、else、elif…循环语句:for(类似于C#里面的foreach),while…type(), isinstance()…data type:int, float, bool, str…`operator:**, //,…列表:一个打...
分类:
编程语言 时间:
2015-01-25 11:06:54
阅读次数:
219
问题:在网上看人写了这么一段代码: 1 class A 2 { 3 public: 4 A() 5 { 6 std::cout #include "A.h" 29 30 void* operator new[](size_t size) ...
分类:
编程语言 时间:
2015-01-25 08:42:29
阅读次数:
302
精髓:operator new()完成的操作一般只是分配内存;而构造函数的调用(如果需要)是在new运算符中完成的。operator new和new 运算符是不同的,operator new只分配内存,而只要new出现无论是不是operator new都会调用new运算符从而调用析构函数。例子是:#...
分类:
编程语言 时间:
2015-01-25 08:41:29
阅读次数:
302
c++工程编译报错:“CObject::operator =”: 无法访问 private 成员(在“CObject”类中声明)错误无法直接定位源码位置,网上搜索了,也和我的代码不一样。最后还是自己认真检查代码,发现了个问题头文件定义了一个CEvent x,源码文件中使用了 x = new CEve...
分类:
其他好文 时间:
2015-01-25 01:21:54
阅读次数:
389
c++Builder 6 下的std::map还能用,有代码提示。换到xe7,代码提示出来就一个tt.operator [](),代码没法往下写了。最后把Target Platforms切换到64 bit windows 竟然可以了!!!
分类:
编程语言 时间:
2015-01-22 21:34:47
阅读次数:
289
开发的服务器在更新资料片后,出现了大量服务器随机崩溃的情况,经过排查问题,终于找到,这里和大家分享一下。首先分析错误堆栈,发现随机崩溃,怀疑是内存被覆盖,只好回头研究资料片代码,发现一个sorter的实现如下:struct SORTER{ bool operator()(const OBJID& ....
分类:
编程语言 时间:
2015-01-22 14:53:46
阅读次数:
177
QueueNode.htemplate class LinkQueue;templateclass QueueNode{private: friend class LinkQueue; friend ostream& operator& q); //函数要访问QueueNode的私有...
分类:
其他好文 时间:
2015-01-22 14:52:42
阅读次数:
93
QueueNode.htemplate class LinkQueue;templateclass QueueNode{private: friend class LinkQueue; friend ostream& operator& q); //函数要访问QueueNode的私有...
分类:
其他好文 时间:
2015-01-22 13:13:27
阅读次数:
120