CS PSP

Classify problems

Team strategy

ACM International Collegiate Programming Contest — Training Session III C. Maria Keet Department of Computer Science, University of Cape Town, South Africa [email protected]

August 30, 2014

1 / 21

CS PSP

Classify problems

Team strategy

Outline

1

CS PSP

2

Classify problems

3

Team strategy

2 / 21

CS PSP

Classify problems

Team strategy

Today

Identifying a CS ‘problem-solving paradigm’ from the description Look at a whole set of problems of a regional contest: categorise the problems find strategy: which problem to tackle first, by whom, why?

If you don’t finish a problem, try at home and make sure you’ve implemented it, can submit to the ICPC and UVa sites anytime

3 / 21

CS PSP

Classify problems

Team strategy

Outline

1

CS PSP

2

Classify problems

3

Team strategy

4 / 21

CS PSP

Classify problems

Team strategy

Problem-solving paradigms in computing1

CS Complete search (brute force) solve problem searching the entire search space

D&C Divide & Conquer make problem ‘simpler’ by dividing into sub-problems (usually half the size)

Gr Greedy make locally optimal choice at each step

DP Dynamic Programming problem that has overlapping subproblems and optimal substructure

1

content in this section based on “Competitive programming 1”, by Steven and Felix Halim 5 / 21

CS PSP

Classify problems

Team strategy

Problem-solving paradigms in computing1

CS Complete search (brute force) solve problem searching the entire search space

D&C Divide & Conquer make problem ‘simpler’ by dividing into sub-problems (usually half the size)

Gr Greedy make locally optimal choice at each step

DP Dynamic Programming problem that has overlapping subproblems and optimal substructure

1

content in this section based on “Competitive programming 1”, by Steven and Felix Halim 6 / 21

CS PSP

Classify problems

Team strategy

Problem-solving paradigms in computing1

CS Complete search (brute force) solve problem searching the entire search space

D&C Divide & Conquer make problem ‘simpler’ by dividing into sub-problems (usually half the size)

Gr Greedy make locally optimal choice at each step

DP Dynamic Programming problem that has overlapping subproblems and optimal substructure

1

content in this section based on “Competitive programming 1”, by Steven and Felix Halim 7 / 21

CS PSP

Classify problems

Team strategy

Problem-solving paradigms in computing1

CS Complete search (brute force) solve problem searching the entire search space

D&C Divide & Conquer make problem ‘simpler’ by dividing into sub-problems (usually half the size)

Gr Greedy make locally optimal choice at each step

DP Dynamic Programming problem that has overlapping subproblems and optimal substructure

1

content in this section based on “Competitive programming 1”, by Steven and Felix Halim 8 / 21

CS PSP

Classify problems

Team strategy

Problem-solving paradigms in computing1

CS Complete search (brute force) solve problem searching the entire search space

D&C Divide & Conquer make problem ‘simpler’ by dividing into sub-problems (usually half the size)

Gr Greedy make locally optimal choice at each step

DP Dynamic Programming problem that has overlapping subproblems and optimal substructure

1

content in this section based on “Competitive programming 1”, by Steven and Felix Halim 9 / 21

CS PSP

Classify problems

Team strategy

Notes on CS

Bug-free code never gives WA (wrong answer) Useful for ‘small values’, but inefficient for larger spaces (resulting in TLE (time limit exceeded)) (recall algorithm complexity)

Can run CS on small instances of a hard problem to get some patterns from its output Can serve as verifier for faster non-trivial algorithms

10 / 21

CS PSP

Classify problems

Team strategy

Some tips on CS

Filtering the right answer from a set of values vs. generating only the right values (latter more efficient) Think about the data space: remove infeasible space upfront Utilise symmetries Pre-computation: make better data structure, such that time making it outweighs the ‘loss’ in time searching Solve it ‘backwards’ from the data/results space fitting to the problem

11 / 21

CS PSP

Classify problems

Team strategy

Notes on D&C

Divide the original problem into sub-problems — usually by half or nearly half Find (sub-)solutions for each of these sub-problems – which are now easier If needed, combine the sub-solutions to produce a complete solution for the main problem Binary search seems easy, but there are some creative options there

