Download Judging - FloridaMAO

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Addition wikipedia , lookup

Halting problem wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
Judge's Version
Computer
Programming
Competition
FAMAT State
Convention 2009
page 1 of 12
Judge's Version 2009 State Computers
FAMAT 2009 State Convention JUDGES VERSION












The one hour computer programming competition will consist of a set of problems for
which teams must write programs to process specific input and display correct output for
all cases provided by the judges. Data on the judges’ sheet will be delimited by commas,
but teams may delimit data in a way appropriate to their language (i.e. separated by
spaces).
The problems will be of varying difficulty and will have appropriate point values assigned
to each. The problems may be solved in any order. Ties will be broken by the sudden
death method starting with problem 1.
Each school is limited to one team of three members and one computer. Each school must
supply its own computer, extension cord, and power strip. (Note: Schools need BOTH an
extension cord AND a power strip.) Programs may be written in Java, C/C++, Basic or
Pascal. No calculators, cell phones or internet use is permitted. Each team is allowed one
electronic or printed language reference source. (For example, the Java API’s may be
installed on the computer.) Judges reserve the right to accept or deny the use of any
language reference materials. Teams should present their reference materials for approval
before the contest begins. Teams are not permitted to use any prewritten code.
Each program gets one attempt for grading. In the case of an input error, data may be
reentered but there may be no changes to the code between runs. Many programs have
multiple parts. A program may receive credit for any portion of the output that is correct.
It is not necessary to label the output if the output is in the same order as the sample
output.
If you wish to have a problem graded, one member of your team should raise his/her hand
and wait for a judge to come to your area. The judge will provide the input and will check
to make sure your program displays the correct output for the value(s) provided.
For each problem, the judge may ask you to run your program once or twice with different
inputs. If your program fails to display the correct output during any of these runs, no
points will be awarded for the part with an incorrect answer.
Whenever a problem is judged, the judge must initial your score sheet in the appropriate
location to indicate the score for the program.
Unless otherwise indicated, numerical input and output values will be real numbers, and
string input values will not exceed 100 characters in length.
Round-off error in output values will be ignored, provided the output is sufficiently
accurate to determine that it is the correct answer. For example, the value 0.57143 is
4
acceptable for , but 0.6 is not.
7
The sample input and output accompanying each problem do not necessarily test all possibilities.
PLEASE OUTPUT ANSWERS AS SOON AS THEY ARE CALCULATED. If your
program hangs up on a particular input, you can still get partial credit for answers that you
have.
Time may be called before judges are able to score a program. If a program is submitted
before time is called, that program (only one) will be scored by the judges. The final
program may not have a run time exceeding 1 minute.
page 2 of 12
Judge's Version 2009 State Computers
1. Scoring (40 pts)
FAMAT has a special scoring system for its competitions. Answer the following questions about
FAMAT and its scoring system.
a) What is the maximum score on a FAMAT individual test? (5)
b) What is the minimum score on a FAMAT individual test? (5)
c) What individual scores(s) have the best chance of appearing if all questions are answered
randomly? (Blank answer allowed) (5)
d) Which individual score(s) are not possible? (5)
e) What is the probability of randomly getting all individual questions correct? No blank
answers(20)
Input: none
Output: (answers to above questions)
2. Hyperbola (50 pts)
We would like to know all about hyperbolas. The input will be the coefficients of a hyperbola in
the form Ax 2  By 2  C , the output will be the intercepts (5), the foci (5), the eccentricity (10) ,
the equation of the directrixes (10), the latus rectum (10), and the equations of the asymptotes
(10). Display answers rounded to 3 decimal places.)
INPUT: 9, 16, 144
OUPUT
a) Intercepts: (4,0) (-4,0) (any order)
b) Foci: (5,0) (-5,0)
c) Eccentricity: 1.25
d) Equations of the directrices: x = -3.2 x=3.2
e) Latus Rectum: 4.5
f) The equations of the asymptotes: y = .75 x y= -.75 x
page 3 of 12
Judge's Version 2009 State Computers
3. Triangles (100 pts)
Write a program that will tell everything about triangles. The program will accept an input of 3
order pairs of numbers and output the following information:
a) The three angle measures in degrees. (10)
b) Type of triangle: Obtuse, Right or Acute. (due to rounding problems with doubles, no angle
will be between 890 and 910 , unless it is meant to be a right angle) (10)
c) The perimeter of the triangle. (10)
d) The maximum of the absolute value of the slopes of the three sides. (10)
e) The area of the triangle formed by the three points(10)
f) The centroid of the triangle formed by the three points. (10)
g) The incenter of the triangle formed by the three points(10)
h) The circumcenter of the triangle formed by the three points(10)
i) The sum of the areas of the three parallelograms that can be formed using the three points. (10)
j) If a plane crashes at the centroid of this triangle, and cemeteries exist at each vertex, at which
vertex should survivors be buried to minimize the distance that they must be transported. (10)
Input: 0.0,0.0,0.0,1.0,1.0,0.0
a) Angles: A:90.0 B:45.0 C:45.0
b) Type: Right
c) Perimeter 3.414
d) Max Slope Infinity
e) Area 0.5
f) Centroid: (0.333,0.333)
g) Incenter: (0.293,0.293)
h) Circumcenter: (0.5,0.5) should be (0.5,0.5)
i) (no hint )
j) (no hint )
4. Coefficients (20pts)
Write a program that will calculate the coefficients of a binomial expansion. The input will be the
n
degree of the expression  a  b  . The output will be the sum of the coefficients of the
expansion. ( For example:
1+3+3+1 = 8.)
Input: 0
Output: 1
Input: 3
Output: 8
a  b
3
 a 3  3a 2b  3ab 2  b3 so the sum of the coefficients is
