I couldn’t think of anything to put here. So have a cow. Or two.

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Computational Geometry
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
(())()(()) ((())()(())()(()))
This title is orange because of Halloween. It is totally not because it’s always orange.
TRANSFORMATIONS.
Semester 10 Time sure flies.. PotW Solution One possible solution is to randomly search the grid: o At each point in your search, look at the (up to four)
Vocabulary coordinate plane axes x-axis
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
3.12 ≠ π What an inspiring title. PotW Solution - Bovinekiin int stall = 0; for (int i = 0; i calcGreedy(best)) { best = new ArrayList (cur); // update.
CSC1016 Coursework Clarification Derek Mortimer March 2010.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
Special Cases of the Hidden Line Elimination Problem Computational Geometry, WS 2007/08 Lecture 16 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
USACOW: The Aftermath. PotW Solution Scanner s = new Scanner(System.in); int n = s.nextInt(), k = s.nextInt(), x = 0; for (int i = 0; i < n; i++) x ^=
O RTHOGONAL R ANGE S EARCHING الهه اسلامی فروردین 92, 1.
The point halfway between the endpoints of a line segment is called the midpoint. A midpoint divides a line segment into two equal parts.
1 Transformations of Functions SECTION Learn the meaning of transformations. Use vertical or horizontal shifts to graph functions. Use reflections.
Graph points on the coordinate plane to solve real-world and mathematical problems. UW.GAP.5.M.G.02 Represent real world and mathematical problems by graphing.
Anthony Poole & Keaton Mashtare 2 nd Period. X and Y intercepts  The points at which the graph crosses or touches the coordinate axes are called intercepts.
 Students will be able to:  Understand how signs of the number in an ordered pair indicate the point’s location in a quadrant of the coordinate plane.
1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.
COMP 175: Computer Graphics March 24, 2015
Midpoint and Distance in the Coordinate Plane.   Students will be able to…  Develop and apply the formula for midpoint.  Use the distance formula.
USACO’s this weekend! Aren’t you EXCITED ?!? :D. PotW Solution (20 pts) Scanner scan = new Scanner(System.in); scan.useDelimiter("[^0-9]+"); int n=scan.nextInt();
GRE: Graphical Representations COORDINATE GEOMETRY.
Reflections or Flips.
Module 4 Test Review. Now is a chance to review all of the great stuff you have been learning in Module 4! Ordered Pairs Plotting on the Coordinate Plane.
Boolean lessThanThree; Defaults to false.. PotW Solution - Compression int dp(int i, int cnt) { if (cnt > lim) return (1
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
Do Now Write down 4 things that you know about a COORDINATE GRID.
Lesson 4.1- The Coordinate Plane, pg. 192
Applications with the Coordinate Plane Lesson 4.04.
Acute angle An angle with a measure less than 90 degrees.
2.1 Functions and Their Graphs What you should learn: Goal1 Goal2 Represent relations and functions. Graph and evaluate linear functions. 2.1 Functions.
Houyang 3/25/13. USACO March Contest Congrats to Johnny Ho for scoring over 900 points in the Gold Division o 7th place in US Kudos to Jonathan Uesato.
Happy Birthday Julia Courier New. USACO December Contest - Congratulations to Jon+Julia+Andy for promoting to gold And Johnny - 2th place in gold among.
Please sign in on the sign up sheet MTH Computer Science Club.
Public void main What do you call something that’s not static?
+ Objective: to measure segments and add segment lengths DO NOW: EVALUATE. Plot each point on a coordinate plane. 1.I -15 I 2.I 7 I 3.I I 4.I -12-(-2)
Happy Birthday Tony Palindromes.
Break; return; // to school :’(. PotW Solution Problem recap: Write a Befunge program that prints out a Brain**** program that prints out a HQ9+ program.
Stacks and Queues. Announcements USACO Open competition results are out o Congrats to Johnny for scoring 2nd in the US USACO Finalists are also announced.
Plotting on the Coordinate Plane Lesson After completing this lesson, you will be able to say: I can identify and position pairs of rational numbers.
Click to add title Click to add lame programming pun.
Where’s the title? You gotta search for it!. PotW Solution String s = new Scanner(System.in).next(); int[] prev = new int[s.length() * 2 + 2]; Arrays.fill(prev,
Graphing Chapter 7. Chapter 7.1 Rectangular Coordinate Systems.
(7.7) Geometry and spatial reasoning The student uses coordinate geometry to describe location on a plane. The student is expected to: (B) graph reflections.
A relation is a correspondence between two sets. If x and y are two elements in these sets and if a relation exists between x and y, then x corresponds.
FUNCTION TRANSLATIONS ADV151 TRANSLATION: a slide to a new horizontal or vertical position (or both) on a graph. f(x) = x f(x) = (x – h) Parent function.
Copyright © Cengage Learning. All rights reserved. 1 Functions and Their Graphs.
Acute angle: An angle with a measure less than 90º.
Check 12-2 HW. Course Graphing Translation 6 th Grade Math HOMEWORK Page 629 #14-16.
5.7 Reflections and Symmetry. Objective Identify and use reflections and lines of symmetry.
SLOPE 8.2.spi11 Finding the slope of a line: The slope of a hill means how steeply it goes up or down. Lines and curves also have a slope. To find slope:
Computational Geometry
Ordered Pairs Objective:Find how to graph ordered pairs.
Lynbrook Computer Science “The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the.
Analyzing Conic Sections
GRE: Graphical Representations
Transformations of Functions
THE PARAB LA.
THE PARAB LA.
and 2 units to the left of point B. Count down 5 units from point B
Graph Transformations
4-1 The Coordinate Plane Warm Up Problem of the Day
Transformations of Functions
Analyzing Conic Sections
Warm-up: Name the conic section and its center or vertex. Give a rough sketch.
Chapter 2 Functions, Equations, and Graphs
Presentation transcript:

I couldn’t think of anything to put here. So have a cow. Or two.

PotW Solution Problem recap: Determine the ancestors of a node in an organization graph. Given a list of employee to boss relationships and a list of queries, determine who must obey whom from the list of queries.

PotW Solution HashMap boss = new HashMap (); int groupN = scan.nextInt(); for (int i = 0 ; i < groupN; i++) { int employeeN = scan.nextInt(); String curBoss = scan.next(); for (int j = 0; j < employeeN; j++) { boss.put(scan.next(), curBoss); } int queryN = scan.nextInt(); for (int i = 0 ; i < queryN; i++) { String x = scan.next(), y = scan.next(); boolean isBoss = false; while (!isBoss && boss.containsKey(x)) { x = boss.get(x); isBoss = x.equals(y); } if (isBoss) { System.out.println("yes"); } else { System.out.println("no"); }

Gunn Programming Contest Was last Saturday! A Lynbrook team placed first! Congratulations to: o Steven Hao o Tony Jiang o Qingqi Zeng Missed the Gunn contest? Fear not, because there’s still…

Harker Invitational March 17, 9AM – 4PM Participation worth 30 points PotW credit (subject to change) Register at o Registration deadline - March 10 If anyone’s has a parent willing to chaperone, us

March USACO Is this coming weekend (March 2-5) o You know what that means! o (yes, the usual 5 points PotW credit for a 3-hour contest) Take it!

February USACO Problems I could have used this on the title slide…

Bronze – Rope Folding Farmer John has a rope of length L (1 <= L <= 10,000) with N (1 <= N <= 100) knots tied at distinct locations, including at its two endpoints. Count the number of locations where the rope can be folded such that the knots on opposite strands all line up exactly with each other. Example:

Rope Folding - Solution Sort the knot locations, build an array of differences o 0, 2, 4, 6, 10 would become 2, 2, 2, 4 Any prefix or suffix of the difference array that is a palindrome corresponds to a valid fold (ex: 2, 2; 2, 2, 2) Bounds are small enough to brute force check for palindromes

Silver – Overplanting Given N (1 <= N <= 1000) different axially-aligned, possibly overlapping rectangular regions (all coordinates between and 10 8 ), determine the total area covered by these regions. (Result may be larger than a 32-bit int)

Overplanting - Solution Use a “sweep line” approach: Sort all y-coordinates in scene, divide space into horizontal “slices” o Store the height of each slice as well as an “overlap count” for each slice Sort all x-coordinates, sweep across plane from left to right o When leading vertical edge of rectangle hit, increment “overlap count” of all slices covered by rectangle o When trailing vertical edge hit, decrement overlap counts o Maintains current number of “active” rectangles within each slice To compute total area, add up area of slices w/ positive overlap counts

Gold – Symmetry How many lines of symmetry are there between N < 1000 cows (with integer coordinates) on the 2D plane? First, how do we check if a certain line works? o Given a line, use vector geometry to reflect each point P over to a point Q o Use a set to check if point Q exists quickly Let m be the center of mass of the points o Then simply check every line PM o In order to take care of special cases, also check the line that goes through M and is perpendicular to PM

PotW – Juggling Bessie the cow is performing an elaborate juggling act that requires her to juggle many objects, but now that the act is ending, she needs to drop them in a certain order. Given the current order of the N objects, tell her how many moves she needs to drop all of the objects. A “move” is a left cyclic shift. For example, {3, 2, 1} is juggled to become {2, 1, 3}, {2, 1, 3} becomes {1, 3, 2}, 1 is dropped to make {3, 2}, which becomes {2, 3}, which becomes {3}, which becomes {}: 6 moves.

Juggling (cont.) Example Input: Output: 6 For 25 points, solve for N < 1,000 For 50 points, solve for N < 100,000 Time limit: 2 seconds