12 / 21

CS PSP

Classify problems

Team strategy

Notes on D&C

Divide the original problem into sub-problems — usually by half or nearly half Find (sub-)solutions for each of these sub-problems – which are now easier If needed, combine the sub-solutions to produce a complete solution for the main problem Binary search seems easy, but there are some creative options there

13 / 21

CS PSP

Classify problems

Team strategy

Notes on Greedy

Problem must exhibit two things in order for a greedy algorithm to work for it: 1. It has optimal sub-structures. (Optimal solution to the problem contains optimal solutions to the sub-problems.) 2. It has a greedy property. (If we make a choice that seems best at the moment and solve the remaining subproblems later, we still reach optimal solution. We never have to reconsider our previous choices)

Risky: if you get WA and code is correct, the problem may not be greedy after all Use when input size is too large for CS or DP

14 / 21

CS PSP

Classify problems

Team strategy

Notes on Greedy

Problem must exhibit two things in order for a greedy algorithm to work for it: 1. It has optimal sub-structures. (Optimal solution to the problem contains optimal solutions to the sub-problems.) 2. It has a greedy property. (If we make a choice that seems best at the moment and solve the remaining subproblems later, we still reach optimal solution. We never have to reconsider our previous choices)

Risky: if you get WA and code is correct, the problem may not be greedy after all Use when input size is too large for CS or DP

15 / 21

CS PSP

Classify problems

Team strategy

Outline

1

CS PSP

2

Classify problems

3

Team strategy

16 / 21

CS PSP

Classify problems

Team strategy

Problem set

See printout Most problems are taken from, or based on, the UVa problem set (includes ICPC problem set) Each problem falls in one or more PSP, ad hoc, and/or another Read them, classify them Go online to http: //survey.cs.uct.ac.za/limesurvey/index.php/784949/lang-en

and select your choices Discuss afterward, and solve them

17 / 21

CS PSP

Classify problems

Team strategy

Solution

Charming canines – Divide & Conquer (binary search) Work reduction – Greedy Trainsorting – Dynamic Programming Wine trading in Gergovia – Greedy The jackpot – Dynamic Programming Durban prawns – Complete Search Mobile Phone Coverage – Complete Search + Geometry Blowing fuses – ad hoc (simulation)

18 / 21

CS PSP

Classify problems

Team strategy

Outline

1

CS PSP

2

Classify problems

3

Team strategy

19 / 21

CS PSP

Classify problems

Team strategy

A complete regional

Divide in groups of 3 Read the problem set: LA 2010 regionals Categorise the problems (mathsy, algorithmically, more theory/more programming; which type of algorithm/problem solving strategy) Make a plan of work as a team (who will act as team manager, how much time for a problem, which problem first, who works on which problem, ...).

20 / 21

CS PSP

Classify problems

Team strategy

Scheduled training dates

Aug 2: 9:30-15:30 Aug 16: 9:30-15:30 Aug 30: 9:30-15:30 Sept 13: 9:30-15:30 Sept 27: 9:30-15:30 Date of the regionals: 4 October, 2014

21 / 21

ACM International Collegiate Programming Contest — Training ...

Aug 30, 2014 - Identifying a CS 'problem-solving paradigm' from the ... content in this section based on “Competitive programming 1”, by Steven and Felix ...

130KB Sizes 0 Downloads 61 Views

Recommend Documents

ACM International Collegiate Programming Contest — Training ...
Aug 16, 2014 - Student IDs. Railways ... Contest — Training Session II. C. Maria Keet. Department of Computer Science, University of Cape Town, South Africa.

ACM International Collegiate Programming Contest — Training ...
Aug 30, 2014 - Contest — Training Session III. C. Maria Keet. Department of Computer Science, University of Cape Town, South Africa [email protected].

ACM International Collegiate Programming Contest — Training ...
Aug 16, 2014 - Department of Computer Science, University of Cape Town, South Africa ..... BA from left to right, starting from position 3 and every other.