5. Strings (30 pts)
Write a program that will take as input a single String of any typeable character. The output will
be a table of the occurrences of the capital alphabetic characters (i.e. 'A','B',…,'Z') AND the
numbers of characters counted for the display. Ignore all other characters.
Input: A BAD DAB a!
Output:
A: 3
B: 2
D: 2
Characters counted: 7
page 4 of 12
Judge's Version 2009 State Computers
6. Prime Palindromes (50pts)
Write a program to find positive prime palindromes (PPN). We want to see the nth PPN AFTER
the number we give you. Your program must handle 5 input sets. To test the efficiency of your
algorithm, n may be as large as 100000. You might want to print results out as you find them,
since this program may run for no more than 1 minute on any one data set.
Input: 101, 3
Ouput: 131
Input: 1,7
Output: 55
3 more sets
7. Abundant (pts)
A perfect number is defined as a positive integer which is the sum of its proper positive divisors,
that is, the sum of the positive divisors excluding the number itself. An abundant number is one
whose sum is greater. We want to calculate numbers which have a certain "abundance." We will
give you an integer d. Find the first abundant number whose sum is d greater than the number.
For example find the first number where d=3. 18 has proper factors of 1,2,3,6,9. The sum of
these factors is 21. 21 is 3 more 18.
Input: 3
Output: 18
Input: 4
Output: 12
3 more sets
8. Algebra (40 pts)
Write a program to analyze the roots of an nth degree polynomial. The input will consist of the
degree of a polynomial followed by the n+1 coefficients of that polynomial. Calculate the sum of
the roots, the sum of the squares of the roots, the sum of the inverses of the roots and the product
of the roots.
Input: 2, 1, 0, -1
Output:
Sum: 0
Sum of the Squares: 2
Sum of the Reciprocals: 0
Product of roots:-1
Input: 2, 1, 1, 0
Output:
Sum: -1
Sum of Squares: 1
Sum of the Reciprocals: Does not exist
Product of Roots: 0
page 5 of 12
Judge's Version 2009 State Computers
9. Information (50 pts)
Write a program to display the answers to the following questions about FAMAT.
a) What does FAMAT mean? (10)
b) Who is the president of FAMAT? (10)
c) Which school won the State Sweepstakes in 2008? (10)
d) How does the scoring program at a regional know that a student is on the Bowl Team? (10)
e) Who is the "Voice of Mu Alpha Theta"? Hint: He usually runs Bowls and MC's the awards
banquet. (10)
f) To compete in Theta a student should be enrolled in which 2 courses? (10)
g) In which division do Algebra 1 students compete at state? (10)
h) Which schools/organizations hosted Invitationals this year? (10)
i) During the Team/Bowl round, what score does a team get for answering a question correctly in
the 2nd minute when no team got a correct answer in the 1st minute? (10)
j) List the special competitions that count toward sweepstakes. (10)
Input: NONE
Output: the answers to the questions
page 6 of 12
Judge's Version 2009 State Computers
Judges Sheet
Problem 1 and 2
Instructions: Input the values shown on the judges' sheet into the students' program. They may
enter data in any way that they want, but once the program begins, it must RUN continuously
until all results are completed. If there is a problem with input, the program may be restarted but
no changes to the code can be made.
Answers may appear in any format, but if they are not labeled, they must be in the same order as
the judges' answer sheet. Answers may be rounded to 3 decimal places, but due to possible errors
in rounding, answer may vary slightly. As a rule of thumb, check to the hundredths place and be
aware of any changes due to rounding (i.e. 4.9999 may display as 5). Assign points based on the
output from only one run.
1. Scoring (40 pts)
NO INPUT
Output:
5 a)120
5 b)-30
5 c) common: 0
5 d) impossible: 109 113 114 117 118 119
20 e) prob of 120: 0.0020161290322580645
2. Hyperbola (50pts) (run 1 data set)
Answers should be displayed to 3 digits. Ignore the 3rd digit in judging and use two digits.
Input: 4.0, 45.0, 180.0
Intercepts (6.708,0.0) (-6.708,0.0)
FOCI (7.0,0.0) (-7.0,0.0)
Eccentricity 1.043
Directrices x=6.429 x=-6.429
latus rectum = 1.193
Assymptotes y=0.298x y=-0.298x
Input: 49.0, 16.0, 784.0
Intercepts (4.0,0.0) (-4.0,0.0)
FOCI (8.062,0.0) (-8.062,0.0)
Eccentricity 2.016
Directrices x=1.985 x=-1.985
latus rectum = 24.5
Assymptotes y=1.75x y=-1.75x
Input: 1.0, 1.0, 25.0
Intercepts (5.0,0.0) (-5.0,0.0)
FOCI (7.071,0.0) (-7.071,0.0)
Eccentricity 1.414
Directrices x=3.536 x=-3.536
latus rectum = 10.0
Assymptotes y=1.0x y=-1.0x
page 7 of 12
Judge's Version 2009 State Computers
Problems 3 and 4
3. Triangles (100 pts) (run 1 data set)
Input: 5.0,1.0,-2.0,0.0,4.0,8.0
a) Angles: A:90.0 B:45.0 C:45.0
b) Type: Right
c) Perimeter 24.142
d) Max Slope 7.0
e) Area 25.0
f) Centroid: (2.333,3.0)
g) Incenter: (2.657,2.757)
h) Circumcenter: (1.0,4.0) should be (1.0,4.0)
i) Area of Parallelograms 100.0
j) Nowhere. Survivors aren't buried!
Input: 2.0,2.0,14.0,8.0,16.0,2.0
a) Angles: A:26.565 B:81.87 C:71.565
b) Type: Acute
c) Perimeter 33.741
d) Max Slope 3.0
e) Area 42.0
f) Centroid: (10.667,4.0)
g) Incenter: (12.546,4.49)
h) Circumcenter: (9.0,3.0) should be (9.0,3.0)
i) Area of Parallelograms 168.0
j) Nowhere. Survivors aren't buried!
Input: 4.0,0.0,-2.0,4.0,0.0,6.0
a) Angles: A:22.62 B:78.69 C:78.69
b) Type: Acute
c) Perimeter 17.251
d) Max Slope 1.5
e) Area 10.0
f) Centroid: (0.667,3.333)
g) Incenter: (-0.18,4.18)
h) Circumcenter: (1.4,2.6) should be (1.4,2.6)
i) Area of Parallelograms 40.0
j) Nowhere. Survivors aren't buried!
4. Coefficients (20pts) - run one data set
Input: 20
Output: 1048576
Input: 40
Output: 1099511627776
page 8 of 12
Judge's Version 2009 State Computers
Problem 5 and 6
5. Strings (30 pts)
Input:
@NOW IS THE TIME? FOR ALL GOOD MEN* TO COME TO THE AID& OF THEIR
COUNTY!
Output:
A: 2
C: 2
D: 2
E: 6
F: 2
G: 1
H: 3
I: 4
L: 2
M: 3
N: 3
O: 9
R: 2
S: 1
T: 7
U: 1
W: 1
Y: 1
52
6. Prime Palindromes (50pts) (run 5 data sets)
Input
info only
1
101, 100
100 after 101 =
2
21, 200
200 after 21 =
3
1111, 200
200 after 1111 =
4
12121, 300
300 after 12121 =
5
301, 50000
50000 after 301 =
page 9 of 12
Answer
10001
19591
35153
72127
789090987
Judge's Version 2009 State Computers
Problem 7 and 8
7. Abundant (50pts) – run 5 data sets
Input
6
14
16
17
123456
1
2
3
4
5
info only
8931
286
566
117
307008
Answer
8925
272
550
100
183552
extra data sets
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Diff
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
Factor
2
3
4
7
8
10
18
19
20
22
24
40
100
108
140
200
1000
9999
sum
sum
sum
sum
sum
sum
sum
sum
sum
sum
sum
sum
sum
sum
sum
sum
sum
sum
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
for
8. Algebra (40 pts) – run 1 data set
INPUT: 5, 1.0, 5.0, -3.0, -29.0, 2.0, 24.0
Output:
sum = -5.0
reciprocals = -0.125
sum of squares = 31.0
product = -24.0
INPUT: 3, 1.0, -6.0, 11.0, -6.0
Output:
sum = 6.0
reciprocals = -1.833
sum of squares = 14.0
product = 6.0
INPUT: 4, 1.0, -10.0, 35.0, -50.0, 24.0
Output:
sum = 10.0
reciprocals = 1.458
sum of squares = 30.0
product = 24.0
page 10 of 12
Judge's Version 2009 State Computers
20
18
12
196
56
40
208
36
176
1312
112
736
580
414
2090
440
9580
38416
is
is
is
is
is
is
is
is
is
is
is
is
is
is
is
is
is
is
22
21
16
203
64
50
226
55
196
1334
136
776
680
522
2230
640
10580
48415
Problem 9
9.(50) points – 10 points each.
a) Florida Association of Mu Alpha Theta
b) Steve Friedlander
c) Buchholz
d) The last digit of the Student ID should be a 1 (or 2 in smaller regions)
e) Frank Caballero
f) Algebra II or Geometry
g) Algebra I students aren't allowed to attend state.
h) Vero Beach, Ft. Myers, Florida Blue Key or University of Florida
i) 16 points
j) Relay, Hustle, Poster, Scrapbook
page 11 of 12
Judge's Version 2009 State Computers
Score
Student Scoring Sheet
School
Judges assign a value to each box
School ID
Team Members
Question 1: (30pts) Judged by
a:5
b:5
c:5
Question 2: (50 pts) Judged by
a:5
b:5
c:10
Place:
d: 5
d:10
e:20
e:10
f:10
Question 3: (100) Judged by
a:10
b:10
c:10
d:10
e:10
f:10
h:10
i:10
j:10
g:10
total
Question 4: (20) Judged by
answer (20)
total
total
total
Question 5: (30) Judged by
Table: (20)
Total Letters(10)
Question 6: (50) Judged by
Set 1 (10)
Set 2 (10)
Set 3 (10)
Set 4(10)
Set 4(10)
total
Question 7: (50) Judged by
Set 1 (10)
Set 2 (10)
Set 3 (10)
Set 4(10)
Set 4(10)
total
Product: (10)
total
Question 8: (40 ) Judged by
Sum: (10)
Squares: (10)
Recip: (10)
total
Question 9: (50) Judged by
a: 5
b:5
c:5
d:5
e:5
f:5
h:5
i:5
j:5
page 12 of 12
g:5
Judge's Version 2009 State Computers
total