题目:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Outpu...
分类:
其他好文 时间:
2014-08-10 13:08:30
阅读次数:
296
Given a collection of numbers, return all possible permutations.
For example,
[1,2,3] have the following permutations:
[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],
and [3,2,1].
原题链接:https://oj...
分类:
其他好文 时间:
2014-08-10 10:25:50
阅读次数:
265
筛法是一种很快的方法,贴代码纪念一下。 做法很像筛法 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #...
分类:
其他好文 时间:
2014-08-10 10:19:50
阅读次数:
223
想到 最小公倍数 其余的就好搞了 ,可是没想到#include #include #include #include #include #include #include #include #include #include #include #include #includeusing names...
分类:
数据库 时间:
2014-08-09 23:11:49
阅读次数:
313
三进制搞下, 0 表示没出现过, 第i位为1 表示 i出现了奇数次, 2表示i 出现了偶数次。#include #include #include #include #include #include #include #include #include #include #include #inc...
分类:
其他好文 时间:
2014-08-09 23:07:59
阅读次数:
325
Palindromes
A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when t...
分类:
其他好文 时间:
2014-08-09 21:36:09
阅读次数:
344
Problem Description
The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj. For a given sequence of numbers a1, a2, ..., an, if we move t...
分类:
其他好文 时间:
2014-08-09 18:48:38
阅读次数:
241
Sumdiv
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 13959
Accepted: 3433
Description
Consider two natural numbers A and B. Let S be the sum of all natur...
分类:
其他好文 时间:
2014-08-09 11:43:07
阅读次数:
226
Description
Ouroboros is a mythical snake from ancient Egypt. It has its tail in its mouth and continously devours itself.
The Ouroboros numbers are binary numbers of 2^n bits that have the prop...
分类:
其他好文 时间:
2014-08-09 11:40:57
阅读次数:
315
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeate...
分类:
其他好文 时间:
2014-08-08 20:54:46
阅读次数:
246