Croatian Open Competition in Informatics, contest 3 December 8, 2007

Similar documents
Cyber Security Workshop Encryption Reference Manual

Third Southern African Regional ACM Collegiate Programming Competition. Sponsored by IBM. Problem Set

Computer Architecture. Secure communication and encryption.

Memory Systems. Static Random Access Memory (SRAM) Cell

Chapter 2: Basics on computers and digital information coding. A.A Information Technology and Arts Organizations

DRAFT. New York State Testing Program Grade 8 Common Core Mathematics Test. Released Questions with Annotations

Chapter 2: Elements of Java

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur

Content. Chapter 4 Functions Basic concepts on real functions 62. Credits 11

Eventia Log Parsing Editor 1.0 Administration Guide

CHOOSING A COLLEGE. Teacher s Guide Getting Started. Nathan N. Alexander Charlotte, NC

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

HP Service Virtualization

ACM International Collegiate Programming Contest 2009

Preparing the Windows version of the software for use

Remote Access Server - Dial-Out User s Guide

VDF Query User Manual

A PPENDIX G S IMPLIFIED DES

Sybase Adaptive Server Enterprise

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015

Factoring Algorithms

How To Manage Your Storage In Outlook On A Pc Or Macintosh Outlook On Pc Or Pc Or Ipa On A Macintosh Or Ipad On A Computer Or Ipo On A Laptop Or Ipod On A Desktop Or Ipoo On A

Microsoft Access 3: Understanding and Creating Queries

Database Applications Microsoft Access

Time Clock Import Setup & Use

STAT10020: Exploratory Data Analysis

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

Section 1.1. Introduction to R n

DATA ANALYSIS II. Matrix Algorithms

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

Compsci 101: Test 1. October 2, 2013

Chapter 2 Data Storage

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Major Work of the Grade

MEP Y9 Practice Book A

Session 8 Probability

College of the Holy Cross CCSCNE 06 Programming Contest Problems

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Acing Math (One Deck At A Time!): A Collection of Math Games. Table of Contents

Developing and Investigation of a New Technique Combining Message Authentication and Encryption

SAS Data Set Encryption Options

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

A Dynamic Programming Approach for Generating N-ary Reflected Gray Code List

18.06 Problem Set 4 Solution Due Wednesday, 11 March 2009 at 4 pm in Total: 175 points.

Eliac Call Recording - Configurator Guide. Eliac. Call Recording System Ver. 2.x.

Math 215 HW #6 Solutions

Computing Concepts with Java Essentials

Computer Networks. Network Security 1. Professor Richard Harris School of Engineering and Advanced Technology

Optimal Scheduling for Dependent Details Processing Using MS Excel Solver

Efficient Recovery of Secrets

ENGI E1112 Departmental Project Report: Computer Science/Computer Engineering

Microsoft Excel Tips & Tricks

Extra Credit Assignment Lesson plan. The following assignment is optional and can be completed to receive up to 5 points on a previously taken exam.

Engineering Problem Solving and Excel. EGN 1006 Introduction to Engineering

Improved Single and Multiple Approximate String Matching

Computer Science 217

INTEGRATING MICROSOFT DYNAMICS CRM WITH SIMEGO DS3

FARHAT GUITAR CHORD FONTS User's Manual (English)

AccXES Account Management Tool Administrator s Guide Version 10.0

Section 1.4. Lines, Planes, and Hyperplanes. The Calculus of Functions of Several Variables

Detailed information about Gerber, NC Drill and NC Route.

Report Paper: MatLab/Database Connectivity

Overview/Questions. What is Cryptography? The Caesar Shift Cipher. CS101 Lecture 21: Overview of Cryptography

Microsoft Office Outlook 2013: Part 1

YOU CAN COUNT ON NUMBER LINES

TheGreenBow CryptoMailer. User Guide. Contact: Website:

A Second Course in Mathematics Concepts for Elementary Teachers: Theory, Problems, and Solutions

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

Algebra and Geometry Review (61 topics, no due date)

