Click to add title Click to add lame programming pun.

Slides:



Advertisements
Similar presentations
Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
Advertisements

Understanding optimum solution
Further Pure 1 Matrices Introduction. Definitions A matrix is just a rectangle of numbers. It’s a bit like a two-way table. You meet this concept in D1.
Grid method for multiplying by a 1 digit number. 1.Firstly, write the multiplication sum and then draw the grid. The largest number goes at the top so.
This title is orange because of Halloween. It is totally not because it’s always orange.
Intro to USACO Strategy
I couldn’t think of anything to put here. So have a cow. Or two.
Decimals and Fractions
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)
How to Pebbling Odometer
Introduction to Excel 2007 Part 2: Bar Graphs and Histograms February 5, 2008.
CS1020 Week 9: 19 th March Contents  Practice Exercise 33  Practice Exercise 34  Take-home Lab #4 Week 92.
Factoring Quadratic Expressions ax 2 + bx + c. 2x2x 3x3x +3 – 4 Setting the Stage Do you remember how to multiply these together? (Referred to as FOIL.
3.12 ≠ π What an inspiring title. PotW Solution - Bovinekiin int stall = 0; for (int i = 0; i calcGreedy(best)) { best = new ArrayList (cur); // update.
Operations Management Dr. Ron Lembke
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 ^=
Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean.
Long Multiplication What is long multiplication?
Web Registration Guide webreg.rutgers.edu. Default Screen.
Single Digit Whole Number Division FlashCards The Whole Numbers are the natural numbers (1, 2, 3, …), and the number zero (0).
Everyday Mathematics Lattice Multiplication Lattice Multiplication Everyday Mathematics Lattice multiplication involves: Using basic facts knowledge;
Week 4-5 Java Programming. Loops What is a loop? Loop is code that repeats itself a certain number of times There are two types of loops: For loop Used.
Multiple Choice Solutions True/False a c b e d   T F.
Google Training By: Amy Shannon and Dave Auwerda.
ECE 643- Design and Analysis of Computer Networks K Shortest Paths Dept. of Electrical and Computer Eng. George Mason University Fairfax, VA ,
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();
Microsoft Excel Spreadsheet With Potential What is Excel Excel is Microsoft’s spreadsheet It is included within Microsoft office, along with Word, Power.
Intro to By Debra Dimas Special thanks to David Fogliatti and Armand Amarento of Oceanside HS in San Diego.
Click here for USACO solutions! …just kidding. (You still have until the end of today to take it!)
Moooooo Or: How I learned to stop worrying and love USACO.
Last Meeting Of The Year. Last Week's POTW Solution: #include... map DP; int getdp(int a) { if(DP[a]) return DP[a]; int digsum = 0; for(int c = a; c >
Happy Birthday Julia Courier New. USACO December Contest - Congratulations to Jon+Julia+Andy for promoting to gold And Johnny - 2th place in gold among.
Public void main What do you call something that’s not static?
Recursion Pepper. Another way to loop Call yourself repeatedly until you say to stop. Example: add up 10 numbers using addUp. -- Input – number to count.
Introduction to the Essentials of Excel COMP 066.
The SECOND Meeting Or: How I learned exciting new things in CS Club.
DataSet Your Database student test score Database Connection Your program needs to establish a connection to the database. Click on “Add New Data Source.”
. Mixture Problems Made Easy!!! Really!! How many liters of a solution that is 20% alcohol should be combined with 10 liters of a solution that is 50%
Math, Data Types. Python Math Operations OperationOperator Addition + Subtraction – Multiplication * Division (floating point) / Division (integer) //
Multiplying Decimals Type your name and send: Next slide.
Excel Final Project – Day 3 Notes You should have 4 reports done by the end of today… Grades are up to date… The only remaining grade for the quarter is.
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,
CSE 110 Review Session Hans Hovanitz, Kate Kincade, and Ian Nall.
Section 4.4. a) Factor x 2 + 5x - 36 (x + 9)(x – 4) b) Factor 2x 2 – 20x + 18 Hint: factor out a 2 first 2(x-9)(x-1) c) Factor 2x 2 + x – 6 Why doesn’t.
Double click here to add event title Double click here to add event date Double click here to add event time Double click here to add event location.
The SECOND Meeting Or: How I learned exciting new things in CS Club.
Data Hubs and Wires. Begin by adding a basic Move block, 5 rotations 75% power.
Multiplying large numbers - lattice method Created by: Sabrina Edmondson Adapted from BBC online.
Multidimensional Arrays Computer and Programming.
TABLES Why Make a Table Steps to Making a Table Rows Vs. Colums Resources By: Morgan Jahnke 2 nd Grade Math.
Google Docs For Assessment. What do you need? A Google account Desire to differentiate assessment Content A minimal amount of technologic prowess.
Example 3.1a Sensitivity Analysis and Solver Table Add-in.
Stable marriages Competitive programming and problem solving Yoram Meijaard.
Thurso High School Design and Technology Tutorial Two Dice.
Week 9 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
Minimum Spanning Trees Kruskal's and Prim's algorithms.
Year 5 - Numeracy Title page..
Math 128 (Trigonometry) Instructor: Michael Mays
Matrices Rules & Operations.
[ 4.00 ] [ Today’s Date ] [ Instructor Name ]
A statement is a contradiction
Title of Presentation Name(s) of Presenter(s) Department, Hope College
Sit-In Lab 1 Ob-CHESS-ion
Addition Grids.
int [] scores = new int [10];
Multiplication Grids.
YOUR text YOUR text YOUR text YOUR text
Form Time Numeracy Week beginning
Introduction to Excel 2007 Part 1: Basics and Descriptive Statistics Psych 209.
Click here to add your title
Presentation transcript:

Click to add title Click to add lame programming pun

PotW Solution PotW Solution (credits to Qingqi) Scanner input=new Scanner(System.in); int v=input.nextInt(), e=input.nextInt(); ArrayList [] g=new ArrayList[v]; for(int i=0;i (); for(int i=0;i q=new LinkedList (); q.offer(0); visited[0]=true; int cnt=1; while(!q.isEmpty()) { int node=q.poll(); for(int n: g[node]) { if(!visited[n]) { visited[n]=true; q.add(n); cnt++; } } } System.out.println(e==v-1 && cnt==v?"YES":"NO");

Take December USACO! December 9-12 You know you want to! o Even though it is the weekend before finals…

PotW - Cow Trails Farmer John wants to create a scenic trail on his field, and has hired you. To maximize your pay, make the trail as long as possible. However, his field has trees on it, and he refuses to cut them down because he is environmentally conscious. Trees are denoted with "Y", and empty spaces are denoted with ".". The trail starts at the top left corner and cannot intersect with itself (it is NOT a loop) Sample Input: Sample Output (not optimal): 4 5 (rows columns) RRRRDLLDDLULD......Y......Y The time limit is 10 seconds, and the dimensions of the grid are less than 80. Scoring will be relative to your placing out of all submissions: the kth best will receive 54-3*k points, with ties rounding up.

Hints Use System.currentTimeMillis() to make sure your program is done by the end of 10 seconds Try using a random number generator along with multiple trials to get a better solution o Note that only your final solution will be graded, so there may be a small amount of luck involved here To improve your solution, try making some random test cases o The actual test data will be randomly generated, with a 3x3 empty space at the top left corner, and less than 40% trees GO! o You have three weeks to outdo your competitors Rest of the meeting is for discussion/studying