杰拉斯的博客

[ACM_ZJUT_1382]计算N!(数组模拟超大数运算)

杰拉斯 杰拉斯 | 时间:2012-04-11, Wed | 11,453 views
编程算法 

计算N!

Time Limit:1000MS Memory Limit:32768K

Description

yaojian最近学了一个新的运算法则——阶乘,但他很懒,不想一步一步计算,所以他想让你来帮他编一个程序,能马上得到N的阶乘。

Input

输入包含若干行数据,每行都有一个整数N(0<=N<=200)。

Output

与输入相对应每行输出N的阶乘。

(阅读全文…)

[ACM_ZJUT_1058]Humble Numbers

杰拉斯 杰拉斯 | 时间:2012-04-10, Tue | 5,974 views
编程算法 

Humble Numbers

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 8472 Accepted Submission(s): 3684

Description

A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers.

Write a program to find and print the nth element in this sequence

Input

The input consists of one or more test cases. Each test case consists of one integer n with 1 <= n <= 5842. Input is terminated by a value of zero (0) for n.

Output

For each test case, print one line saying "The nth humble number is number.". Depending on the value of n, the correct suffix "st", "nd", "rd", or "th" for the ordinal number nth has to be used like it is shown in the sample output.

(阅读全文…)

[ACM_ZJUT_1021]ACMICPC(暴力破解VS动态规划)

杰拉斯 杰拉斯 | 时间:2012-04-09, Mon | 17,616 views
编程算法 

ACMICPC

Time Limit:1000MS Memory Limit:32768K
Description:

Description

大写字母A-Z分别对应整数[-13,12],因此,一个字符串对应了一个整数列。我们把字符串对应的整数列的和称为该字符串的特性值。例如:字符串ACM对应的整数列为{-13,-11,-1},则ACM的特性值为(-13)+(-11)+(-1)=-25;其子串AC的特性值为-24;子串M的特性值为-1。 给你一个字符串,请找出该字符串的所有子串的最大特性值。

Input

第一行的正整数 N(1<=N<=1000)表示其后有N组测试数据,每组测试数据都由一个字符串组成。字符串只能由大写字母A-Z组成,且字符串的长度不会超过1000。

Output

输出有N行,每行是一组测试数据的输出结果。

(阅读全文…)

[第11届华南农业大学ACM程序设计竞赛 网络同步赛]题目及现场作答代码

杰拉斯 杰拉斯 | 时间:2012-04-07, Sat | 5,888 views
编程算法 

A. Local Minimum

Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)
Total Submission(s) : 220 Accepted Submission(s) : 100

Description

There is an array contains n integers, no any 2 integers are same. Local minimum means an integer is less than its previous one and next one (ie. M[i-1] >M[i] < M[i + 1], 1 < i < n). The array is special, it is guarantee M[1] > M[2] and M[n - 1] < M[n]. Now, give you the array, please find out is there a local minimum exist in the array.

Input

The 1st line of input contains only 1 integer T (T <= 10), indicate the number of test cases.
The 1st line of each test case contains only 1 integer n (3 <= n <= 100), indicate the size of the array.
The 2nd line of each test case contains n integers, indicate the element of the array, the maximum of the integers will not exceed 100.

Output

For each test, if there is local minimum exist, please print "Yes", and otherwise print "No".

(阅读全文…)

WordPress速度优化之缓存Gravatar头像(SAE版1.2)

杰拉斯 杰拉斯 | 时间:2012-04-07, Sat | 50,830 views
后台技术 

什么是Gravatar?

Gravatar Logo

Gravatar是Globally Recognized Avatar的缩写,是gravatar推出的一项服务,意为“全球通用头像”。如果在Gravatar的服务器上放置了你自己的头像,那么在任何支持Gravatar的blog或者留言本上留言时,只要提供你与这个头像关联的email地址,就能够显示出你的Gravatar头像来。

(阅读全文…)