ACM习题
Description
在第二次世界大战中,一个飞行员由于飞机没油了被强迫降落,飞机降落的地点是固定在坐标系中的(0,0)点。
但是敌人在地面上修筑了一些多边形的包围区。如果飞行员降落在包围区外,他就是安全的。
当飞行员降落在包围区内,那么他必须要知道一种密码口令,才能通过包围区。飞行员不可能降落在多边形的边上。
这种密码是给出两个不同的质数p,q;密码就是不能用px+qy形式表示的正整数的个数,其中x,y大于等于0的整数。
比如p=3,q=5,则有四个正正整数1,2,4,7不能用其表示,因此密码口令为4。
Input
输入有多组测试数据,每组数据的第一行是一个数n
(3<=n<=16),表示包围区的顶点的个数。
当n=0时表示输入结束。接下来有n行,每行有两个实数
用来表示顶点的坐标,顶点时按照顺时针或逆时针来给出的
。再接下来的一行是p q。
Output
首先输出测试数据的编号,
第二行输出飞行员是否在包围区内,
如果在包围区内第三行输出密码口令。
Sample Input
4
-1.0 -1.0
2.0 -1.0
2.0 2.0
-1.0 2.0
3 5
5
-2.5 -2.5
10.5 -2.5
10.5 -1.5
-1.5 -1.5
-2.5 20.5
2 7
0
Sample Output
Pilot 1
The pilot is in danger!
The secret number is 4.
Pilot 2
The pilot is safe.
Description
A the softmind's mind,a valid date format should be formed by the forms below:
MM-DD-YYYY
DD-MMM-YYYY
MM/DD/YYYY
YYYY/MM/DD
YYYY/MMM/DD
that the "DD"、"MM" and "YYYY" is three integers ,indicate day、month and year of a date. The "MMM" indicate the month in another way , the string of "MMM" only can be one of {"Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"}.
Of course a day should be no more than 31 , a month should be no more than 12 ,a year should be greater than 1000 ,and another condition you should be consided.
One day ,softmind is very depressed, so he thought that the various of date format let he in confusion, so he need a uniform date format , so the problem comes ,please help him , to convert a valid date to the softmind's standard date format , if the data is not right ,please point out that .
Input
There are several test cases. In each tese case one line contains a string of date .
Output
If the date in the input is valid ,please convert it into standard one then output it ,if it's invalid ,output "Invalid " .
The standard format of the date is: MM-DD-YYYY .
Sample Input
04-16-2008
04-Mar-2008
Mar-06-2008
Sample Output
04-16-2008
03-04-2008
Invalid
Source
Author: softmind
Description
给你两个数a和b,你的任务是计算出1在a和b之间出现的次数,比如说,如果a=1024,b=1032,那么a和b之间的数就是:
1024 1025 1026 1027 1028 1029 1030 1031 1032
则有10个1出现在这些数中。
Input
输
简单模拟对简单模拟的一点理解: 简单模拟题是相对简单一些的题目,对于编程 初学者可以说是练习代码实现能力和代码打字能力 的题目,它基本上涉及不到什么太难的算法...
ACM_入门简单试题[1]_英语考试_外语学习_教育专区。在线评判系统中,一道题目的所有测试数据是放在一个文本文件里的,程序从该文件中读 取测试数据,再把运行结果输...
计算几何 纯数学问题 5 浙江省ACM竞赛的特点简单题:一般2-3道 算法题:一般4-5道 数据结构:一般1-2道 数学相关的题:2-3道 6 训练和练习的方法 分专题训练...
ACM简单题(二) 40页 1下载券 acm简单题 6页 1下载券 acm 简单题2 5页 1下载券 ACM简单题求解 52页 免费 ACM简单练习题 13页 免费 ACM C++简单题 29页...
ACM练习题 28页 1下载券 ACM练习题 50页 3下载券 ACM简单练习题 13页 免费 ACM练习题 16页 1下载券 Acm习题 7页 免费 ACM软件大赛集训练习题-... 21页...
ACM练习题分类表 请所有的新队员认真完成以下各题。如果做题遇到困难,如题意难以...因为题目虽然简单,但是再简单的题目都不能保证一次做对,而做错题的各种原因如...
ACM 练习题(1)描述 浙江工商大学校园里绿树成荫,环境非常舒适,因此也引来一批...ACM简单练习题 13页 免费 acm习题.txt 17页 免费 ACM(美国计算机协会)入门.....
ACM试题解析-1_电脑基础知识_IT/计算机_专业资料。2003 年 ACM-ICPC 南太平洋...此题虽为 ACM 比赛用题,却非常简单,没有什么特别之处,不牵扯数据结构, 实为...
ACM练习题_IT认证_资格考试/认证_教育专区。ACM 练习题 ZDM 一、 高精度运算...ACM简单练习题 13页 免费 ACM(美国计算机协会)入门... 21页 免费 Acm习题 7...
ACM练习题_理学_高等教育_教育专区。ACM练习题ACM contests http://acm.uestc....每一组测试 数据只有一行,为一个简单的四则运算表达式。该行没有其它多余的...
热门文档