摘要: class Solution {public: bool isPalindrome(int x) { long long int ans=0; int y=x; while(y) { ans=ans*10+y%10;... 阅读全文
posted @ 2015-06-05 22:26 varcom 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 1 int max_value=2147483647; 2 int min_value=-2147483648; 3 class Solution { 4 public: 5 int myAtoi(string str) { 6 long long int ans=0; 7... 阅读全文
posted @ 2015-06-05 21:44 varcom 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1 typedef long long lld; 2 lld mn=-((lld)1mx||ansmx||ans<mn)14 ans=0;15 return (int)ans;16 }17 };View Code 阅读全文
posted @ 2015-06-05 15:41 varcom 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 string convert(string s, int numRows) { 4 if(numRows==1) 5 return s; 6 int i,j,gap=num... 阅读全文
posted @ 2015-06-03 22:18 varcom 阅读(166) 评论(0) 推荐(0) 编辑
摘要: http://emuch.net/html/201209/4842092.html作者:just1do1it(站内联系TA) 发布: 2012-08-15李航:http://research.microsoft.com/en-us/people/hangli/,是MSRA Web Search an... 阅读全文
posted @ 2015-04-07 14:49 varcom 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 机器学习经典书籍小结博客第一篇文章[1]是转载的,也算是开始写博客不经意的表露了自己对机器学习的兴趣吧!那篇文章总结了机器学习的一些经典算法的论文与数学基础理论的一些书籍,对于开始学习机器学习的话恐怕太过深入,正好最近在买书,看了很多经典书籍的总结与评论,我再拾人牙慧,稍稍总结一下吧。先说一下我看过... 阅读全文
posted @ 2015-03-23 21:42 varcom 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1、110601/10183 How Many Fibs? (斐波那契计数)使用字符数组表示数列,double可以表示300位整数,但会出现精度问题。#include#include#include#include#includeusing namespace std;struct NODE{ ... 阅读全文
posted @ 2014-12-05 21:20 varcom 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 1、110501/10035 Primary Arithmetic (小学生算术)注意输出格式#include#include#include#include#includeusing namespace std;typedef long long lld;lld a,b;int main(){ ... 阅读全文
posted @ 2014-11-29 15:12 varcom 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 1、110401/10041 Vito’s Family (Vito 家族)距离最小的点必定是中位数,必定出现在输入的点之间#include#include#include#include#includeusing namespace std;int s[505];int dis[30005];co... 阅读全文
posted @ 2014-11-23 14:32 varcom 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 1、110301/10082 WERTYU (WERTYU 键盘)#include#include#include#include#includeusing namespace std;char key[4][20]={"`1234567890-=","QWERTYUIOP[]\\","ASDFGH... 阅读全文
posted @ 2014-11-18 15:49 varcom 阅读(212) 评论(0) 推荐(0) 编辑