摘要: 1 class Solution { 2 public: 3 void solve(vector > &board) { 4 if (board.size() == 0) return; 5 int my = board.size() - 1; 6 int mx = board[0].size() -1; 7 // top border 8 for (int i=0; i >& board, int mx, int my, int _x, int _y, char oc, char nc) {40 ... 阅读全文
posted @ 2014-03-11 21:37 卖程序的小歪 阅读(197) 评论(0) 推荐(0) 编辑
摘要: int sqrt(int x) { int lo = 0; int hi = x; int m = 0; double mul = 0; for (;;) { m = (lo + hi) / 2; if (lo > hi) break; mul = 1.0 * m * m; if (mul > x) { hi = m - 1; } else if (mul == x) { ... 阅读全文
posted @ 2014-03-11 16:17 卖程序的小歪 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 1 double pow(double x, int n) { 2 if (n == 0) return 1; 3 unsigned int k = 0; 4 if (n >=1;14 }15 return ret;16 }MS 2012 math.h 1 template inline 2 _Ty _Pow_int(_Ty _X, int _Y) 3 {unsigned int _N; 4 if (_Y >= 0) 5 ... 阅读全文
posted @ 2014-03-11 14:39 卖程序的小歪 阅读(147) 评论(0) 推荐(0) 编辑