# 月度存档: 3月 2011

## Phone List

Time Limit: 5 Seconds Memory Limit: 32768 KB

Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:
– Emergency 911
– Alice 97 625 999
– Bob 91 12 54 26

In this case, it’s not possible to call Bob, because the central would direct your call to the emergency line as soon as you had dialled the first three digits of Bob’s phone number. So this list would not be consistent.

Input

The first line of input gives a single integer, 1 <= t <= 40, the number of test cases. Each test case starts with n, the number of phone numbers, on a separate line, 1 <= n <= 10000.Then follows n lines with one unique phone number on each line. A phone number is a sequence of at most ten digits.

Output

For each test case, output “YES” if the list is consistent, or “NO” otherwise.

[……]

Continue

## Beautiful Number

Time Limit: 1 Seconds Memory Limit: 32768 KB

Mike is very lucky, as he has two beautiful numbers, 3 and 5. But he is so greedy that he wants infinite beautiful numbers. So he declares that any positive number which is dividable by 3 or 5 is beautiful number. Given you an integer N (1 <= N <= 100000), could you please tell mike the Nth beautiful number?

Input

The input consists of one or more test cases. For each test case, there is a single line containing an integer N.

Output

For each test case in the input, output the result on a line by itself.

[……]

Continue

## Semi-Prime

Time Limit: 1 Seconds Memory Limit: 32768 KB

Prime Number Definition

An integer greater than one is called a prime number if its only positive divisors (factors) are one and itself. For instance, 2, 11, 67, 89 are prime numbers but 8, 20, 27 are not.

Semi-Prime Number Definition

An integer greater than one is called a semi-prime number if it can be decompounded to TWO prime numbers. For example, 6 is a semi-prime number but 12 is not.

Your task is just to determinate whether a given number is a semi-prime number.

Input

There are several test cases in the input. Each case contains a single integer N (2 <= N <= 1,000,000)

Output

One line with a single integer for each case. If the number is a semi-prime number, then output “Yes”, otherwise “No”.

[……]

Continue

## Palindromes

Time Limit: 1 Seconds Memory Limit: 32768 KB

A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string “ABCDEDCBA” is a palindrome because it is the same when the string is read from left to right as when the string is read from right to left.

Now give you a string S, you should count how many palindromes in any consecutive substring of S.

Input

There are several test cases in the input. Each case contains a non-empty string which has no more than 5000 characters.Proceed to the end of file.

Output

A single line with the number of palindrome substrings for each case.

[……]

Continue

## 我的Debian GNU/Linux——内核编译篇

• 支持某些特殊的硬件,或者默认的内核配置和某些硬件冲突
• 使用某些不为所提供的内核支持的选项
• 通过删除无用的驱动程序来优化内核,以减少启动时间
• 创建整体的而不是模块化的内核
• 运行最新的内核或开发中的内核
• 深入了解linux 内核

[……]

Continue

## Debian安装配置nginx,php,mysql,wordpress教程

256M内存 OpenVZ VPS 无交互分区 硬盘空间 15G 月流量 150G

HelloHost的VPS可供选择的操作系统有CentOS、Debain、Ubuntu、Fedora、Gentoo.我的选择Debian,因为Debian很稳定,我也比较熟悉,我自己的笔记本上装的就是Debian,相对其他几个它非常的节约内存.

[……]

Continue

RoBa原创，转载请注明出处

Continue

## 《C程序设计语言》习题解

//练习1-13,编写一个程序,打印输入中单词长度的直方图.水平方向的直方图比较容易绘制,垂直方向的困难一些.(书中第17页)
//做这个练习之前最好能先弄懂直方图是什么
//首先,定义:
//n为某个长度单词出现的次数
//M为出现最频繁的长度的次数
//H为你所定义的直方图的最大长度
//那么所求的len = n * H / M[……]

Continue

## 《C程序设计语言》习题解

//练习1-1 在你自己的系统中运行"hello world"程序.
//再有一去掉程序中的部分内容,看看惠得到什么出错信息(书中第3页)
#include
int main()
{
printf("hello world!\n");
return 0;
}


[……]

Continue