A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta...
分类:
其他好文 时间:
2014-07-16 18:20:59
阅读次数:
155
import sys class Stats: def __init__(self, sequence): # sequence of numbers we will process # convert all items to floats for numeri...
分类:
编程语言 时间:
2014-07-16 18:06:48
阅读次数:
257
Problem: Implement a function to check if a singly linked list is a palindrome.思路:最简单的方法是 Reverse and compare.另外一种非常经典的办法是用 Recursive 的思路,把一个list看成这种形...
分类:
其他好文 时间:
2014-07-16 17:41:23
阅读次数:
188
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1-...
分类:
其他好文 时间:
2014-07-16 17:30:52
阅读次数:
230
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4 and k = 2, a solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[1,3],
[1,4],
]...
分类:
其他好文 时间:
2014-07-16 17:27:32
阅读次数:
139
B - Adding Reversed Numbers
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld
& %llu
Submit Status
Description
The Antique Comedians of Malidinesia prefer comedies to...
分类:
其他好文 时间:
2014-07-16 17:16:04
阅读次数:
207
第一次看到段更斐波那契数列的,整个人都不会好了。事后看了题解才明白了一些。首先利用二次剩余的知识,以及一些数列递推式子有下面的至于怎么解出x^2==5(mod 10^9+9),我就不知道了,但是要用的时候可以枚举一下,把这些参数求出来之后就题目就可以转化为维护等比数列。由于前面的常数可以最后乘,所以...
分类:
其他好文 时间:
2014-07-15 22:52:58
阅读次数:
567
PalindromeTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 51799 Accepted: 17834DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well ...
分类:
其他好文 时间:
2014-07-15 12:36:31
阅读次数:
200
G - Self Numbers(2.2.1)
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
In 1949 the Indian mathematician D.R. Kaprekar discovered...
分类:
其他好文 时间:
2014-07-14 16:18:29
阅读次数:
194
??
Palindrome
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 51790
Accepted: 17831
Description
A palindrome is a symmetrical string, that is, a string read...
分类:
其他好文 时间:
2014-07-14 16:13:57
阅读次数:
221