0% found this document useful (0 votes)
4 views9 pages

9530 T - Mao - Programming - 2018

The FAMAT State Convention 2018 features a one-hour computer programming competition for teams of three, where participants solve various programming problems using languages like Python, Java, and C++. Each problem has a specific point value and requires correct output for provided inputs, with judges assessing submissions and handling disputes. The competition includes multiple problems, each with unique requirements and scoring criteria, culminating in a final score based on the highest points earned.

Uploaded by

mofongosupr3m3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views9 pages

9530 T - Mao - Programming - 2018

The FAMAT State Convention 2018 features a one-hour computer programming competition for teams of three, where participants solve various programming problems using languages like Python, Java, and C++. Each problem has a specific point value and requires correct output for provided inputs, with judges assessing submissions and handling disputes. The competition includes multiple problems, each with unique requirements and scoring criteria, culminating in a final score based on the highest points earned.

Uploaded by

mofongosupr3m3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Open Computer Test FAMAT Sate Convention 2018

Computer Programming Competition

This one-hour computer programming competition will consist of a collection of problems, each of which
will require students to write a program that displays correct output for each input value or set of input
values provided by the judge. Each problem's point value is displayed in the problem. Problems may be
solved in any order.

Each school is limited to one team of three members and must supply its own computer and necessary
power cables. Acceptable programming languages are BASIC, Pascal, C/C++, Python, and Java. No use
of calculators or cell phones is permitted during the contest. One programming language reference book
is allowed.

Each program may be run only once and must run continuously for all input lines. Points are assigned by
the correctness of each output line. Partial credit is possible. If, in the opinion of a judge, the data has
been entered incorrectly, a restart is possible. No additional programming or corrections will be permitted
before additional runs of a restarted program.

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 input and will check to make sure your program
displays the correct output for the value(s) provided.

Whenever you ask to have a problem judged, the judge must initial your score sheet in the appropriate
location to indicate whether or not the problem was solved correctly and enter any scores that have been
earned.

Numerical input and output values will be sized such as to fit within ordinary (String, int, double …) data
types.

Unless the problem states differently, round-off error in output values will be ignored, provided the output
is no further than .01 away from the correct answer.

Maximum run time for any submission is 1 minute.

All programming must STOP when the judges call time. Teams will have one additional opportunity to
have a SINGLE program scored after time is called. If a team is having a problem graded when time is
called, they are still allowed to have an additional problem graded.

All DISPUTES will be handled in the testing room by the judges. All decisions of the judges are final.

Places will be determined as follows: Highest Score, Sudden Death (first points missed).

The sample input and output accompanying each problem do not necessarily test all possibilities.
Open Computer Test FAMAT Sate Convention 2018

FAMAT State Convention 2018

Computer Programming ___________________

Place (Judges only)

Scoring Sheet

School ID: ___________________________________________________________

School Name: _________________________________________________________

Captain Name and ID: _________________________________________________

Member 1: ____________________________________________________________

Member 2: ____________________________________________________________

Subsection
Problem (max
Total
points)
1 2 3 4 5 6 7 8
1. (5)

2. (15) NA

3. (20)

Digits |’s -‘s Xi ' s X’s Spaces


4. (18) NA

5. (15) NA

6. (22)

7. (25) NA
Final Score

Judges: Enter subsection points and initial in each subsection. When problem is finished, total its line.

Students: Fill out your school’s name and id, your members’ names, and your captain’s id. Don’t fill out
the points table – the judges will do that when they grade your answers.
Open Computer Test FAMAT Sate Convention 2018

Alright, time for some programming! Each problem will have a problem statement, and a sample
input/output. Judges will have you enter each of the input cases and write on the score sheet the number
of points you receive when you call them over to grade a program. Programs that fail to compile or run
will not receive points for input cases that were not entered due to program crashes. You are only allowed
one submission per program. Don’t forget to hand in your scoring sheet at the end of the contest!

1. Test Question Don’t Upvote (5 points total; 1 per case)


Input will consist of five lines, each containing two non-negative integers that are not greater than
100, these integers are separated by a space. For each line of input, output the line “A). B C”,
where A is the line number of the input, B is the sum of the integers, and C is the product of the
integers.

Sample Input:

55
10 10
13 37
42 99
13 12

Sample Output:

1). 10 25
2). 20 100
3). 50 481
4). 141 4158
5). 25 156
Open Computer Test FAMAT Sate Convention 2018

2. Choosing the Right College (15 points; 3 per case)


