![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
刷题
totomike
这个作者很懒,什么都没留下…
展开
-
x的平方根 通过 实现 int sqrt(int x) 函数,计算并返回 x 的平方根。for循环解。
原题地址:http://www.lintcode.com/zh-cn/problem/sqrtx/ 这题的技巧是使用二分查找,具体请参阅此博客:http://www.cnblogs.com/AnnieKim/archive/2013/04/18/3028607.html#2797064 本文主要是使用for循环来解这个问题。 思路很简单,就是使用for循环,不断的平方,得到一个等于x的数或者最原创 2015-08-02 00:04:26 · 942 阅读 · 0 评论 -
【leetcode】unique paths (【lintcode】不同的路径)C语言解
在leetcode中运行成功,但在lintcode中失败了。if(m==0||n==0){ return 0; } int sum[m][n]; for(int i=0;i<m;i++){ sum[i][0]=1; } for(int i=0;i<n;i++){ sum[0][j]=1; } for(int i=1;i<m;i++){ for(int j=1;j<n;j++){原创 2015-08-16 18:19:59 · 361 阅读 · 0 评论 -
【leetcode】Excel Sheet Column Number C语言
问题描述: Given a column title as appear in an Excel sheet, return its corresponding column number.For example:A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 这个问题实际上是把十进制转化为26进制。 代码:class Solution {原创 2015-08-16 18:50:51 · 193 阅读 · 0 评论