South African Computer Olympiad Web Training, 2009 IOI Squad May Contest. Overview. Schalk- Willem. Problem tile destroy jelly tiles

Similar documents
South African Computer Olympiad Web Training, 2009 IOI Squad March Contest. Overview. Michiel Baird. Problem bnumbers hotdates connect wifitow

South African Computer Olympiad Final Round Day 2. Overview. Carruthers- Smith Problem parrots seen search. seen.java seen.py seen.c seen.cpp seen.

SOLUTIONS FOR PROBLEM SET 4

Solutions for the Practice Questions

Downloaded from

2005 Galois Contest Wednesday, April 20, 2005

I.M.O. Winter Training Camp 2008: Invariants and Monovariants

Basic Mathematics Review 5232

Downloaded from

PRIMES STEP Plays Games

TILLING A DEFICIENT RECTANGLE WITH T-TETROMINOES. 1. Introduction

Solutions of problems for grade R5

BRITISH COLUMBIA SECONDARY SCHOOL MATHEMATICS CONTEST, 2006 Senior Preliminary Round Problems & Solutions

Western Australian Junior Mathematics Olympiad 2007

1-4. a: 40 b: 6 c: 7 d: a: 3 b: 5 c: 6 d: 2

On Variations of Nim and Chomp

Mathematical Olympiad for Girls

Tilings with T and Skew Tetrominoes

MUMS seminar 24 October 2008

Warm-Up A palindrome is a number that reads the same forward as backward. How many 3-digit palindromes are multiples of 3?

Unit 5 Shape and space

Math 127: Equivalence Relations

1. Completing Sequences

TEKSING TOWARD STAAR MATHEMATICS GRADE 6. Student Book

lines of weakness building for the future All of these walls have a b c d Where are these lines?

junior Division Competition Paper

Twenty-fourth Annual UNC Math Contest Final Round Solutions Jan 2016 [(3!)!] 4

Part A (C) What is the remainder when is divided by 11? (A) 0 (B) 1 (C) 3 (D) 7 (E) 10 (A) 35 (B) 40 (C) 45 (D) 50 (E) 55

A u s t r a l i a n Ma t h e m a t i c s Co m p e t i t i o n

One Way Draw a model. Another Way Use division. Lesson q w 3 2

Mathematics Test A 3 5 TEST. Calculator not allowed. Name. Date YEAR LEVELS. Total marks

Student Exploration: Standard Form of a Line

Class VI Mathematics (Ex. 13.1) Questions

7. Three friends each order a large

Overview. Equipment. Setup. A Single Turn. Drawing a Domino

TOPOLOGY, LIMITS OF COMPLEX NUMBERS. Contents 1. Topology and limits of complex numbers 1

Aesthetically Pleasing Azulejo Patterns

HIGH SCHOOL - PROBLEMS

Carmen s Core Concepts (Math 135)

Paper 1. Calculator not allowed. Mathematics test. Remember. First name. Last name. School YEAR 7 LEVELS 3 4

ALGEBRA: Chapter I: QUESTION BANK

Southeastern European Regional Programming Contest Bucharest, Romania Vinnytsya, Ukraine October 21, Problem A Concerts

Year 10 Team Mathematics Competition 2013

Techniques for Generating Sudoku Instances

TILING RECTANGLES AND HALF STRIPS WITH CONGRUENT POLYOMINOES. Michael Reid. Brown University. February 23, 1996

learning about tangram shapes

Frilly Jelly Bag. Bag Dimensions are 12 inches wide x 15 inches high (to base of handle), and 4 ½ inches deep.

Team Name: 1. Remember that a palindrome is a number (or word) that reads the same backwards and forwards. For example, 353 and 2112 are palindromes.

MATHEMATICS LEVEL: (B - Γ Λυκείου)

UK Junior Mathematical Challenge

TROMPING GAMES: TILING WITH TROMINOES. Saúl A. Blanco 1 Department of Mathematics, Cornell University, Ithaca, NY 14853, USA

CS2205 Theory of Computation

Colouring tiles. Paul Hunter. June 2010

2012 UPPER PRIMARY PRELIMINARY ROUND PAPER Time allowed:75 minutes INSTRUCTION AND INFORMATION

ON OPTIMAL PLAY IN THE GAME OF HEX. Garikai Campbell 1 Department of Mathematics and Statistics, Swarthmore College, Swarthmore, PA 19081, USA

SA-II Model Exam - II

TASK BELA PUTOVANJE PIANINO PAROVI KRUMPIRKO SAN. standard input (stdin) standard output (stdout)

Georgia Tech HSMC 2010

French-Australian Regional Informatics Olympiad 11th March, 2011

LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE

Chapter 5 Review/Test

The 2016 ACM-ICPC Asia China-Final Contest Problems

UK JUNIOR MATHEMATICAL CHALLENGE. April 26th 2012

State Math Contest (Junior)

Characterization of Domino Tilings of. Squares with Prescribed Number of. Nonoverlapping 2 2 Squares. Evangelos Kranakis y.

Grade 4 Mathematics Item Specification C1 TL

C.2 Equations and Graphs of Conic Sections