ACM International Collegiate Programming Contest — Training ...
Aug 16, 2014 - b. conceptually (relatively) easy, but laborious to design and/or ... Competitive programming 1, by Steven and Felix Halim: https://sites.google.com/site/stevenhalim/. 6 / 33 ... Prim? Which one works best? or neither, and use another

The 13th ACM Arab Collegiate Programming Contest
If you need an AZERTY keyboard during the contest, you must bring one with you. Label it with your team's name. Once in Beirut: 1. Enter the LAU campus from ...

Problem Solving Strategies - ACM International Collegiate ...
Your first task is to write a program that identifies the maximum possible gain out ... that cockroaches (of the 7cm long and 1.3cm thick type) like that weather too!

ACM ICPC Greater New York Region Contest -
... will provide a space for about 150 motivated college students from the New York ... The top teams from this contest will be invited to compete in the 2017 ACM ICPC ... Each member of the organizing team has been involved in programming ... Reserv

ACM ICPC — Training Session IV - UCT
Sep 13, 2014 - Task: calculate time it takes to arrive home (≤24h), or impossible. Linear search to crunch through the segments and update, or binary search ...

History-Of-Programming-Languages-Acm-Monograph-Series.pdf ...
Retrying... Whoops! There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. History-Of-Programming-Languages-Acm-Monograph-Series.pdf. History-Of-Programming-Langua

Script: International/Humorous Speech Contest Master
The script below is a suggested outline of the main points that need to be covered. ... to all. o To provide an opportunity to learn by observing the more proficient ...

ACM and ACM-W Schedule -
Karen Shanklin, Courtney Brazell, and Kristijana Arroyo will talk about their experiences at. Sandia, the Jill Hruby Fellowship, and the open source wave energy converter array simulation tool, SWAN. Female students are strongly encouraged to attend.

ANNOUNCEMENT International Symposium & Training ... - whitrap
Dec 10, 2014 - Email: [email protected] .... I also declare that, to the best of my ... If you register by email, please attach the electronic signature.

Problem Solving Strategies – set of problems - ACM International ...
Sample output. Case 1. C 7. B 22. A 37. Case 2. E 0. A 1. D 1. C 10. B 50. 5 .... Figure 2: Illustration for the antennas and coverage. Write a program that finds the ...

2012 IEEE/ACM International Conference on Advances in Social ...
Link and Node Analysis of Gender Based Collaborations in Turkish Social .... Link Prediction for Bipartite Social Networks: The Role of Structural Holes .

An International Contest for Graduate Students THE GENEVA ...
Dec 8, 2017 - to an independent high level Jury Panel composed of policy makers and academics, young talents and experienced professionals, who will select the competition's finalists. 4.4. In the third and last phase of evaluations, one finalist per

2016 International Mind Education Specialist Training IYF.pdf ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item.

ANNOUNCEMENT International Symposium & Training Course on the ...
Dec 10, 2014 - All correspondence concerning the Training Course or the .... Please complete this form by computer and email to [email protected] or.

Kofi Annan International Peacekeeping Training Centre ... - WACSI
The overall objective of the course is to equip participants with effective tools for analytical thinking, leadership and other critical managerial skills in Gender, ...

Cochrane Collegiate Academy.pdf
Robinson Church Rd. Barrington Dr. Shamrock Dr. Linda Lake Dr. Central Av. Hickory Grove Rd. Ruth Dr. Farm Pond Ln. Hood Rd. Williams Rd. Tipperary Pl ... Terry Ln. Grafton Dr. Lake Forest Rd East. Dale Av. Marlwood Cr. Woodgreen Tr. Falstaff Dr. Wil

practice - ACM Digital Library
This article provides an overview of how XSS vulnerabilities arise and why it is so difficult to avoid them in real-world Web application software development.

Jana Vignana Vedika National Short Film Contest, JVV Contest 2018 ...
Jana Vignana Vedika National Short Film Contest, JVV Contest 2018 Application.pdf. Jana Vignana Vedika National Short Film Contest, JVV Contest 2018 Application.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Jana Vignana Vedika Nationa