Rightmost Digit
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 37888 Accepted Submission(s): 14268
Problem Description
Given a posi...
分类:
Web程序 时间:
2015-04-16 17:45:20
阅读次数:
148
题目链接https://leetcode.com/problems/plus-one/这是digit这类题里最简单的一道了,这类题基本都不难,但是需要把几个boundary case考虑到,这道题里需要考虑的是进位之后首位的情况。其他case以后遇到再提。class Solution {public...
分类:
其他好文 时间:
2015-04-16 06:42:24
阅读次数:
131
Add Two Numbers
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 ...
分类:
其他好文 时间:
2015-04-15 13:39:11
阅读次数:
164
1. Margin collapsing ONLY happens with top and bottom margins, not left and right, and not at all on inline elements.2. vertical-align can use digit a...
分类:
其他好文 时间:
2015-04-15 10:57:53
阅读次数:
112
#include#include#include#includeusing namespace std;int m,n;int SG[1000001];int sg(int x){ if(SG[x]!=-1) return SG[x]; if(!x) return SG[x]=0; setS; in...
分类:
其他好文 时间:
2015-04-14 22:51:37
阅读次数:
141
本来以为会超时,看来是想多了,63ms,看来对时间复杂度的判断能力还是不行啊。这个题正是next_permutation()函数的用武之地。
#include
#include
#include
#include
#include
#include
using namespace std;
int n,sum,a[100],A[100];
int main() {
scanf("%d%d...
分类:
其他好文 时间:
2015-04-14 16:37:55
阅读次数:
112
Title:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the te...
分类:
其他好文 时间:
2015-04-13 09:24:58
阅读次数:
142
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at...
分类:
其他好文 时间:
2015-04-13 08:15:12
阅读次数:
116
根据官网给出的number格式定义很容易匹配:DIGIT [0-9]
DIGITS {DIGIT}+
INT "-"?([0-9]|[1-9][0-9]*)
FRAC "."{DIGITS}
E [eE][-+]?
EXP {E}{DIGITS}
NUMBER {INT}({FRAC}|{EXP}|{FRAC}{EXP})?string的匹配就复杂点, 开始...
分类:
Web程序 时间:
2015-04-12 17:50:33
阅读次数:
118
Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number con...
分类:
其他好文 时间:
2015-04-12 16:16:59
阅读次数:
128