Inspired by the exciting lifestyles portrayed in movies such as The Wolf of Wall Street and
emboldened by your mathematical and analytical prowess, you’ve decided to do exactly what any
other reasonable and level headed person in your situation would do – sell all of your belongings,
bet it all on penny stocks, and get hired by Goldman Sachs. Naturally, Goldman doesn’t hire just
anyone, so you need to make sure you go to a good college. What makes a good college? Good
students. Students with good grades. Students with A’s, B’s, and C’s, and not D’s. D’s make for
bad colleges. Obviously you want to go to colleges whose names do not contain the letter D.

Input will consist of five lines, each containing the name of a college. For each line of input,
output the name of the college, a colon, the number of D’s in its name, another colon, and then
the phrase “An excellent institution of higher education” if there are no D’s in its name, and the
phrase “A sad place for delinquents and other ne’er-do-wells” otherwise.

Naturally, D’s in any form are bad, so both upper and lowercase D’s should be treated equally.

Sample Input (Real input will consist of 2 more cases):

Princeton
Harvard
Davidson’s Clown College

Sample Output:
Princeton : 0 : An excellent institution of higher education
Harvard : 1 : A sad place for delinquents and other ne’er-do-wells
Davidson’s Clown College : 2 : A sad place for delinquents and other ne’er-do-wells
Open Computer Test FAMAT Sate Convention 2018

3. The Interview (20 points; 4 per case)


Now that you’ve gone to an excellent institution of higher education, you need to pass the
notoriously difficult Goldman Sachs interview process. Unfortunately, it’s about probability and
impossible to easily solve by hand. Luckily, you brought your laptop to the interview.

Your interviewer states the question: “I own N coins. Coin i∈ {1 , 2 … N } has a probability of
pi
of landing on heads when it is flipped. After I independently flip each coin, what is the
100
mean and standard deviation of the number of heads I see?”

Input will consist of five lines. Each line will be of the form “ N p 1 p2 … pN ”, where each pair of
adjacent pi’s is separated by a space. N will be a nonnegative integer less than 20 and each pi
will be of the form ab, where a and b are each in the range {0 ,1 , … 9 } and represent digits in the
number pi. For each line of input, output a line of the form u , σ where u is the average number
of heads, and σ is the standard deviation of the number of heads. There’s no need to round your
answers.

For example, in the second line of sample input, the question involves two coins, one of which is
fair and the other has a 1 in 4 chance of coming up heads.

Credit will be given if your value for u is within 0.01 of the true value and your value for σ is
within 0.1 of the true value. (Hint: This is a fairly wide tolerance range for σ . Why don’t you
flip a few coins yourself?) (Second hint: Question 6 provides a formula that might be helpful.)

Sample Input:

1 50
2 50 50
3 50 50 50
4 50 60 70 80
5 90 90 99 99 04

Sample Output:

0.5,0.5
1.0,0.71
1.5,0.7
2.6,0.92
3.82,0.49
Open Computer Test FAMAT Sate Convention 2018

4. Making Graphs (18 points, scoring detailed in question)


Now that you’ve secured employment, you spend most of your time looking at graphs.
Unfortunately, your graphing software broke after you tried to make a square pie chart, your
promises of 4 / π units of pie chart per pie chart notwithstanding. In light of this, you’ve decided
to build your own graphing software.

Input will consist of 8 lines of the form “ X i :Y i”, where X i is a single capital letter and Y i is an
integer between 0 and 10.

Sample Input: (Real input will consist of 5 more lines)


A:1
B:10
C:4

Sample Output:

10 | X
09 | X
08 | X
07 | X
06 | X
05 | X
04 | XX
03 | XX
02 | XX
01 |XXX
----
ABC

Precise Rules for Generating Graph:


The output your program creates will be 12 lines tall and 12 columns wide, and the first 10 lines
will have the numbers 1-10, the numbers 1-9 of which will preceded by a leading 0. In these first
10 lines, the numbers will be followed by a space and then a vertical bar (|). On the 11 th line your
program outputs, there should be a row of horizontal bars (-) that begin in the fourth column,
columns 1-3 should contain spaces. On the 12th line, starting in the column after the first
horizontal bar, should be the values of X i , as given in the order that they are inputted in. Denote
the column demarcated by value X i as column i . Column i should contain Y i capital X’s, starting
immediately above the horizontal bar, and ending at the row whose leading two digits represent
the number Y i. All locations whose contents are not described by the previous directions should
be filled with “ “ (a space).

Scoring:
Open Computer Test FAMAT Sate Convention 2018

3 points each for correct locations of digits, |’s, -‘s, X i ’s, X’s, and spaces. All members of a
category must be placed correctly to receive the points for that category.

