Presentation is loading. Please wait.

Presentation is loading. Please wait.

The SECOND Meeting Or: How I learned exciting new things in CS Club.

Similar presentations


Presentation on theme: "The SECOND Meeting Or: How I learned exciting new things in CS Club."— Presentation transcript:

1 The SECOND Meeting Or: How I learned exciting new things in CS Club

2 As you all know… The best way to learn is to do. o It’s true! Thus we will be giving you awesome problems to do o They’re awesome! o There’ll be one each week! o Thus they’re called Problems of the Week! (PotW) Concepts and tricks for USACO and other contests! Prizes!

3 The PotW Process* Problem presented at meeting o Will be posted online Submit solutions to potw@lynbrookcs.com by 11:59PM the day before the next meetingpotw@lynbrookcs.com o Feel free to give any feedback about difficulty o Or suggest your own problems Solution presented at next meeting o Will be posted online after it’s presented See how you and others are doing at lynbrookcs.com! lynbrookcs.com Prizes at end of semester! *subject to change

4 The Problems Any programming language accepted Graded based on guidelines specified in problem o Officers reserve the right to grade as they please :] Console input/output (System.in, System.out) unless otherwise specified Java input: Use Scanner (easier) or BufferedReader (faster)

5 Reading Input in JAVA import java.io.*; import java.util.*; Scanner s = new Scanner(System.in); int n = s.nextInt(); BufferedReader r = new BufferedReader( new InputStreamReader(System.in)); int n = Integer.parseInt(r.readLine());

6 PotW #1: The Ninja Cow Farmer John (get used to the cow theme) has quite a few cows, "conveniently" numbered 1 to N, inclusive. Except, one day, one cow became a ninja and "disappeared" from the herd. Your job is to figure out which cow became a ninja. To avoid arousing the suspicions of the ninja cow, you cannot use arrays, you cannot use longs, and you cannot allow integer overflow. For 10 points, implement your solution for N = 3 For 15 points, implement your solution for 2 ≤ N ≤ 1000 For 20 points, implement your solution for 2 ≤ N ≤ 10 6 Sample Input: Sample Output: 4 (number of cows) 2 (ID of ninja cow) 3 (1st visible cow) 4 (2nd) 1 (etc.)


Download ppt "The SECOND Meeting Or: How I learned exciting new things in CS Club."

Similar presentations


Ads by Google