East Central North America Regional Contest Practice Session October 28

Similar documents
CALIFORNIA STANDARDS TEST CSM00433 CSM01958 A B C CSM02216 A 583,000

Westminster College 2018 High School Programming Contest. March 5, 2018

UW-Madison's 2009 ACM-ICPC Individual Placement Test October 4th, 1:00-6:00pm, CS1350

Jumpstarters for Math

Trimester 2 5 th Grade Name: Answer Key

amount base = percent 30% of the class 90% of the points 65% of the televisions

Force & Motion 4-5: ArithMachines

EOC FINAL REVIEW Name Due Date

McRuffy Press Fourth Grade Color Math Test 7

Sample: A small part of a lot or sublot which represents the whole. A sample may be made up of one or more increments or test portions.

2016 Excellence in Mathematics Contest Team Project Level I (Precalculus and above) School Name: Group Members:

Unit Four Answer Keys

For an alphabet, we can make do with just { s, 0, 1 }, in which for typographic simplicity, s stands for the blank space.

Record your answers and work on the separate answer sheet provided.

Open Number Line Mats

Grade 5 Mathematics Mid-Year Assessment REVIEW

EBU Recommendation on MHP

Professor Weissman s Algebra Classroom

1-5 Square Roots and Real Numbers. Holt Algebra 1

Canadian Computing Competition

Uses of Fractions. Fractions

Histograms and Frequency Polygons are statistical graphs used to illustrate frequency distributions.

EECS 270 Midterm 2 Exam Closed book portion Fall 2014

Astronomy Lab - Lab Notebook and Scaling

GRADE 6 WINTER REVIEW MATH PACKET

AskDrCallahan Calculus 1 Teacher s Guide

SA Development Tech LLC Press Counter II 1.00

Task-based Activity Cover Sheet

Math Conversation Starters

Kid-Friendly Tech. Fall Festival Varsity Division. Sets / Lights. Answers to what you actually have to do in this event

Table of Contents. Introduction...v. About the CD-ROM...vi. Standards Correlations... vii. Ratios and Proportional Relationships...

Broadcast News Writing

Functional Mathematics

A place for everything, and everthing in its place. - Samuel Smiles ( ) Unit Summary

ONIX for Books Product Information Message. Application Note: Weights and dimensions in ONIX 3.0

North Carolina Standard Course of Study - Mathematics

(1) + 1(0.1) + 7(0.001)

ENGR 40M Project 3b: Programming the LED cube

PHY221 Lab 1 Discovering Motion: Introduction to Logger Pro and the Motion Detector; Motion with Constant Velocity

Carnegie Mellon University. Invitational Programming Competition

16B CSS LAYOUT WITH GRID

Operating Instructions & Parts Manual. Laser Distance Measure. Model No. 38YG98

Delta College Middle School Math Competition Practice Test A 2018

COMPOSITE VIDEO LUMINANCE METER MODEL VLM-40 LUMINANCE MODEL VLM-40 NTSC TECHNICAL INSTRUCTION MANUAL

(8 Weeks = 40 School Days)

MATH& 146 Lesson 11. Section 1.6 Categorical Data

Algebra I Module 2 Lessons 1 19

Kid-Friendly Tech. Fall Festival Junior Varsity Division. Sets / Lights. Answers to what you actually have to do in this event

>> By Jason R. Kack, LS

TEST NAME:Decimal Review TEST ID: GRADE:05 Fifth Grade SUBJECT: Mathematics TEST CATEGORY: My Classroom

Springer Guidelines For The Full Paper Production

Doctor of Nursing Practice Formatting Guidelines

Unit 7, Lesson 1: Exponent Review

What is Statistics? 13.1 What is Statistics? Statistics

The Spaces of the Treble Clef

Operating Instructions & Parts Manual. Laser Distance Measure. Model No. 38YG99

AP MUSIC THEORY 2016 SCORING GUIDELINES

QUICK REPORT TECHNOLOGY TREND ANALYSIS

Display Contest Submittals

We put you first. And keep you ahead. USES FEATURES. Bulletin SS09040 Issue/Rev. 0.2 (10/14)

