computer science club the computer was born to solve problems that did not exist before. – bill...

7
Computer Science Club “The computer was born to solve problems that did not exist before.” – Bill Gates

Upload: brian-mcfarland

Post on 26-Mar-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Computer Science Club The computer was born to solve problems that did not exist before. – Bill Gates

Computer Science Club“The computer was born to solve

problems that did not exist before.”– Bill Gates

Page 2: Computer Science Club The computer was born to solve problems that did not exist before. – Bill Gates

San Jose Holiday Parade

• “Christmas in the Park” canceled for CS club– No volunteer spots available

• Next Community Link event: San Jose holiday parade– December 5th, 5:00 AM - 12:00 PM (report times vary)– Various volunteer positions

• More information at http://www.sanjoseholidayparade.com/volunteers.htm

Page 3: Computer Science Club The computer was born to solve problems that did not exist before. – Bill Gates

Problem of the week SOLUTION

Page 4: Computer Science Club The computer was born to solve problems that did not exist before. – Bill Gates

POW SOLUTION cont…

Page 5: Computer Science Club The computer was born to solve problems that did not exist before. – Bill Gates

POW SOLUTION cont…

Page 6: Computer Science Club The computer was born to solve problems that did not exist before. – Bill Gates

Problem of the Week

• Farmer John needs to sell a chunk of his land. Unfortunately, the land he sells inevitably affects the N cows (1 <= N <= 100,000) that graze on it. Given the start point, Ps, and end point, Pe, of grazing in meters (1 <= Ps < Pe <= 250,000) for each cow, answer Farmer John’s Q questions (1 <= Q <= 100,000). Each question will ask how many cows are affected by cutting out a piece of land from one point, Qs, to another, Qe (1 <= Qs < Qe <= 250,000).

Page 7: Computer Science Club The computer was born to solve problems that did not exist before. – Bill Gates

Problem of the Week (cont.)

• Input:Line 1: Space-separated integers N and QLines 2 … N + 1: Ps and Pe for each cow on the farmLines N + 2 … N + Q + 1: Space-separated integers Qs and Qe

• Output:Lines 1 … Q: One integer representing the answer to each question