Twenty-first Annual University of Oregon Eugene Luks Programming Competition

Similar documents
Twentieth Annual University of Oregon Eugene Luks Programming Competition

Ninth Annual University of Oregon Programming Competition

Programming Assignment 6: Famous Scientists Diving Competition

2005 University of California Undergraduate Experience Survey

4 th Grade CRCT Study Guide

st ANNUAL SKILLS MANITOBA COMPETITION CONTEST DESCRIPTION

st ANNUAL SKILLS MANITOBA COMPETITION CONTEST DESCRIPTION

4 th Grade CRCT Study Guide

st ANNUAL SKILLS MANITOBA COMPETITION CONTEST DESCRIPTION

EXPLORE MATHEMATICS TEST

Problem A. Ascent Sequences

Unit 1, Lesson 1: Moving in the Plane

Assignment Guide: Chapter 8 Geometry (L3)

Let s go through some examples of applying the normal distribution in practice.

Mathematics Masters Examination

CS 1044 Program 6 Summer I dimension ??????

UCF Local Contest September 1, 2018

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

UO Programming Contest, 1997

Graphs. Tessema M. Mengistu Department of Computer Science Southern Illinois University Carbondale Room - Faner 3131

OUTPUT: There should be one line per case, with the word possible or impossible.

Homework Packet Week #2

Unit 5, Lesson 8: Calculating Products of Decimals

MAFS Algebra 1. Quadratic Functions. Day 17 - Student Packet

Find the maximum value or minimum value for the function. 11. Solve the equation. 13.

Independent Practice #2

22nd ANNUAL SKILLS MANITOBA COMPETITION CONTEST DESCRIPTION

EXERCISE SET 10.2 MATD 0390 DUE DATE: INSTRUCTOR

Problem A limit 1 second. Alphabet

5.5 Right Triangles. 1. For an acute angle A in right triangle ABC, the trigonometric functions are as follow:

Chapter 3. Planning and Scheduling. Chapter Objectives. Check off these skills when you feel that you have mastered them.

, 6.7,, Order the numbers from least to greatest. 1. 1, 0, 2, 5, 4. Simplify the expression. 10.

The learner: 1. Interprets the division and multiplication of fractions. 2. Uses algorithms to multiply and divide fractions and decimals.

Section 1.5 Transformation of Functions

Unit 6 Quadratic Functions

Integers and the Coordinate Plane

Unit 1: Numeration I Can Statements

CHENNAI MATHEMATICAL INSTITUTE M.Sc. / Ph.D. Programme in Computer Science

LOOPS. Repetition using the while statement

More Flow Control Functions in C++ CS 16: Solving Problems with Computers I Lecture #4

Chapter 2: Number Systems

Mathematics 350 Section 6.3 Introduction to Fractals

Grade 6 Middle School Math Solution Alignment to Oklahoma Academic Standards

1. One-third of 105 is the same as seven-sixths of what number? 1.

This table connects the content provided by Education Perfect to the NSW Syllabus..

PARTICIPATION PACKET 2019 SENIOR CLASS CHALLENGE. PRESENTED BY: Red Dragon Productions & Power 98 FM

Page 1 CCM6 Unit 10 Graphing UNIT 10 COORDINATE PLANE. CCM Name: Math Teacher: Projected Test Date:

Ascii Art. CS 1301 Individual Homework 7 Ascii Art Due: Monday April 4 th, before 11:55pm Out of 100 points

Chapter 3. Set Theory. 3.1 What is a Set?

Weighted Powers Ranking Method

ACM Pacific NW Region Programming Contest 13 November 2004 Problem A: Mersenne Composite Numbers

IMO Training 2008: Graph Theory

Math A Regents Exam 0601 Page 1

Graphing Linear Equations and Inequalities: Graphing Linear Equations and Inequalities in One Variable *

R - T (Gauss 2004) At the Gauss Store you earn 5 reward points for each $25 you spend. Stuart spent $200 and received points. Find.

Linby Primary School Targets Ladder. Linby Primary School Targets Ladder

Millionaire. Input. Output. Problem limit seconds

1. Alicia tosses 3 fair coins. What is the probability that she gets at 1. least 1 head? Express your answer as a common fraction.

Math 155. Measures of Central Tendency Section 3.1

60th ANNUAL HIGH SCHOOL HONORS MATHEMATICS CONTEST

EC121 Mathematical Techniques A Revision Notes

Kharagpur Site Online Problems 2013

Section 1.5 Transformation of Functions

CULTURAL DIVERSITY FOUNDATION COMPUTER SOFTWARE APPLICATION PROGRAM 500 N. Rainbow Blvd. Ste 222 Las Vegas, Nevada Fax: 703

(Refer Slide Time: 00:02:00)

X & Y COORDINATES. Teachers Guide

2013 Four-by-Four Competition Thursday, January 31st, Round Four-by-Four Competition Thursday, January 31st, 2013.

Shape Up. SETTING THE STAGE Children sort figures according to basic attributes.

AP Statistics Summer Math Packet

Problem A - Playlist UAC2 2015

Remaining Enhanced Labs