Metadata Import Plugin User manual

VIDEO SCRIPT: Data Management

Ciphermail Gateway PDF Encryption Setup Guide

Gentran Integration Suite. Archiving and Purging. Version 4.2

SAS Software to Fit the Generalized Linear Model

Binary Diagnostic Tests Two Independent Samples

Recall that two vectors in are perpendicular or orthogonal provided that their dot

Computer Science PLUS I Volume 1 : Concepts Government of Tamilnadu

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python

SIF Validation Tool. Wages Protection System Qatar Central Bank& Ministry of Labour And Social Affairs. End User Guide

Database Management Systems Comparative Study: Performances of Microsoft SQL Server Versus Oracle

Encoding Text with a Small Alphabet

FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY

APPENDIX B: FEMA 452: Risk Assessment Database V5.0. User Guide

Obj: Sec 1.0, to describe the relationship between hardware and software HW: Read p.2 9. Do Now: Name 3 parts of the computer.

Avery Dennison UK Consumer Helpline: Consumer

All ju The State of Software Development Today: A Parallel View. June 2012

BRIEF INTRODUCTION TO CRYPTOGRAPHY. By PAGVAC. February 8, 2004

FREE VOICE CALLING IN WIFI CAMPUS NETWORK USING ANDROID

Welcome to Math 7 Accelerated Courses (Preparation for Algebra in 8 th grade)

Commonly Used Excel Formulas

New Hash Function Construction for Textual and Geometric Data Retrieval

AP CALCULUS AB 2009 SCORING GUIDELINES

Business Objects Version 5 : Introduction

Orthogonal Projections

J a v a Quiz (Unit 3, Test 0 Practice)

Record counting on method using the empty number line Q What are the four related number sentences for this calculation?

10 Thomas, Irvine, CA USA Tel: (949) Fax: (949) Toll Free: (800) 23 FUTEK

STATISTICS AND DATA ANALYSIS IN GEOLOGY, 3rd ed. Clarificationof zonationprocedure described onpp

Transcription:

Tasks Task CETIRI OKTALNI TAJNA DEJAVU CUDAK REDOKS Memory limit (heap+stack) Time limit (per test) standard (keyboard) standard (screen) 32 MB 64 MB 1 second 3 seconds Number of tests 5 5 8 10 10 10 Points per test 4 4 5 5 8 9 Total points 20 20 40 50 80 90 300 Note: The evaluation system has two Intel Pentium 4 3.0 GHz processors and is running the Linux operating system. The following compile options are used for different languages: C: O2 s static std=c99 lm C++: O2 s static lm Pascal: O1 XS

1. CETIRI Mirko has chosen four integers which form an arithmetic progression. In other words, when the four numbers are sorted, then the difference between each pair of adjacent elements is constant. As has become usual, Mirko lost one of the numbers and also is not sure whether the remaining three are in the correct (sorted) order. Write a program that, given the three remaining numbers, finds the fourth number. The contains 3 integers between 100 and 100 on a single line, separated by single spaces. Note: the data will guarantee that a solution, although not necessarily unique, will always exist. any number which could have been the fourth number in the sequence. 4 6 8 10 10 1 4 7

2. OKTALNI Slavko is learning about different numeral systems. Slavko is not the brightest when it comes to math, so he is starting out converting binary numerals to octal. The algorithm Slavko uses is this: Pad the binary numeral with zeros on the left until the number of digits is divisible by three. Group adjacent binary digits into groups of 3 digits. Replace each group of binary digits with the corresponding octal digit (as in the table on the right). Write a program that converts a binary numeral to octal so that Slavko can verify his results. 000 0 001 1 010 2 01 100 4 101 5 110 6 111 7 The contains a binary numeral. The number of digits will be less than 100, and the first digit will be 1. the number in octal. 1010 12 11001100 314

