上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 46 下一页
摘要: struct mystat { int idx; int cnt[26]; mystat(int id = 0) {idx = id;}};bool cmp(const mystat &a, const mystat &b) { for (int i=0; i b.cnt[i... 阅读全文
posted @ 2014-07-27 12:42 卖程序的小歪 阅读(109) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: bool isMatch(const char *s, const char *p) { if (s == NULL || p == NULL) return false; int slen = 0; i... 阅读全文
posted @ 2014-07-26 23:43 卖程序的小歪 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 最近一台服务器上的MySQL崩了,innodb单单靠.frm和.ibd好像恢复不过来,只能重装。但是重装也没让人省心,最好把/var/lib/mysql和/etc/mysql都删了,如果提示mysql-server-core要autoremove 的就在执行一次apt-get autoremove才... 阅读全文
posted @ 2014-07-24 10:41 卖程序的小歪 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 小伙伴要在以前的服务器上装个代码版本控制的软件,要用到数据库,可是想来找去root密码还是忘了,其他已经安装的服务都是用的专用账户配置文件里要找不到root用户的密码。用以下方法将密码强制修改掉:1. 将mysql服务以安全模式方式运行,需要系统root权限sudo suservice mysql ... 阅读全文
posted @ 2014-07-23 14:30 卖程序的小歪 阅读(197) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: UndirectedGraphNode *cloneGraph(UndirectedGraphNode *node) { UndirectedGraphNode *clone = dfs(node); dfs_clea... 阅读全文
posted @ 2014-07-22 20:29 卖程序的小歪 阅读(177) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int maxProfit(vector &prices) { int len = prices.size(); if (len i2r(len, 0); vector i2l(len, 0); ... 阅读全文
posted @ 2014-07-22 16:09 卖程序的小歪 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2014-07-22 10:56 卖程序的小歪 阅读(137) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int firstMissingPositive(int A[], int n) { if (A == NULL || n bits(len, false); for (int i=0; i n) continue;... 阅读全文
posted @ 2014-07-21 21:09 卖程序的小歪 阅读(159) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: const static char* pattern[]; const static char* roman[]; unordered_map a2i;public: int romanToInt(string s) { ... 阅读全文
posted @ 2014-07-20 20:32 卖程序的小歪 阅读(118) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int trap(int A[], int n) { if (n peaks; vector peaks_tmp; int last_idx = 0; bool increasing = ... 阅读全文
posted @ 2014-07-20 17:27 卖程序的小歪 阅读(227) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 46 下一页