Chapter 1 Histograms, Scatterplots, and Graphs of Functions

Section 1.5 Transformation of Functions

Maths. Formative Assessment/key piece of work prior to end of unit: Term Autumn 1

Instructor: Paul Zeitz, University of San Francisco

NOTES: ALGEBRA FUNCTION NOTATION

Practice with Functions

Teaching Math thru Big Ideas Focusing on Differentiation. Marian Small April 2017 San Diego, CA

Pacific Northwest Region Programming Contest Division 2

Booking vacation packages (general)

Minimum Spanning Trees

Lecture 13 Geometry and Computational Geometry

Rational Numbers and the Coordinate Plane

2018 Pummill Relay problem statement

2017 Consortium for Computing Sciences in Colleges Programming Contest Saturday, November 4th Furman University Greenville, SC

MS RtI Tier 3. Curriculum (107 topics + 91 additional topics)

Arrays and Other Data Types

Chapter 3 Analyzing Normal Quantitative Data

Reducing Points In a Handwritten Curve (Improvement in a Note-taking Tool)

Unit. 8 Days : August 24 September 2

Covering & Surrounding

JS Lab 1: (Due Thurs, April 27)

Investigation 1: The Family of Polygons

Competitive Programming Network - 2nd Activity March 11th, Alphabet.c, Alphabet.cpp, Alphabet.java, Alphabet.py Standard Standard

RtI 7. Curriculum (219 topics additional topics)

Mathematics: working hard together, achieving together, making every lesson count

The Game of Criss-Cross

Problem A Colourful Graph Time limit: 5 seconds

Section 4.1 Investigating Circles

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague December 16, CS1800 Discrete Structures Final

Transcription:

Twenty-first Annual University of Oregon Eugene Luks Programming Competition 017 April 9, Saturday am10:00 pm:00 Problem Contributors Daniel Lowd, Eugene Luks, Chris Wilson Technical Assistance and Organization Lauradel Collins, Anton Matschek

A HOW MANY TEAMS? You have a new job assisting your local computer science department in forming teams for a programming competition. Each team must be formed as a group of three friends, and you need to write a program to determine from a list of (pair-wise) friends how many possible teams could be formed. For example, if we have students numbered 1,, 3, and and it turns out that all are friends with each other, then there would be possible teams: possible teams 1 3 1 1 3 3 The list of friends will be given as an undirected graph. There will be an edge between U and V if U and V are mutual friends. Note that if U and V are friends, then V and U are friends (friendship goes both ways). However, If U and V are friends, and V and W are friends, it might not be true that U and W are friends. That would only be true if U and W are in the friendship list: that is, if (U,W) is also an edge. The input will start with a number C, C 10, of test cases. Each test case starts with two integers N and M, on separate lines, where N 100, is the number of students. The next number M, M 950, is number of edges (friendships). The following M lines contain a pair U V, where 1 U,V N represents an edge. The output should consist of one integer for each test case: the number of teams that could be formed of three people, all pairs of whom are friends. In other words, find the number of distinct triples U V W such that (U,V), (V,W), and (W,U) are edges. (Note that a team such as 1 3 is the same as 1 3 and should only be counted once.) See reverse for Sample I/O.

6 1 1 3 1 3 3 5 9 1 1 3 1 3 5 3 3 5 5 7

B LOTH-CATTERIES Since their domestication on Lothal by Star Wars rebels, loth-cats have dominated the interstellar pet-trade. Pet emporiums throughout the Outer Rim have been constructing catteries to house these adorable-but-temperamental creatures. Loth-cattery walls must be constructed from aromatic Lothal-pine panels which come in one-meter widths and are equipped with hinges that allow straight extensions or right-angle turns. This enables constructions of catteries that simulate the Loth-cats twisty burrows. The specification for a cattery construction consists a sequence of panel-positions comprising the perimeter. After a starting panel S a panel position is indicated by its orientation with respect to its predecessor: F indicates continue in the same direction. R indicates turn right. L indicates turn left. Thus, the string SFLRLLFLRL specifies the cattery (In this picture, the first panel starts horizonally from the lower left.) Since animal welfare regulations require one square meter of space per loth-cat, this cattery can accommodate loth-cats. In this problem you are asked to determine the loth-cat capacity of specified cateries. The first line of the input will declare the number N of problem instances to be considered. Each of the next N lines will contain a string that starts with S and consists otherwise of F s, R s, and L s. The string will always specify the closed, non self-intersecting, perimeter of a legitimate cattery. For each cattery, the output should indicate the log-cat capacity (that is, the area of the enclosed region). 3 SFLRLLFLRL SLLFFLFFFLFFLFLLRRFR SFRLLFRLLFFFRFLLRLLRRLLRLL 9 15 The second and third samples are sketched on the reverse.

SLLFFLFFFLFFLFLLRRFR S SFRLLFRLLFFFRFLLRLLRRLLRLL S

