没有合适的资源?快使用搜索试试~ 我知道了~
ACM资料
3星 · 超过75%的资源 需积分: 9 158 下载量 32 浏览量
2007-07-13
07:59:20
上传
评论 1
收藏 278KB PDF 举报
温馨提示
试读
16页
ACM程序设计 解题报告
资源详情
资源评论
资源推荐
2006-2007 ACM Asia Programming Contest Shanghai Site
Hosted By Shanghai University
2006-2007 ACM International Collegiate Programming Contest
Asia Regional Contest
Shanghai Site
Shanghai Site First Round Internet Contest
October 21, 2006
This problem set should contain eight (8) problems on fifteen (15) pages. Please
inform a runner immediately if something is missing from your problem set.
1
2006-2007 ACM Asia Programming Contest Shanghai Site
Hosted By Shanghai University
Balls
Time Limit : 1 seconds Memory Limit : 10MB
Tracy has been dreaming of becoming a basketball player for many years. But
considering her current height... However, Tracy still loves basketball. One day she
saw a basketball game: There were n big baskets with unlimited height but small
width which only allows one ball to pass.
A player can shoot a basketball into arbitrary baskets. Basketballs are numbered
from 1. The player should obey the following rules:
1. Balls with smaller numbers should be put under balls with larger numbers.
2. The sum of two neighboring balls' number should be a prime.
3. You can't shoot the basketball numbered i unless the basketball numbered i - 1
has already been successfully shot into one of the baskets.
The winner is the person who shoots most number of basketballs.
All the balls numbered from 1 to n should be shot into baskets.
Tracy wanted to win the game. She wanted to know how many balls can be put at
most?
Input:
The input file contains several test cases. For each test case:
only one line contains one number n (0<= n < 16).
2
2006-2007 ACM Asia Programming Contest Shanghai Site
Hosted By Shanghai University
Output:
For each test case, output one number m, the maximal number of balls, on a
separate line.
Sample Input:
1
Sample Output:
4
3
2006-2007 ACM Asia Programming Contest Shanghai Site
Hosted By Shanghai University
Communication
Time Limit : 5 seconds Memory Limit : 10MB
We have received an order to build a communication system on the Earth. The system
consists of several cities connected with some on-ground and under-ground
communication paths.
In this problem, we assume that the Earth is a perfect sphere with a radius of
exactly 6378 km. On-ground paths are built on the surface of the earth, while
under-ground paths are straight lines which pass through the earth.
As you know, constructing under-ground paths is a difficult job. Only K or less
than K paths are allowed to build. However, you can build unlimited number of on-
ground paths.
Your task is to construct some paths for given cities so that any two cities are
connected by the paths directly or indirectly. For economic reasons, the total
length of the path should be minimized.
The value of PI is approximately 3.141592653589793.
Input:
The input contains several cases.
The first line contains two numbers N (1 <= N <= 500) and K (0 <= K < N). The
following N lines describe the locations of the N cities. Each line contains two
real numbers, representing its latitude and longitude.
The latitude will be between -90 and +90. The longitude will be between -180 and
+180 where negative numbers denote locations west of the meridian and positive
numbers denote locations east of the meridian.
The input ends with a zero on a single line.
Output:
For each case, output a number representing the total length (km) of the paths,
rounded to the nearest integer.
Sample Input:
2 0
-90.00 0.00
90.00 0.00
2 1
4
剩余15页未读,继续阅读
czyou
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论3