Preliminaries. for the Benelux Algorithm Programming Contest. Problems

Math: Fractions and Decimals 105

Lesson 25: Solving Problems in Two Ways Rates and Algebra

SEVENTH GRADE. Revised June Billings Public Schools Correlation and Pacing Guide Math - McDougal Littell Middle School Math 2004

Processing the Output of TOSOM

Practice Test. 2. What is the probability of rolling an even number on a number cube? a. 1 6 b. 2 6 c. 1 2 d. 5 be written as a decimal? 3.

Series 2500 Vibration Isolation Table

INSTALLATION INSTRUCTIONS FOR

Mobile Math Teachers Circle The Return of the iclicker

To calculate the estimated number of fish killed by shrimp trawlers every year in the Gulf of Mexico I will 9,400,000 by.

Module 1. Ratios and Proportional Relationships Lessons 11 14

Lesson 7: Measuring Variability for Skewed Distributions (Interquartile Range)

Letters Home from Yosemite

FE REVIEW LOGIC. The AND gate. The OR gate A B AB A B A B 0 1 1

GLog Users Manual.

Package schoenberg. June 26, 2018

Analyzing Numerical Data: Using Ratios I.B Student Activity Sheet 4: Ratios in the Media

Product Guide Verizon Pennsylvania Inc. Section 35D Verizon Pennsylvania Inc. Original Sheet 1 RESIDENCE TWO-POINT MESSAGE TOLL SERVICE

SqueakCMI Notebook: Projects, Tools, and Techniques

Course 1 Unit 4 Practice

DM Segment Decoder Driver Latch with Constant Current Source Outputs

2017 MICHIGAN SKILLS USA CHAMPIONSHIPS TASK AND MATERIALS LIST. SKILL OR LEADERSHIP AREA: Television Video Production

DM Segment Decoder/Driver/Latch with Constant Current Source Outputs

1/29/2008. Announcements. Announcements. Announcements. Announcements. Announcements. Announcements. Project Turn-In Process. Quiz 2.

Announcements. Project Turn-In Process. Project 1A: Project 1B. and URL for project on a Word doc Upload to Catalyst Collect It

THE OPERATION OF A CATHODE RAY TUBE

RECOMMENDATION ITU-R BT (Questions ITU-R 25/11, ITU-R 60/11 and ITU-R 61/11)

B291B. MATHEMATICS B (MEI) Paper 1 Section B (Foundation Tier) GENERAL CERTIFICATE OF SECONDARY EDUCATION. Friday 9 January 2009 Morning

Study on Indication pattern in Time of Flight Diffraction technique

Correlation to the Common Core State Standards

User Manual. LPA_Tool. Prepared by: Customer Support. Date: November 25, 1999 WaveRider Document N o.: LPA_Tool User Manual_V2-0.

1. Point A on the graph below represents the distance and time that Cat traveled on her trip. Which of the following represents her average speed?

AP Music Theory. Sample Student Responses and Scoring Commentary. Inside: Free Response Question 1. Scoring Guideline.

Part 1: Introduction to Computer Graphics

Practice, Practice, Practice Using Prototek Digital Receivers

QuickNet Copper Cabling in the Data Center

Unit 7, Lesson 1: Exponent Review

TeeJay Publishers. Curriculum for Excellence. Course Planner - Level 1

VIDEO PRODUCT DEVELOPMENT

Evaluation of Serial Periodic, Multi-Variable Data Visualizations

Transcription:

East Central North America Regional Contest 2016 ECNA 2016 Practice Session October 28 Problems A Dinoscan B Happy Trails C Prime Driving Conditions D Time is of the Essence Do not open before the contest has started.

This page is intentionally left blank.

