You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb...
分类:
其他好文 时间:
2015-01-08 13:14:25
阅读次数:
119
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes...
分类:
其他好文 时间:
2015-01-08 12:51:24
阅读次数:
114
题目:
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie,...
分类:
编程语言 时间:
2015-01-08 11:21:57
阅读次数:
239
当是钝角三角形时,就是最长边为直径的圆最小.
否则,求三角形的外接圆
Naive and Silly Muggles
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 700 Accepted Submission(s...
分类:
其他好文 时间:
2015-01-08 11:21:38
阅读次数:
102
Computing minimum volume bounding box is a hard problem in computer science. Exact algorithm costs O(n3) time complexity.However, for lots of applicat...
分类:
其他好文 时间:
2015-01-08 10:58:58
阅读次数:
239
方格取数(1)Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5961Accepted Submission(s): 2268Problem De...
分类:
其他好文 时间:
2015-01-08 00:56:37
阅读次数:
231
一个很newbee的例子,可惜还得改 1 import sys 2 import time 3 4 import socket 5 import struct 6 7 import random 8 9 def SendPacketData (Buffer = None , DestIP = ...
分类:
其他好文 时间:
2015-01-08 00:50:01
阅读次数:
339
Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
Credits:
Special thanks to @ts for adding this problem and creating all...
分类:
编程语言 时间:
2015-01-07 23:42:23
阅读次数:
401
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time
complexity should be O(log (m+n)).
分析
这是一道非常经典的题。这题更通用的形式是,给定两个已经排序...
分类:
其他好文 时间:
2015-01-07 23:39:15
阅读次数:
345
http://codeforces.com/problemset/problem/19/C
Once Bob saw a string. It contained so many different letters, that the letters were marked by numbers, but at the same time each letter ...
分类:
其他好文 时间:
2015-01-07 23:36:29
阅读次数:
221