C CANCEL THE FEWEST TALKS The Computer Science Department at the University of Turing has many applications for their rare faculty positions, so the time slots to give talks there are highly coveted. All the applicants will give a talk on the same day in the same room, and each person s talk has a fixed start and finish time. Since these times may overlap, and no talks will be allowed to occur at the same time, your job is to write a program that will determine the fewest number of talks to cancel. Suppose we indicate a talk s start and finish time as a pair (start,finish), where start and finish are integers. We allow that one talk may start immediately after one talk ends (so the finish time of one talk can be equal to the start time of the next). For example: If the talks are (1,), (3,), (1,3), (,3), then the answer is 1. This is because we can cancel only (1,3) and keep (1,), (,3), (3,). If the talks are (1,), (1,), (1,), then talks must be cancelled as only one talk can be given in the (1,) slot. With an input talk schedule of (3,), (,5), (7,9), (9,10), none have to be cancelled so the correct output is 0. The input will start with a number C, C 0, of test cases. Each test case will start with an integer N, 1 N 500, the number of talks for this case. This is followed by N lines of the form S F, where S and F are integers, 0 S<F 500, with S indicating the start time of a talk and F the finish time. You may not assume that the list of talks is sorted by either the start time S or the finish time F, but you can assume that S is strictly earlier than F (that is, S<F). The output needs to be a single integer R for each test case on its own line. This number R is the fewest number of talks that will need to be removed from the schedule (cancelled) so that the remaining talks do not overlap. 1 3 3 1 3 7 1 3 3 6 6 8 1 5 7 5 8 1

D AIRLINE REACCOMMODATION Each group of customers who flies on Turing Airlines (TA) (motto: "We Fly the Computable Skies!") specifies an amount of money they would accept as compensation for being placed on a later flight. When TA needs to make room for crew members, it removes one or more groups of customers, paying each group the amount of money they specified. For example, a family of four might accept being removed for $100, and a sports team with 15 players might accept being removed for $3000. TA can pay the family $100 to make room for four crew members, pay the sports team $3000 to make room for 15 crew members, or pay them both a total of $00 to make room for 19 crew members. However, TA never removes a partial group. As a staff engineer for Turing Airlines, you need to implement an algorithm to compute the lowest cost required to remove a specified number of passengers, k. You may not remove part of a group, but you are allowed to remove groups totaling more than k passengers as long as the cost is minimized. For example, suppose we need to remove customers and we have the following groups: Group Size Cost to Remove 1 $100 1 $150 $300 3 $00 The cheapest way to remove (at least) customers is to pay the last group $00. The first line of the input is the number of test cases C (C 10), each case representing one flight. Each test case begins with the number of passengers to remove, K (1 K 100), and the number of customer groups, N (1 N 100). For each group of customers, a line specifies the number of customers in the group (S 100) and the amount of money they require as compensation (M 1,000,000). All numbers are integers. The output should consist of one integer for each test case, specifying the minimum total cost to reaccommodate the passengers. 1 100 1 150 300 3 00 3 5 1 100 1 00 1 00 500 3 50 00 50

E PENULTIMATE PLACE The double-exponential!!!! can represent a huge number even with modest values of a,b,c. For example, 3!! expands to the 99-digit number in the box to the right. Conversely, the famously-immense googol is compactly expressed by 10!"!. This problem will deal with such double-exponentials with a,b,c each lying between and 99. Mercifully, you will have to produce only the next-to-last digit of the expansion of the number. The first line of the input will declare the number N of problem instances to be considered. Each of the next N lines will contain a triple of integers a b c separated by single spaces. The output should indicate the next-to-last digit (i.e., the tens place) in the decimal expansion of!!!. For example, since 5!! = 5! = 39065, the input 5 3 should yield the output. 8 3 3 5 7 8 9 9 9 9 7 5 3 0 10 10 1 0 8 5 0

F DO THE RANKINGS AGREE? Your team has been retained by the director of a competition who supervises a panel of judges. The competition asks the judges to assign integer scores to competitors the higher the score, the better. Although the event has standards for what score values mean, each judge is likely to interpret those standards differently. A score of 100, say, may mean different things to different judges. The director's main objective is to determine which competitors should receive prizes for the top positions. Although absolute scores may differ from judge to judge, the director realizes that relative rankings provide the needed information if two judges rank the same competitors first, second, third,... then they agree on who should receive the prizes. Your team is to write a program to assist the director by comparing the scores of pairs of judges. The program is to read two lists of integer scores in competitor order and determine the highest ranking place (first place being highest) at which the judges disagree. The first line of input will be a number C, the number of competitor pairs. What follows will be a series of C score list pairs. Each pair begins with a single integer giving the number of competitors N, 1 < N < 1,000. The next N integers are the scores from the first judge in competitor order. These are followed by the second judge's scores N more integers, also in competitor order. Scores are in the range 0 to 100,000 inclusive. Judges are not allowed to give ties, so each judge s scores will be unique. Values are separated from each other by one or more spaces. For each score pair, print a line with the integer representing the highest-ranking place at which the judges do not agree. If the judges agree on every place, print a line containing only the word 'agree'. Use the format below: Case, one space, the case number, a colon and one space, and the answer for that case with no trailing spaces. 3 8 6 15 37 17 3 8 80 60 0 0 10 30 50 70 160 100 10 80 0 60 90 135 Case 1: agree Case : 3