Palindrome Number
题目:
Determine whether an integer is a palindrome. Do this without extra space. 题意:
判断一个整数是否是回文的,要求不使用额外的空间 思路:
简单起见我用的python,先判断是否为0,或者负数,若不是则转化为字符串,然后利用切片截取两段,反转其中一个比较是...
分类:
其他好文 时间:
2015-05-28 09:37:01
阅读次数:
125
题目大意:Given a n × n matrix A and a positive integer k, find the sum S = A + A^2 + A^3 + … + A^k.解题思路:将矩阵分块就可以解决了,
其中的S表示的是前n项的和,An指的是A^n, E指单位阵,O指零矩阵#include
typedef long long ll;
const int N =...
分类:
其他好文 时间:
2015-05-28 09:29:50
阅读次数:
161
题目:Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A
2 -> B
3 -> C
...
26 -> Z
27 -> AA
28 -> AB
通过的程序如下:public class Solution {
public...
分类:
其他好文 时间:
2015-05-28 00:53:01
阅读次数:
148
1. 评论在数据库中的表示app/models.py: Comment 模型class Comment(db.Model): __tablename__ = 'comments' id = db.Column(db.Integer, primary_key=True) body =...
分类:
其他好文 时间:
2015-05-28 00:15:26
阅读次数:
305
Given a positive integer, return its corresponding column title as appear in an Excel sheet.
For example:
1 -> A
2 -> B
3 -> C
...
26 -> Z
27 -> AA
28 -> AB
Credits...
分类:
其他好文 时间:
2015-05-27 22:56:31
阅读次数:
162
String to Integer (atoi)
题目:
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourse...
分类:
其他好文 时间:
2015-05-27 15:50:24
阅读次数:
134
searchderror:indexindex_cmp_job:attribute‘gis_longitude‘cannotbeupdated(mustbeboolean,integer,timestamp,orMVA)
分类:
其他好文 时间:
2015-05-27 12:29:45
阅读次数:
105
examination questionsUsing O(1) time to check whether an integer n is a power of 2.ExampleFor n=4, return true;For n=5, return false;ChallengeO(1) tim...
分类:
其他好文 时间:
2015-05-27 12:04:04
阅读次数:
157
import java.util.Scanner;/** 编写方法,将八进制数转换为十进制数。Integer.valueOf("876",8).toString()* */public class OctalToDecimal { public static void main(String[].....
分类:
编程语言 时间:
2015-05-27 09:47:30
阅读次数:
131
1. 提交和显示博客文章app/models.py: 博客文章模型class Post(db.Model): __tablename__ = 'posts' id = db.Column(db.Integer, primary_key=True) body = db.Column(...
分类:
其他好文 时间:
2015-05-27 00:36:55
阅读次数:
612