3. TAJNA Every evening, little Ivica sends secret messages to little Marica through e-mail. Knowing Ivica's e-letter travels unguarded through the network on its way to Marica's e-mailbox, they have decided to encrypt every message using the following algorithm: Suppose Ivica's message consists of N characters. Ivica must first find a matrix consisting of R rows and C columns such that R C and R C = N. If there is more than one such matrix, Ivica chooses the one with the most rows. Ivica writes his message into the matrix in row-major order. In other words, he writes the first segment of the message into the first row, the second segment into the second row and so on. The message he sends to Marica is the matrix read in column-major order. Marica has grown tired of spending her precious time deciphering Ivica's messages, so you must write a program to do it for her. The contains the received message, a string of lowercase letters of the English alphabet (with no spaces). The number of letters will be between 1 and 100. the original (decrypted) message. bok bok koaski kakosi boudonuimilcbsai bombonisuuladici Third sample test: Ivica wants to send the message "bombonisuuladici" containing 16 letters. He can use a 1 16, 2 8 or 4 4 matrix. Of these, the 4 4 has the most rows. When the message is written into it, the matrix looks like this: b o m b o n i s u u l a d i c i

4. DEJAVU N points are placed in the coordinate plane. Write a program that calculates how many ways we can choose three points so that they form a right triangle with legs parallel to the coordinate axes. A right triangle has one 90-degree internal angle. The legs of a right triangle are its two shorter sides. The first line of contains the integer N (3 N 100 000), the number of points. Each of the following N lines contains two integers X and Y (1 X, Y 100 000), the coordinates of one point. No pair of points will share the same pair of coordinates. the number of triangles. In 40% of all test cases, N will be less than 100. In 70% of all test cases, N will be less than 10 000. Scoring 3 4 2 2 1 0 5 1 2 2 1 2 2 2 3 3 2 4 6 10 10 20 10 10 20 20 20 30 20 30 30 8

5. CUDAK Božo is a strange little boy. Every day he tires his friends with strange questions. Today's question is: how many integers in the interval [A, B] are there such that the sum of their digits is S, and which is the smallest such number? Write a program that answers Božo's question so that he can get some sleep. The contains three integers A, B and S (1 A B < 10 15, 1 S 135). The first line should contain the number of integers in the interval with the digit sum equal to S. The second line should contain the smallest such integer. The data will guarantee that the first number is at least 1. Scoring For correctly ting one of the two numbers you will receive 50% of the score. Note: if you want to receive credit for just the second number, be sure to something (0, for example) as the first number so the judge can interpret your correctly. 1 9 5 1 5 1 100 10 9 19 11111 99999 24 5445 11499

6. REDOKS Luka is not paying attention in class again, while the teacher is explaining redox reactions. Instead of paying attention, he is playing with analog dials. An analog dial is a small device which always shows one digit between 0 and 9. It also contains a small button which increases the number by 1 (unless it is 9, in which case it is changed to 0). Luka has N such dials on his desk, numbered 1 to N left to right, and two sheets of paper for him to write on. Luka's game starts with him setting the dials in some starting configuration, which he then writes onto the first sheet. Luka then does the following M times: Choose two integers A and B (1 A B N) and write them down on the first sheet. Calculate the sum of numbers on dials numbered between A and B (inclusive), and write the sum down on the second sheet. Press the button once on all dials numbered between A and B. Just as he had finished his game, the teacher noticed him, and took away all his dials and the second sheet of paper. Given the contents of the first sheet, help him calculate the numbers on the second sheet. The first line contains two integers N and M (1 N 250 000, 1 M 100 000). The second line contains the initial configuration of the dials, N decimal digits with no spaces. The first digit is the number initially on dial 1, the second digit the number on dial 2 and so on. Each of the following M lines contains two integers A and B (1 A B N). M lines, the sums calculated by Luka, in order in which he calculated them. Scoring In 30% of all test cases, the numbers N and M will be less than 1000.

6. REDOKS 4 3 1234 1 4 1 4 1 4 10 14 18 4 4 1234 1 1 1 2 1 4 1 4 9 16 7 5 9081337 3 7 3 7 17 23 1 19 5