ACM International Collegiate Contest 2016 East Central Regional PRACTICE Contest Grand Valley State University University of Cincinnati University of Windsor Youngstown State University October 28, 2016 Sponsored by IBM Rules: 1. There are four problems to be completed in 90 minutes. 2. All questions require you to read the test data from standard input and write results to standard output. You cannot use files for input or output. Additional input and output specifications can be found in the General Information Sheet. 3. When displaying results, follow the format in the Sample Output for each problem. Unless otherwise stated, all whitespace in the Sample Output consists of exactly one blank character. 4. The allowed programming languages are C, C++, Java, Python 2 and Python 3. 5. All programs will be re-compiled prior to testing with the judges data. 6. Non-standard libraries cannot be used in your solutions. The Standard Template Library (STL) and C++ string libraries are allowed. The standard Java API is available, except for those packages that are deemed dangerous by contestant officials (e.g., that might generate a security violation). 7. Programs will be run against multiple input files, each file containing a single test case. 8. Programming style is not considered in this contest. You are free to code in whatever style you prefer. Documentation is not required. 9. All communication with the judges will be handled by the Kattis environment. 10. Judges decisions are to be considered final. No cheating will be tolerated.

Problem A Dinoscan Sarah Tops is a paleontologist who specializes in the reconstruction of dinosaur skeletons. One problem which she faces is determining whether two bones mesh together correctly. She has taken scans of all the bones in her collection, so instead of physically trying to put bones together she plans to use the scans to determine the appropriate connections between bones. Below on the left are scans of the ends of two different bones: 1 1 1 0 0 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 0 Scan 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 Scan 2 Combined In each scan, a 1 indicates bone and a 0 indicates empty space. Two bones mesh together if the two scans can be put together to form a solid rectangle of 1 s with no overlap. Scan 1 above can mesh with Scan 2 (as shown above on the right), but Scan 1 cannot mesh with either scans 3 or 4 shown below: 0 0 0 1 0 1 1 1 0 0 0 1 0 0 0 1 Scan 3 0 0 1 1 1 1 0 1 1 1 1 1 0 0 1 Scan 4 Input Input starts with a line containing three positive integers r c 1 c 2, indicating the number of rows in both scans and the number of columns in the left hand and right hand scans. Following this are r lines each containing c 1 characters this is the left hand scan. All characters in the scan are either a 0 or a 1. Following this are r lines each with c 2 characters specifying the right hand scan. The maximum value for r, c 1 and c 2 is 20. In all test cases, the first column of the left hand scan and the last column of the right hand scan contain all 1 s. Output Display Yes if the two scans can be meshed together, or No otherwise. After the scans are connected, no portion of the left hand scan should extend beyond the right hand scan, and vice-versa. ECNA 2016 Problem A: Dinoscan 1

Sample Input 1 Sample Output 1 5 5 3 10000 10000 001 111 001 111 001 Yes Sample Input 2 Sample Output 2 5 5 3 10000 10000 001 111 011 111 001 No ECNA 2016 Problem A: Dinoscan 2

Problem B Happy Trails Your job as a forest ranger comes with many responsibilities, but one of the hardest tasks is planning and preparing new trails for hikers. When a new trail is opened to the public, the National Forest Service adds a page to their website for the trail which contains quite a bit of information. The web page includes things like the location where the trail begins, the difficulty of hiking the trail, and pictures taken from various scenic views along the trail. The hardest piece of data for you to gather is the difference in elevation between the start of the trail and the end of the trail. You and your team use surveying equipment to calculate the slope and distance (along the trail) of each section of the trail. For example, a trail may begin completely flat for 500 meters, then switch to an 8 incline for 1000 meters, and then switch to a 2 decline for the final 500 meters. With so many new trails opening, manually calculating the elevation difference from the section descriptions has become too tedious. So, you ve decided to write a program to make the process easier. Input Input begins with a positive integer n 100 indicating the number of trail sections. The following n lines describe the trail sections from the beginning to the end of the trail. Each trail section is described by two integers a d ( 50 a 50, 1 d 10000) indicating its angle of elevation in degrees and the distance in meters along that section of the trail, respectively. Output Display the difference in elevation between the start of the trail and the end of the trail in meters. The difference in elevation will always be greater than 0 meters. Round answers to the hundredths place. Always print answers to two decimal places and include the leading 0 on answers between 0 and 1. Sample Input 1 Sample Output 1 3 0 500 8 1000-2 500 121.72 Sample Input 2 Sample Output 2 3 12 1000-11 1200 5 250 0.73 ECNA 2016 Problem B: Happy Trails 3