5. Making Friends (15 points, 3 per case)


After a brutal 6 years of perfecting your graphing software, you’ve decided that it’s time to make
some friends. However, you don’t want to make friends with just anybody! Obviously, only
very cool people can be friends with the likes of you. So, you’ve decided to write a program to
help you out.

Luckily, the coolness of a person is determined uniquely by their name. A person is cool if an
odd number of the following 6 conditions hold or if either or conditions 1 and 2 hold:
1.) They are named Sam.
2.) They are named Rob Snow.
3.) Their name starts with an S.
4.) The sum of the numerical values of the letters in their name (a=1, b=2, ..., z=26)
is of the same parity as the number of conditions, excluding conditions 4 and 5,
that they satisfy.
5.) Condition 4 is unsatisfied.
6.) The number of vowels (aeiou only) in their name is equal to the number of
consonants (including y) in their name.

Naturally, a name consists only of vowels, consonants, commas, and spaces, only the first letter
of which is considered for condition 3. Input will consist of five lines, each containing a name.
For each line of input, output a line of the form “Satisfied Y conditions and is very cool.” if the
person was cool, and a line of the form “Satisfied Y conditions and is totally lame” otherwise,
where Y is the number of conditions that person satisfied. All conditions are case insensitive, for
example, “Sam” and “sam” both satisfy condition 1.

Sample input:

Sam
Rob
Janet Yellen
Sonny Perdue
Some other team

Sample Output:

Satisfied 3 conditions and is very cool


Satisfied 1 conditions and is very cool
Satisfied 1 conditions and is very cool
Satisfied 2 conditions and is totally lame
Satisfied 2 conditions and is totally lame
Open Computer Test FAMAT Sate Convention 2018

6. Making Money (22 points, 3 for each of 7 cases and 1 for the final line)
Despite your extremely accurate coolness detection program, you’ve decided that friends are
overrated and now seek the company of money alone. You’ve decided on a simple momentum
strategy: buy stocks that did well in the past. To implement this, you’ve decided to build a
program that tells you what stocks to buy.

Input will consist of 7 lines, each of the form “X:Y:Z”, where X is a ticker and Y, Z are positive
integer or decimal numbers. A ticker is a series of capitalized alphabetic characters. Y is the
stock’s price at the start of the year, and Z is the stock’s price now.

Output will consist of 8 lines, the first 7 of which should be of the form “A: B”, where A is a
ticker from the input, and B is the percentage gain, rounded to one decimal place, that the stock
has achieved over the past year. The 8th line should contain the phrase “QUICKLY! BET ALL
YOUR MONEY ON X”, where X is the ticker that has the highest percentage gain since the start
of the year. Lines should be sorted by percentage gain (highest at the top). No two input lines
will contain the same ticker or contain tickers with the same percentage gain, because we’re not
evil.

Sample Input:
SAM:1:1000
OTHERTEAM:1000:1
YOU:1:999.998
DECIMALNUMBERS:13.37:42.0
ROBSNOW:1:999.999
AAPL:156.34:160.78
AMZN:956.67:1001.0

Sample Output:
SAM: 99900.0
ROBSNOW: 99899.9
YOU: 99899.8
DECIMALNUMBERS: 214.1
AMZN: 4.6
AAPL: 2.8
OTHERTEAM: -99.8
QUICKLY! BET ALL YOUR MONEY ON SAM
Open Computer Test FAMAT Sate Convention 2018

7. Correlations (25 points, 5 per case)


Correlations in the stock market are (un)surprisingly helpful. For example, when the price of
gold is rising, stocks tend to fall. Some stocks are even positively or negatively correlated with
others. In this problem, you will calculate the correlations of pairs of assets from historical data.

Input will consist of 5 lines. Each line will begin with an integer2 ≤ n≤ 4 , which will be
immediately followed by a colon and a semi-colon delimited list of n coordinate pairs of the form
(x , y ), where x and y are non-negative integers no greater than 10000. No lines will contain
spaces.

Output will consist of 5 lines, each of which will contain the correlation between the x ’s and y ’s
of the corresponding input line. There’s no need to round.

Recall the following formulas related to sample standard deviation ( s x) and correlation (r xy), or
just read them below:


n

∑ ( x i− x́ )2
i=1
sx=
n−1

( ) ( )( )
1
n
x i−x́ y i− ý
r xy = ∗∑ ∗
n−1 i=1 s x sy

Sample Input (Real input will consist of 3 more lines):


2:(1,2);(3,4)
3:(1000,0);(500,500);(0,1000)

Sample Output:
1
-1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy