Reactive and Output-Only HKOI Training Team 2006 Liu Chi Man (cx) 11 Feb 2006.

Slides:



Advertisements
Similar presentations
Introduction to Programming
Advertisements

MATH 224 – Discrete Mathematics
Advanced Programming 15 Feb The “OI” Programming Process Reading the problem statement Thinking Coding + Compiling Testing + Debugging Finalizing.
Markov Decision Process
Contest format 5 hours, around 8-12 problems One computer running (likely)Linux, plus printer 3 people on one machine No cell phones, calculators, USB.
Order Statistics Sorted
Chapter 2: Problem Solving
Programming in Visual Basic
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
CS 300 – Lecture 20 Intro to Computer Architecture / Assembly Language Caches.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
CSE1301 Computer Programming: Lecture 29 Group Project: “Quabble”
CHAPTER 10 Recursion. 2 Recursive Thinking Recursion is a programming technique in which a method can call itself to solve a problem A recursive definition.
Introduction to Programming (in C++) Introduction Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC.
Group practice in problem design and problem solving
Lecture 15 Practice & exploration Subfunctions: Functions within functions “Guessing Game”: A hands-on exercise in evolutionary design © 2007 Daniel Valentine.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
1 Software John Sum Institute of Technology Management National Chung Hsing University.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Game Playing.
COP1220/CGS2423 Introduction to C++/ C for Engineers Professor: Dr. Miguel Alonso Jr. Fall 2008.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Fundamentals of Algorithms MCS - 2 Lecture # 1
My talk describes how the detailed error diagnosis and the automatic solution procedure of problem solving environment T-algebra can be used for automatic.
1 ECE-517 Reinforcement Learning in Artificial Intelligence Lecture 7: Finite Horizon MDPs, Dynamic Programming Dr. Itamar Arel College of Engineering.
Introduction to Algorithms By Mr. Venkatadri. M. Two Phases of Programming A typical programming task can be divided into two phases: Problem solving.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
1 Program Planning and Design Important stages before actual program is written.
UFCEKS-20-2Multimedia Authoring Times Table Quiz.
HKOI 2005 Training Introduction to Algorithms Alan, Tam Siu Lung.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
Program Design. The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop.
Newton’s Method, Root Finding with MATLAB and Excel
Algorithms Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006 by Maria Litvin, Gary Litvin,
Scientific Debugging. Errors in Software Errors are unexpected behaviors or outputs in programs As long as software is developed by humans, it will contain.
HKOI Programming HKOI Training Team (Intermediate) Alan, Tam Siu Lung Unu, Tse Chi Yung.
Liu Chi Man Saturday, January 22, 2005 HKOI 2005 Training New Problem Types: Interactive and Open Test Data.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
Efficiently Solving Computer Programming Problems Doncho Minkov Telerik Corporation Technical Trainer.
HKOI 2012 (Senior) Q4 - Gene Mutation Gary Wong For any question, please ask via MSN:
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Introduction  Program: Set of sequence instruction that tell the computer what to do.  Software: A collection of programs, data, and information. 
A Heuristic Hillclimbing Algorithm for Mastermind Alexandre Temporel and Tim Kovacs.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
1 The Role of Algorithms in Computing. 2 Computational problems A computational problem specifies an input-output relationship  What does the.
Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
Topic 2: Hardware and Software
Introduction to Algorithms
Programming and File Management Part 2
Introduction
IGCSE 6 Cambridge Effectiveness of algorithms Computer Science
Course: Introduction to Computers
C ODEBREAKER Class discussion.
Cracking the Coding Interview
Software John Sum Institute of Technology Management
Programming.
Introduction to Algorithms
Software Development Process
Basic Concepts of Algorithm
The while Looping Structure
Software Development Techniques
Presentation transcript:

Reactive and Output-Only HKOI Training Team 2006 Liu Chi Man (cx) 11 Feb 2006

2 HKOI Training Team 2006 Outline Reactive tasks (a.k.a. interactive tasks) Output-only tasks (a.k.a. open test data tasks) Scoring methods

3 HKOI Training Team 2006 Traditional tasks Read input, write output Static input Problem: Add Two Numbers Input: Two integers per line Output: For each input line, add the two integers and output the sum on one line

4 HKOI Training Team 2006 Add Two Numbers Algorithm One while not end of input do read integers from input write sum to output Algorithm Two read all integers into an array compute all sums write all sums to output

5 HKOI Training Team 2006 Interactivity Problem: Guess The Number My lucky number is an integer between 1 and N Guess until you get the correct answer After each guess I will tell you whether your guess is too big or too small or correct

6 HKOI Training Team 2006 Interaction via provided libraries Function calls Examples: N := GetN(); / N = GetN(); MakeGuess(7); Task description contains sufficient instructions Using a library Pascal: uses mylib; C/C++: #include "mylib.h"

7 HKOI Training Team 2006 Interaction via standard I/O I/O method same as traditional tasks IMPORTANT Make sure you read and write in the correct order specified in the task description

8 HKOI Training Team 2006 Nature of reactive tasks Black-box testing Two-person games Updates and queries

9 HKOI Training Team 2006 Black-box testing Use queries to reveal hidden information Examples include Guess The Number Mastermind

10 HKOI Training Team 2006 Two-person games Write a program to play a game against the judging program Examples include Tic-tac-toe Nim (match-picking)

11 HKOI Training Team 2006 Updates and queries Processing of a set of data “Update” command Modify the set of data “Query” command Ask for some information about the data A Query must be answered before next command is revealed

12 HKOI Training Team 2006 Strategies Black-box testing Bisection, trisection, etc. Two-person games Minimax method (dynamic programming speed up) Updates and queries More advanced data structures, e.g. disjoint sets

13 HKOI Training Team 2006 Output-only tasks All input test cases are given to you You are required to submit corresponding output files for these inputs No source code, executable required Usually optimal (best) answers are very difficult to obtain Partial scoring

14 HKOI Training Team 2006 Nature of output-only tasks “Hard” problems Optimal solutions not likely to be found within minutes For the precise definition of “hardness”, look forward to “[Talk] Introduction to Complexity Theory” “Semi-manual” problems Some of the test cases designed for you to solve by hand or wicked methods

15 HKOI Training Team 2006 Strategies Manual inspection of all test cases Make sure you don’t miss those easy inputs Go for suboptimal solutions Greedy, heuristics, random, etc. Fully utilize your resources Hours of CPU time Plentiful memory Other tools (calc, sort, factor, bc, graphics software, games, etc.)

16 HKOI Training Team 2006 Effort vs. Score Effort Score

17 HKOI Training Team Task = 10 Tasks! Sometimes test cases are designed so that each one has some special properties Different properties may lead to different solving methods 1 task, T programs T is the number of test cases

18 HKOI Training Team 2006 Conclusion 1 to 2 per competition (6 tasks in total) Reactive tasks are more popular than output- only tasks In general, it is easier to score high marks in reactive tasks than output-only tasks

19 HKOI Training Team 2006 Frequencies ReactOutputReactOutput IOI’0010NOI’0000 IOI’0131NOI’0100 IOI’0211NOI’0211 IOI’0321NOI’0311 IOI’0400NOI’0411 IOI’0510NOI’0501

20 HKOI Training Team 2006 Scoring methods How are marks given for each test case? All-or-nothing Correct – full; incorrect – zero Partial You may get something between full and zero

21 HKOI Training Team 2006 Partial scoring Multiple parts Example: If you get the first integer wrong, you get 0%; if you get the first integer correct, you get 30%; if you get both integers correct, you get 100% Suboptimal award Example (maximization): Let A be the optimal answer and B be your answer; your score is (B/A)  100%

22 HKOI Training Team 2006 Partial scoring Number of queries (Reactive: black-box testing) Fewer queries, higher score Usually an explicit formula for score calculation is given Some of the variables in the formula may be unknown to you, however “Your answer is compared to our answer” Our refers to the judges

23 HKOI Training Team 2006 Relative scoring Your answer is compared to the best answer among all contestants If nobody else attempts that task, you win