IMOK Maclaurin Paper 2014

UK JUNIOR MATHEMATICAL CHALLENGE May 6th 2011

Some Fine Combinatorics

Addition and Subtraction

Grade 3 Geometry Rectangle Dimensions

Downloaded from

Lesson 2: Using the Number Line to Model the Addition of Integers

arxiv: v2 [cs.cc] 29 Dec 2017

Page 3 of 26 Copyright 2014 by The McGraw-Hill Companies, Inc.

Wilson s Theorem and Fermat s Theorem

1.6 Congruence Modulo m

The 2009 British Informatics Olympiad

Math 255 Spring 2017 Solving x 2 a (mod n)

Paper 1. Mathematics test. Calculator not allowed. satspapers.org. First name. Last name. School KEY STAGE TIER

Grade 4 Math Unit 6: GEOMETRY. Standards Report. Student Name:

25 C3. Rachel gave half of her money to Howard. Then Howard gave a third of all his money to Rachel. They each ended up with the same amount of money.

Q i e v e 1 N,Q 5000

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography

Mathematics Enhancement Programme TEACHING SUPPORT: Year 3

UTD Programming Contest for High School Students April 1st, 2017

6.042/18.062J Mathematics for Computer Science December 17, 2008 Tom Leighton and Marten van Dijk. Final Exam

A C E. Answers Investigation 1. Applications. b. No; 6 18 = b. n = 12 c. n = 12 d. n = 20 e. n = 3

Problem Set 7: Games Spring 2018

Unit 11: Linear Equations and Inequalities

Grade 6 Math Circles March 8-9, Modular Arithmetic

Applications of Fermat s Little Theorem and Congruences

ABOUT THE GAME COMPONENTS

Sets. Gazihan Alankuş (Based on original slides by Brahim Hnich et al.) August 6, Outline Sets Equality Subset Empty Set Cardinality Power Set

UNIT 6 Nets and Surface Area Activities

Canadian Math Kangaroo Contest

Pascal Contest (Grade 9) Wednesday, February 23, 2005

Two congruences involving 4-cores

Elementary School Answer Key

Transcription:

Overview Author(s) Francois Conradie Schalk- Willem Krüger Graham Manuell Charl du Plessis Problem tile destroy jelly tiles Source tile.c tile.cpp destroy.c destroy.cpp jelly.c jelly.cpp tiles.c tiles.cpp Input file stdin stdin stdin stdin Output file stdout stdout stdout stdout 1 second 1 second 1 second 1 second Number of tests 10 10 10 10 Points per test 10 10 10 10 Detailed feedback No Yes No No Total points 100 100 100 100 The maximum total score is 400 points. https://olympiad.cs.uct.ac.za/contests/web-2009/

Introduction Tiling Mall Francois Conradie A new mall is being constructed in Cape Town. The mall is nearly complete and all that is left to do is to tile the main corridor with 2 1 tiles. Mr. Creosote, the owner of the mall, is a workaholic lacking some common sense and insists on seeing every possible tiling of the main corridor. Hendrik, one of the smarter employees, immediately realized that this would be impossible there are simply too many possibilities. Mr. Creosote, however, demands proof of this. Hendrik has asked you to help him determine in how many different ways you can tile the corridor. Given an infinite number of 2 1 tiles, your task is to help Hendrik determine in how many different ways you can tile a 4 N corridor using only these tiles. If you have a 4 2 corridor then there are 5 different ways of laying the tiles as illustrated in Figure 1. The first and only line contains a single integer N. 2 Output the remainder when the total number of configurations is divided by 1 000 007. 6 1 N 5 000 000 Additionally, in 50% of the test cases: 1 N 15 A correct solution will score 100% while an incorrect solution will score 0%. Figure 1: All possible tilings of a 4 2 corridor.

Introduction South African Computer Olympiad Destroy the connection Schalk-Willem Krüger A while ago Bruce and Carl commissioned you to test their proposed copy protection system of their software company called Good and Evil Tech. However, they fired you, because you couldn t solve the Travelling Salesman Problem in constant time. You are very furious and want to take revenge by breaking the communication between their computers and all the servers of the company. Bruce and Carl have several computers that may or may not be on the same network as all the central servers. The network consists of many computers with wires linking some pairs of those computers. There will be at most one wire in each direction between each pair of computers and there can be pairs of computers without a wire between them. You can destroy computers and wires, but you cannot destroy Bruce or Carl s computers or their servers as Bruce made them indestructable. You have estimated the cost of blowing up each computer and the cost of cutting each wire in the network. You want to determine the minimum cost of interrupting the communication between Bruce and Carl s computers and all the servers. Suppose there are 4 computers in the network. The first computer belongs to Bruce and is connected with wires of cutting cost 3 to the second and third computers. Computer two and three have costs of 1 and 5 to destroy respectively and are connected to the server (computer four) with wires of cost 2 and 4 respectively. The minimum cost to disconnect Bruce s computer from the server is 4: destroy computer two (cost 1) and the wire connecting the first and third computer (cost 3). The first line of input contains two space-separated integers: M and W, representing the number of com- Figure 2: An image illustrating the sample input. puters (including Bruce and Carl s computers and the servers) and the number of wires in the network respectively. The second line contains two space-separated integers: T and S, representing the number of computers owned by Bruce and Carl and the number of servers. The next M T S lines contain the cost of blowing up computer B + 1 to computer T 1. The first T computers belong to Bruce and Carl and the last M computers are the servers. Bruce and Carl s computers and the servers cannot be destroyed and their costs are thus not given. Each line contains a single integer: the cost, C i, of destroying computer i and with i going from B + 1 up to T 1. The last W lines each contain three space-separated integers, X i, Y i and D i, indicating that the wire that connects computer X i to computer Y i costs D i. Each pair of computers can have at most two wires (one in each direction). 4 4 1 1 1 5 1 2 3 1 3 3 2 4 2 3 4 4 Output a single integer: the minimum cost of interrupting the communication between the computers of Bruce and Carl and all the servers.

