云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 中南大学第三届ACM校赛题目

中南大学第三届ACM校赛题目

  • 62 次阅读
  • 3 次下载
  • 2026/4/29 14:45:29

The 3rd Collegiate Programming Contest of Central South University

Problem A. Palindrome

Description

A palindrome is a symmetrical string, that is, a string read the same from left to right as from right to left. You are asked to write a program which, given a string, determines whether it is a palindrome or not.

Input

The first line contain a single integer T, indicates the number of test cases.

T lines follow, each line contain a string which you should judge. The length of the string is at most 1000.

Output

Print one line for each string, if it is a palindrome, output “YES”, else “NO”.

Sample Input

2 aba ab

Sample Output

YES NO

1

The 3rd Collegiate Programming Contest of Central South University

Problem B. 素数槽

Description

处于相邻的两个素数p和p + n之间的n - 1个连续的合数所组成的序列我们将其称为长度为n的素数槽。例如,?24, 25, 26, 27, 28?是处于素数23和素数29之间的一个长度为6的素数槽。

你的任务就是写一个程序来计算包含整数k的素数槽的长度。如果k本身就是素数,那么认为包含k的素数槽的长度为0。

Input

第一行是一个数字n,表示需要测试的数据的个数。后面有n行,每行是一个正整数k, k大于1并且小于或等于的第十万个素数(也就是1299709)。

Output

对于输入部分输入的每一个k,都对应输出一个非负整数,表示包含k的素数槽的长度,每个非负整数占一行。

Sample Input

5 10 11 27 2

492170

Sample Output

4 0 6 0 114

2

The 3rd Collegiate Programming Contest of Central South University

Problem C. Parsing Real Numbers

Description

In scientific notation, real numbers are written like this:

a×10b

Here we call a the coefficient and b the exponent. But the representation of real

numbers in programming language has a little different; we use the character e or E to indicate the start of the exponent. For example, 2×103 in the programming language is written as 2e3. And the exponent part of the real number is not all necessary so that the numbers as \

Real numbers may have a decimal point in the coefficient (and must have numbers on at least one side of the decimal point, e.g. \numbers, but \

The exponent of the real number is an integer and starts with the character e or E. Before the character e or E, there must have a valid coefficient.

There may be a plus or minus sign in front of the coefficient or exponent, or both (without any blank characters after the sign). e.g. \\ 3\ are not.

Note that there is no bound on the range of the numbers in the input, but for the sake of simplicity, you may assume the input strings are not longer than 1000 characters. There are no blanks in the input data.

Input

The first line of the input contains a single integer T which is the number of test cases, followed by T lines each containing the input line for a test case.

Output

The output contains T lines, each having a string which is “YES” or “NO”.

Sample Input

4

1.5e+2 3.

3

The 3rd Collegiate Programming Contest of Central South University

2.e -.35

Sample Output

YES YES NO YES

4

搜索更多关于: 中南大学第三届ACM校赛题目 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

The 3rd Collegiate Programming Contest of Central South University Problem A. Palindrome Description A palindrome is a symmetrical string, that is, a string read the same from left to right as from right to left. You are asked to write a program which, given a string, determines whether it is a palindrome or not. Input The first line contain a single integer T

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com