Problem ID: asteroids
The year is 2112 and humankind has conquered the solar system. The Space Ranger Corps have set up bases on any hunk of rock that is even remotely inhabitable. Your job as a member of the Asteroid Communications Ministry is to make sure that all of the Space Ranger asteroid bases can communicate with one another as cheaply as possible. You couldset up direct communication links from each base to every other base, but that would be prohibitively expensive. Instead, you want to set up the minimum number of links so that everyone can send messages to everyone else, potentially relayed by one or more bases. The cost of any link is directly proportional to the distance between the two bases it connects, so this doesn’t seem that hard of aproblem. There is one small difﬁculty, however. Asteroids have a tendency to move about, so two bases that are currently very close may not be so in the future. Therefore as time goes on, you must be willing to switch your communication links so that you always have the cheapest relay system in place. Switching these links takes time and money, so you are interested in knowing how many times you willhave to perform such a switch. A few assumptions make your task easier. Each asteroid is considered a single point. Asteroids always move linearly with a ﬁxed velocity. No asteroids ever collide with other asteroids. Also, any relay system that becomes optimal at a time t ≥ 0 will be uniquely optimal for any time s satisfying t < s < t+10−6 . The initial optimal relay system will be unique.Input
Each test case starts with a line containing an integer n (2 ≤ n ≤ 50) indicating the number of asteroid bases. Following this are n lines, each containing six integers x, y, z, vx , vy , vz . The ﬁrst three specify the initial location of an asteroid (−150 ≤ x, y, z ≤ 150), and the last three specify the x, y, and z components of that asteroid’s velocity in space units per time unit (−100 ≤vx , vy , vz ≤ 100).
For each test case, display a single line containing the case number and the number of times that the relay system needs to be set up or modiﬁed. Sample Input 3 0 0 0 0 0 0 5 0 0 0 0 0 10 1 0 -1 0 0 4 0 0 0 1 0 0 0 1 0 0 -1 0 1 1 1 3 1 1 -1 -1 2 1 -1 -1 Output for Sample Input Case 1: 3 Case 2: 3
ACM-ICPC World Finals 2012 Problem A: Asteroid Rangers
1This page is intentionally left blank.
Curvy Little Bottles
Problem ID: bottle
In her bike rides around Warsaw, Jill happened upon a shop that sold interesting glass bottles. She thought it might make an interesting project to use such bottles for measuring liquids, but this would require placing markings on the bottles to indicate various volumes. Where should those volumemarks be placed? Jill formalized the problem as follows. Assume a bottle is formed by revolving a shape that is the same as the graph of a polynomial P between x = xlow and x = xhigh around the x-axis. Thus the x-axis is coincident with a vertical line through the center of the bottle. The bottom of the bottle is formed by a solid circular region at x = xlow , and the top of the bottle, at x = xhigh ,is left open. The ﬁrst sample input represents a bottle formed using the simple polynomial 4 − 0.25x, with xlow = 0 and xhigh = 12. The bottom of this bottle is a circle with a radius of 4, and the opening at the top is a circle with a radius of 1. The height of this bottle is 12. Volume markings are in increments of 25. Given a polynomial P , xlow , xhigh , and the volume increment betweensuccessive marks on the bottle, compute the distances up from xlow for the marks at successive volume increments. A mark cannot be made past the top of the bottle, and no more than the ﬁrst 8 increments should be marked. Assume the value of P is greater than zero everywhere between xlow and xhigh .
Each test case consists of three lines of bottle data: • Line 1: n, the degree of the...
Leer documento completo
Regístrate para leer el documento completo.