4 2 M 400 0 W 70 000 1 T M 1 1 S M 1 T < i < M S 0 C i, D i 100 000 C i <> D i 1 X i, Y i M Additionally, in 30% of the test cases: 2 M 60 0 W 4 000 Detailed feedback Detailed feedback is enabled for this problem. A correct solution will score 100% while an incorrect solution will score 0%. n

Introduction Jelly Tots Graham Manuell It is Bruce s mother s birthday, but with Bruce having spent all his money on world peace, he does not have any left to buy her a present, so he has decided to make one. He plans to stack coloured jelly tots into a plastic tube in an interesting design. He carefully divides the jelly tots into piles of different colours. Before long he finds himself thinking about how many patterns he could possibly create. He notes that because the tube is symmetrical, one design and its reverse should only be counted once. In order to find the solution he uses Burnside s lemma to show that the answer is the average of the total number of designs and the palindromic designs. Bruce easily comes up with the final answer, but alas, while his mind was drifting, he left the jelly tots in the sun and some of them have fused together. The jelly tots are now all in segments of 2 or 3. Each segment is made up of jelly tots of only one colour. Help Bruce find the new number of possible designs (with and without considering symmetry) if the tube can hold N single jelly tots and he has an infinite supply of segments in C different colours. He only cares about the colour of the design, so even if he uses different combinations of segments for two arrangements, if the jelly tots in corresponding positions have the same colour, the arrangements are the same. Because there are potentially very many designs, you should give the answers modulo 100 000 007. The input consists of a single line containing two spaceseparated integers, N and C. 6 2 Output two space-separated integers, the number of designs modulo 100 000 007 not considering and then considering symmetry. 10 7 1 N 10 000 000 1 C 10 Additionally, in 30% of the test cases: 1 N 15 1 C 4 A completely correct solution will score 100%. If only the number of designs without considering symmetry is correct 50% will be awarded, otherwise the solution will score 0%. If Bruce has two colours of jelly tots, red (R) and blue (B), he can make 10 different designs of length 6: RRRRRR, RRRRBB, RRRBBB, RRBBRR, RRBBBB, BBRRRR, BBRRBB, BBBRRR, BBBBRR, BBBBBB. Note that adding 2 red 3-jelly-tot segments and adding 3 red 2- jelly-tot segments would look that same and hence count as the same design. Out of these RRRRRR, RRBBRR, BBRRBB, BBBBBB are palindromic, so when considering symmetry the answer is (10 + 4)/2 = 7, which can be seen to be correct.

Introduction Tiles Charl du Plessis Fred, the manic storekeeper, wants to re-tile his store. His store is an N (vertical) by M (horizontal) rectangle which will be covered by 1 by N tiles. He wants to tile the store such that the number of vertically placed tiles is equal to the number of horizontally placed tiles. Unfortunately, Fred has already started placing some of the tiles which we will term pre-tiles they cannot be taken away or moved. Given N and M and the positions of the pre-tiles, output the number of ways to tile the remainder of the rectangle such that in the entire N by M rectangle the number of vertical tiles equals the number of horizontal tiles. Let us number the blocks of the length of the rectangle. 1, 2,, M. The position of a vertical pre-tile will be given by a number from 1 to M and the start (first block) of a horizontal pre-tile will also be given by a number from 1 to M. Furthermore, every N by 20 rectangle will contain at least one pre-tiled block. But since the number of ways to tile the store could get very large, output it modulo 1000000. 4 16 2 2 1 2 4 4 A single integer: the number of ways that the store can be tiled satisfying the conditions, K, modulo 1000000. 6 2 N 10 1 M 150 Additionally, in 50% of the test cases: K 1000000 A correct solution will score 100% while an incorrect solution will score 0%. Suppose N = 4 and M = 16. With vertical pre-tiles at 1 and 2; and 2 horizontal pre-tiles at 4. Then there exist 6 ways to tile the rectangle satisfying the conditions. The first line will contain the space-seperated integers N and M. The next line will contain space-seperated integers V (number of vertical pre-tiles) and H (number of horizontal pre-tiles). The next V lines will each contain a single integer showing the position of a vertical pre-tile. The next H lines will contain a single integer showing the position of a horizontal pre-tile.