原题:https://www.facebook.com/hackercup/problems.php?pid=688426044611322&round=344496159068801题意:你和一个朋友玩足球游戏,分数从0-0开始,最终你总是赢,并且你主要有两种方式赢,第一种stressFree方式你肯定要进第一个球并且总是比你的朋友分数高,第二种stressFull方式除了你的朋友达到最终分数时,...
https://leetcode.com/problems/count-and-say/The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1i...
分类:
其他好文 时间:
2015-03-14 21:32:06
阅读次数:
140
题目地址:https://leetcode.com/problems/longest-valid-parentheses/Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.
For “(...
分类:
其他好文 时间:
2015-03-14 16:55:18
阅读次数:
188
https://leetcode.com/problems/divide-two-integers/Divide two integers without using multiplication, division and mod operator.If it is overflow, retur...
分类:
其他好文 时间:
2015-03-14 15:13:58
阅读次数:
117
Problem Description
Cowl is good at solving math problems. One day a friend asked him such a question: You are given a cube whose edge length is N, it is cut by the planes that was paralleled to its ...
分类:
其他好文 时间:
2015-03-14 11:02:15
阅读次数:
171
https://leetcode.com/problems/search-for-a-range/Given a sorted array of integers, find the starting and ending position of a given target value.Your ...
分类:
其他好文 时间:
2015-03-13 12:26:33
阅读次数:
153
https://leetcode.com/problems/pascals-triangle-ii/Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].No...
分类:
其他好文 时间:
2015-03-12 22:26:33
阅读次数:
138
https://leetcode.com/problems/pascals-triangle/GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1...
分类:
其他好文 时间:
2015-03-12 16:58:45
阅读次数:
115
Problem Description
Cowl is good at solving math problems. One day a friend asked him such a question: You are given a cube whose edge length is N, it is cut by the planes that was paralleled to its side planes into N * N * N unit cubes. Two unit cubes may...
分类:
其他好文 时间:
2015-03-12 15:08:38
阅读次数:
216
http://www.spoj.com/problems/VLATTICE/明显,当gcd(x,y,z)=k,k!=1时,(x,y,z)被(x/k,y/k,z/k)遮挡,所以这道题要求的是gcd(x,y,z)==1的个数+{(x,y,0)|gcd(x,y)==1}的个数+3{(0,0,1),(0,1...
分类:
其他好文 时间:
2015-03-12 00:46:51
阅读次数:
123