2013-04-28 Robert Zhang
more ```cpp include include using namespace std; void hartal(vector & days, int h) { int n = days.size(); int t = h - 1; while (t < n) { int r = t % 7; if (r != 5 && r != 6) days[t] = true; t += h; } } 继续阅读 »
2013-04-27 Robert Zhang
分析:此题根据如何来表示一条指令,有两种解法:一种是用一个整数(3位数)来表示,另一种用一个对象(含有3个成员,分别表示指令的3个位)来表示。前者的好处是存贮方便,但需要运行时“译码”;后者的好处是不需要运行时“译码”,但有额外的开销在对象的创建和复制上。根据网站的判题结果,二者的时间效率大体相当。more 继续阅读 »
2013-04-21 Robert Zhang
more ```cpp include include include using namespace std; class Card { public: char v; char t; Card(char av, char at) : v(av), t(at) {} Card() : v(0), t(0) {} }; 继续阅读 »
2013-04-20 Robert Zhang
more ```cpp include include using namespace std; typedef long long ll_t; bool load_input(vector & s) { s.clear(); int n; if (!(cin >> n)) return false; for (int i = 0; i < n; i++) { ll_t k; if (!(cin >> k)) return false; s.push_back(k); } return true; } 继续阅读 »
2013-04-14 Robert Zhang
分析:不需要一般象棋程序的“着法生成器”也可以求解more ```cpp include include using namespace std; typedef char Board[8][8]; typedef struct _Position { int row; int col; } Position; 继续阅读 »
2013-04-07 Robert Zhang
more ```cpp include include include ifdef DEBUG include "../comm_headers/debug_helper.h" else define DEBUG_OUT(...) endif 继续阅读 »
2013-04-06 Robert Zhang
分析:运算时产生的大数可能会使32位整数溢出,需要使用64位的整数类型more ```cpp include include ifdef DEBUG include "../comm_headers/debug_helper.h" else define DEBUG_OUT(...) endif 继续阅读 »
2013-04-06 Robert Zhang
more ```cpp include include ifdef DEBUG include "../comm_headers/debug_helper.h" else define DEBUG_OUT(...) endif 继续阅读 »
2013-03-25 Robert Zhang
PaaS即Platform as a Service,是云计算的一种形态。云计算本质上是一种网络服务,这种服务可归为三类:IaaS、PaaS和SaaS,其中的“aaS”都是“as a Service”,I、P、S分别是Infrastructure、Platform和Software。 继续阅读 »
2011-06-01 Robert Zhang
What's OOP on earth? How to do it in Lua? And what's Lua Class Lib? Let's have an interesting tour to OOP in Lua. 继续阅读 »