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();

Slides:



Advertisements
Similar presentations
REFERENCING INTERNET WEBSITES (MLA). Today we are going to learn how to write MLA style references or citations for websites. Hello. I am a tarantula.
Advertisements

January 6. January 7 January 8 January 9 January 10.
Days Regular Feature of All-Leader Calls All-Leader Call December 14, 2014.
DOT 1 January , 1990 DOT 2 July 23 - August 3, 1990.
school program selections. Available September 4 thru 7, 2012.
X. X September Mo Tu We Th Fr Sa Su
Chubaka Producciones Presenta :.
HOW TO MAKE A CLIMATE GRAPH CLIMATE GRAPHING ASSIGNMENT PT.2.
2012 JANUARY Sun Mon Tue Wed Thu Fri Sat
P Pathophysiology Calendar. SundayMondayTuesdayWednesdayThursdayFridaySaturday January 2012.
Chicas, este calendario si es pa' nosotras !!!!!.
Programming Contest problems Dr. Jeyakesavan Veerasamy CS faculty, The University of Texas at Dallas Website:
Class of 2010 Corona High School 12th Grade Presentation.
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSAT/SUN Note: You can print this template to use as a wall calendar. You can also copy the slide for any month to add.
You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation. If you’d like to change.
School Year Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation.
School Year Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation.
You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation. If you’d like to change.
2007 Monthly Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation.
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSAT/SUN Note: You can print this template to use as a wall calendar. You can also copy the slide for any month to add.
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSAT/SUN Note: You can print this template to use as a wall calendar. You can also copy the slide for any month to add.
January 2013 MondayTuesdayWednesdayThursdayFridaySaturdaySunday.
January 2013 SundayMondayTuesdayWednesdayThursdayFridaySaturday.
You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation. If you’d like to change.
You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation. If you’d like to change.
J-1 University of Washington Computer Programming I Switch Statement © 2000 UW CSE.
WORD JUMBLE. Months of the year Word in jumbled form e r r f b u y a Word in jumbled form e r r f b u y a february Click for the answer Next Question.
September 2008 SundayMondayTuesdayWednesdayThursdayFridaySaturday
DATE POWER 2 INCOME JANUARY 100member X 25.00P2, FEBRUARY 200member X 25.00P5, MARCH 400member X 25.00P10, APRIL 800member.
EUROPE Nov 27 –Dec 10 November 27 - Dec 10.
2011 Calendar Important Dates/Events/Homework. SunSatFriThursWedTuesMon January
SunSatFriThursWedTuesMon January
6 th Grade Science Camp Date: February 3-5, 2016 Pali Mountain Science Camp is in Running Springs, California. Teachers attend camp with students and administrators.
St. Paul Evangelical Lutheran Church Semi-Annual Congregational Meeting January 31, 2016 Treasurer’s Report.
TEMPORAL VISUALIZATION OF DATA FROM THE FRENCH SENTINEL NETWORK.
July 2007 SundayMondayTuesdayWednesdayThursdayFridaySaturday
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.
Citations and Works Cited page
Payroll Calendar Fiscal Year
Baltimore.
Dictation practice 2nd Form Ms. Micaela-Ms. Verónica.
McDonald’s Kalender 2009.
McDonald’s Kalender 2009.
13-block rotation schedule
NC Truck Driver Training SCHOOL
CCR Meeting Seniors.
I.E.S. Universidad Laboral
2018/2019 School Calendar July August September October November
Snapshot of the year, jump into some of the highlight moments shortly
Due Dates subject to change. Watch for dashboard updates.
Irregularities in DoRIS
Assembled by the Rubicon Forest Protection Group
McDonald’s Kalender 2009.
FY 2019 Close Schedule Bi-Weekly Payroll governs close schedule
Information Management & Financial Analysis for HR Managers
Problem Gambling Clicks to Opgr.org
2009 TIMELINE PROJECT PLANNING 12 Months Example text Jan Feb March
McDonald’s calendar 2007.
Teacher name August phone: Enter text here.
Irregularities in DoRIS
February 2007 Note: Source:.
JUNE 2010 CALENDAR PROJECT PLANNING 1 Month MONDAY TUESDAY WEDNESDAY
McDonald’s calendar 2007.
PLAYMATES LEARNING CENTER CALENDAR
2009 TIMELINE PROJECT PLANNING 12 Months Example text Jan Feb March
Production Month Sun Hours K Monthly Kwh Tou Peak Value After Kwh
Habitat Changes and Fish Migration
2015 January February March April May June July August September
Habitat Changes and Fish Migration
Presentation transcript:

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(); int preve=-1,c=0; for(int i=1;i<=n;i++) { int start = scan.nextInt()*60 + scan.nextInt(); int end = scan.nextInt()*60 + scan.nextInt(); if(start>=preve) { preve=end; c++; } System.out.println(c);

+15 Bonus Solution Scanner scan = new Scanner(System.in); scan.useDelimiter("[^0-9]+"); int n=scan.nextInt(); int[] endt=new int[n+1],maxn=new int[n+1],maxt=new int[n+1]; endt[0]=-1; // add dummy segment maxn[0]=0; maxt[0]=0; for(int i=1;i<=n;i++) { int start = scan.nextInt()*60 + scan.nextInt(); int end = scan.nextInt()*60 + scan.nextInt(); endt[i]=end; // save end int left=0,right=i,mid; while(left+1 < right) { // binary search for last end landing before start mid = (left+right)/2; if(endt[mid]>start) right=mid; else left=mid; } // at end of binary search, "left" points to index of last end

Bonus Solution (cont.) int curn=maxn[left]+1; int curt=maxt[left]+end-start; // memoize current values maxn[i]=maxn[i-1]; maxt[i]=maxt[i-1]; if(curn>maxn[i]) { maxn[i]=curn; // superior in terms of number maxt[i]=curt; } else if(curn==maxn[i] && curt>maxt[i]) maxt[i]=curt; // tie, break tie by time } System.out.println(maxn[n]); System.out.println(maxt[n]);

USACO Schedule! Nov 11-14: November Contest Dec 9-12: December Contest Jan 6-9: January Contest Feb 3-6: February Contest Mar 2-5: March Contest April: US Open June: Training Camp September: IOI 2012 in Milan, Italy Also on lynbrookcs.com/usaco-schedule/

USACO Tips/Reminders! You should TAKE IT o usaco.org You should PREPARE FOR IT o train.usaco.org You should READ THE PROBLEM CAREFULLY You should TEST YOUR PROGRAMS o Read the test data o Check the test data by hand o Check your algorithm by hand o Make your own test data o Test your program Don’t waste your time on the wrong things! o You are allowed to copy code off the internet for algorithms you can’t remember Cite your sources General info about USACO on Oct. 3 meeting slides

New PotW! Nope! Take the USACO instead! o Worth 5 points (if you actually submit something) o For credit, mark that you participated on the attendance sheet next meeting (or us if you for some reason can’t make it to the next meeting)