ListList中的内容并不一定只有一种类型,一个List中可能既有number,又有string,还可能有子ListList用[]表示List的基本方法有:append,sort等要从一个List中删除某元素,可以使用del函数(它不是List的方法)#!/usr/bin/pythonmylist...
分类:
编程语言 时间:
2014-09-09 10:58:18
阅读次数:
290
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #i...
分类:
其他好文 时间:
2014-09-09 10:56:58
阅读次数:
340
Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes...
分类:
其他好文 时间:
2014-09-09 10:54:08
阅读次数:
190
思路: 注意符号,溢出。
思路: 注意负数和溢出情况都是 false. 其余情况,就是反转再判断,参考上题.
分类:
其他好文 时间:
2014-09-09 10:40:08
阅读次数:
179
题目链接:点击打开链接
题意:
给定一串数字
下面有n个操作
每行格式形如 d->t
d为一位数字,t为任意长度的数字。
t的长度和不超过100000
问:最后的结果%1e9+7
思路:
首先我们可以得到一个结论:
同余定理使用后不能再修改数字。
那么为了让同余定理能够使用,我们倒序处理每个数字,这样就能保证能够使用同余定理。
记录每个数字实际代表的数字和实际对...
分类:
其他好文 时间:
2014-09-08 10:52:16
阅读次数:
251
Web Pages - Efficient Paging Without The WebGrid If you want to display your data over a number of pages using WebMatrix Beta1, you have two options. ...
分类:
Web程序 时间:
2014-09-07 23:44:45
阅读次数:
397
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:
其他好文 时间:
2014-09-07 23:40:25
阅读次数:
202
Description
A number that will be the same when it is written forwards or backwards is known as a palindromic number. For example, 1234321 is a palindromic number.
We call a number generalized p...
分类:
其他好文 时间:
2014-09-07 22:31:15
阅读次数:
241
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font ...
分类:
其他好文 时间:
2014-09-07 21:07:35
阅读次数:
247