题目链接:http://poj.org/problem?id=1423思路:如果用普通方法做肯定会超时,数据也存不下,只能用数学方法来优化。这里用到了斯特林公式。秒出~~公式为 n! = log10(sqrt(2*pi*n)) + n * log10(n/e)这个公式只能求出n!的估算值,这里还需要...
分类:
其他好文 时间:
2014-08-21 14:45:24
阅读次数:
162
Minimum Cost
Time Limit: 4000MS
Memory Limit: 65536K
Total Submissions: 13531
Accepted: 4635
Description
Dearboy, a goods victualer, now comes to a big problem, and he...
分类:
其他好文 时间:
2014-08-20 21:09:52
阅读次数:
238
We will construct an infinitely long string from two short strings: A = "^__^" (four characters), and B = "T.T" (three characters). Repeat the followi...
分类:
其他好文 时间:
2014-08-20 15:43:02
阅读次数:
178
python的算法简要到你可以见性直指:def q_sort(l): if len(l)=p] return q_sort(small_part)+[p]+q_sort(big_part)太好理解了吧!这就是算法的精要?还有更简单的,def q_sort(l): if le...
分类:
编程语言 时间:
2014-08-19 10:54:34
阅读次数:
376
首先是支持gb2312,gbk,big三种编码。 以下是代码: $len = 19; $text = "怎么将新闻的很长的标题只显示前面一些字,后面用…..来代替?"; echo strlen($text)<=$len ? $text : (substr($text,0,$len).chr(0)."…...
分类:
Web程序 时间:
2014-08-18 18:58:23
阅读次数:
274
前言此文节选自TMF Big Data Analytics Guidebook。TMF文档版权信息Copyright © TeleManagement Forum 2013. All Rights Reserved.This document and translations of it may b...
分类:
其他好文 时间:
2014-08-18 12:58:02
阅读次数:
428
Description
Happy Birthday
Today it's February 13th. It's a very special day: Miguel's birthday! Like every year, he's organised a big celebration for all his friends. He pr...
分类:
移动开发 时间:
2014-08-16 19:51:52
阅读次数:
267
大数据分析指南TMF Frameworx最佳实践Unleashing Business Value in Big Data前言此文节选自TMF Big Data Analytics Guidebook。TMF文档版权信息Copyright © TeleManagement Forum 2013. A...
分类:
其他好文 时间:
2014-08-15 19:20:19
阅读次数:
498
常用的行内元素有:a、abbr、acronym、b、bdo、big、br、cite、code、dfn、em、font、i、img、input、kbd、label、q、s、samp、select、small、span、strike、strong、sub、sup、textarea、tt、u、var常用的...
分类:
其他好文 时间:
2014-08-15 19:13:49
阅读次数:
178
Description
In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, Wind choose two rooms x and y, an...
分类:
其他好文 时间:
2014-08-15 00:06:46
阅读次数:
331