摘要: 很2的一个解法, 好多情况没考虑, 只考虑正数了class Solution {public: bool isPalindrome(int x) { if(x<0)return false; int numbers = x; int digit... 阅读全文
posted @ 2014-02-18 21:16 海滨银枪小霸王 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 初leetcode的two sum 题中排序坑死, 枉费好长时间no matching function for call to 'sort(std::vector::iteratorsort(,,.,,., cmp);当时确信代码正确, 类型更是比对好久, 总是提示这个错误.后来才发现, cmp函... 阅读全文
posted @ 2014-02-18 10:52 海滨银枪小霸王 阅读(1205) 评论(0) 推荐(0) 编辑
摘要: struct Node { int val; int index; Node(){} Node(int x,int y):val(x),index(y){} }; bool compare(const Node &aa, const... 阅读全文
posted @ 2014-02-18 10:47 海滨银枪小霸王 阅读(116) 评论(0) 推荐(0) 编辑