1 / 6

The SECOND Meeting

The SECOND Meeting. Or: How I learned exciting new things in CS Club. As you all know…. The best way to learn is to do. It’s true! Thus we will be giving you awesome problems to do They’re awesome! There’ll be one each week! Thus they’re called Problems of the Week! ( PotW )

jirair
Download Presentation

The SECOND Meeting

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. • It’s true! • Thus we will be giving you awesome problems to do • They’re awesome! • There’ll be one each week! • Thus they’re called Problems of the Week! (PotW) • Concepts and tricks for USACO and other contests! • Prizes!

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

  4. The Problems • Any programming language accepted • Graded based on guidelines specified in problem • 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.*; importjava.util.*; Scanner s = newScanner(System.in); int n = s.nextInt(); BufferedReader r = newBufferedReader( newInputStreamReader(System.in)); intn = 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 ≤ 106 Sample Input:Sample Output: 4 (number of cows) 2 (ID of ninja cow) 3 (1st visible cow) 4 (2nd) 1 (etc.)

More Related