UVA 11525
(一种通过康托展开求排列的方法)
Problem
给定一个1-K的排列的康托展开形式,即S1*(K-1)! + S2*(K-2)! + S3*(K-3)!
+......+ SK(K-K)!;输出排列。
Limits
Time Limit(ms); 3000
Memory Limit(MB): No Limit
K: [1, 50000]
Si:...
分类:
其他好文 时间:
2015-01-15 16:09:18
阅读次数:
281
Atlantis
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7541 Accepted Submission(s): 3318
Problem Description
There are several anc...
分类:
其他好文 时间:
2015-01-15 16:06:43
阅读次数:
195
Sort a linked list in O(n log n)
time using constant space complexity.
MergeSort对于链表的排序,实现了就地排序的同时,时间复杂度和空间复杂度都达到了基于比较的排序的最优值,因此归并排序是链表排序的最佳排序方式。
/**
* Definition for singly-linked list.
* str...
分类:
其他好文 时间:
2015-01-15 16:01:52
阅读次数:
193
Factorial Trailing ZeroesGiven an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.思路:不...
分类:
其他好文 时间:
2015-01-15 15:57:13
阅读次数:
158
Selection in expected linear time
The general selection problem appears more difficult than the simple problem of finding a minimum. Yet, surprisingly, the asymptotic running tim...
分类:
其他好文 时间:
2015-01-15 14:21:23
阅读次数:
185
今天在两台MySQL服务器之间导数据,因为另一个MySQL服务器是测试用的,差一个月的数据,从现有MySQL服务器select到一个文件,具体语句是:select * from news where ine_time>="2010-02-01" and ine_time <"2010-03-01" ...
分类:
数据库 时间:
2015-01-15 12:40:13
阅读次数:
154
Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie...
分类:
其他好文 时间:
2015-01-15 12:38:33
阅读次数:
158
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a...
分类:
其他好文 时间:
2015-01-15 12:34:54
阅读次数:
111
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),...
分类:
其他好文 时间:
2015-01-15 09:30:17
阅读次数:
172