Sample Input 3 Sample Output 3 2-7 2000 9 4000 382.00 ECNA 2016 Problem B: Happy Trails 4

Problem C Prime Driving Conditions Meredith has just bought a new car and needs license plates. In Pennsylvania, license plates consist of three uppercase letters followed by four digits. License plates are given out in lexicographic order, meaning that plate AAA 0000 is first, followed by AAA 0001, AAA 0002, etc,. After AAA 9999 comes plates AAB 0000, AAB 0001, etc., and after plate AZZ 9999 comes plate BAA 0000. The very last plate is ZZZ 9999. For most people, any old license plate will do, but not for Meredith. She insists that the 4 digit number on the plate must be a prime number. Recall that a prime number is a number > 1 whose only factors are 1 and the number itself. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23,... So if Meredith goes to the DMV to get a set of plates, and the next available plate is JPB 1285, she ll wait until plate JPB 1289 becomes available, since 1289 is the first prime greater than or equal to 1285. If the next available plate had been JPB 9999, she would have waited for the plate JPC 0002. Perhaps you see what we re driving at here. Starting at a given license plate, find the first plate lexicographically equal or greater that contains a prime number. As a side note, this past January the largest prime number known to date was discovered. It is equal to 2 74,207,281 1 and contains 22,338,618 digits. A little too large to fit on a license plate. Input The input file contains multiple test cases. Each test case is on a single line and contains a three character string followed by a 4 digit number. The three character string consists solely of uppercase letters other than the string ZZZ". A line containing END 0000 terminates input. Output For each test case, display the license plate Meredith will accept. Sample Input 1 Sample Output 1 JPB 1285 JPB 9999 END 0000 JPB 1289 JPC 0002 ECNA 2016 Problem C: Prime Driving Conditions 5

This page is intentionally left blank.

Problem D Time is of the Essence Do you know how long one million seconds is? How about one billion seconds? Well, the answer to the first one is 11 days, 13 hours, 46 minutes and 40 seconds Accurate, but a little over-precise. A more reasonable answer might be 11 days, 14 hours" or just 12 days" (after rounding). As another example, if I asked how long three million inches were, you could approximate it by saying either 47 miles" or 47 miles, 613 yards". This sort of imprecision is what we re looking for in this problem! Input Input consists of two lines. The first line has the form n name 1 c 1 name 2 c 2... name n 1 c n 1 name n Each name i is a unit of measurement and each c i is a conversion rate, telling you how many units of type name i+1 are in a unit of type name i. For example, in the first sample input, this line tells you that there are 24 hours in one day, 60 minutes in each hour and 60 seconds in each minute. The value n indicates the total number of unit names and satisfies 2 n 10. All names are alphabetic strings with no blanks and always specify the plural form of the unit (which you should use for output no matter the value is associated with the unit). All conversion values are positive integers. Following this line is a single positive integer m 2, 000, 000, 000 indicating an amount of the last unit (i.e., name n ). Output Display two lines. The first line should give the closest conversion of the input amount to units specified by name 1, rounded to the nearest integer. The second line should do the same, but be a bit more precise using the two largest units name 1 and name 2. When rounding, always round up when the fraction is 0.5. Note that there are no commas in the output. Sample Input 1 Sample Output 1 4 days 24 hours 60 minutes 60 seconds 1000000 12 days 11 days 14 hours Sample Input 2 5 years 365 days 24 hours 60 minutes 60 seconds 1000000000 ECNA 2016 Problem D: Time is of the Essence 7

Sample Output 2 32 years 31 years 259 days Sample Input 3 Sample Output 3 2 feet 12 inches 11 1 feet 0 feet 11 inches Sample Input 4 4 jiffys 2 lambtailshakes 11 flashes 3 twinklings 20902 Sample Output 4 317 jiffys 316 jiffys 1 lambtailshakes ECNA 2016 Problem D: Time is of the Essence 8