BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//American Young Coder - ECPv6.10.1.1//NONSGML v1.0//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:American Young Coder
X-ORIGINAL-URL:https://www.ayclogic.com
X-WR-CALDESC:Events for American Young Coder
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-Robots-Tag:noindex
X-PUBLISHED-TTL:PT1H
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:DAYLIGHT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
TZNAME:PDT
DTSTART:20250309T100000
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
TZNAME:PST
DTSTART:20251102T090000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=America/Los_Angeles:20251023T190000
DTEND;TZID=America/Los_Angeles:20251023T200000
DTSTAMP:20260429T232351
CREATED:20251025T080829Z
LAST-MODIFIED:20251025T081035Z
UID:31423-1761246000-1761249600@www.ayclogic.com
SUMMARY:7 PM – USACO Bronze – Darin
DESCRIPTION:What We Did Today:\n\nWent through the Farmer John Actually Farms problem for the optimal solution\n\nHomework:\n\nCode up the optimal solution for Farm John Actually Farms\, and submit your answer to the webpage when you are finished here https://usaco.org/index.php?page=viewproblem2&cpid=1371:\n\n\n\n\n\n\n\n\n\n\nOptimal Solution (Implementation Level)\n\n\n\n\n\n\n1\nSort Your Plants\n\n\n<- Use a Plant class to represent the plants details\n\n\n\n\n\n\n\nYou want a mapping for the desired ordering to point to each index of the Plant array\n\n\n\n\n\n2\n\n\nFind the day of intersection between each pair in the sorted array\n\n\nnote: if the two pairs never intersect\, and the initial ordering between the two is wrong\, leave the algorithm\n\n\n\n\n\nuse the y=mx+c and setting y’s equal to each other\n\n\n\n\n\n\n\n\nround up OR increment to the next day if the intersection is not a decimal\n\n\n\n\n\n3\n\n\nCheck each pairs value at the interesting day and see if it matches one being greater than the other\n\n\n\n\n\n4\n\n\nIf all pairs pass\, you take the highest day\n\n\n\n\n\n\nAlso code up the brute force method for the problem (code and logic should be similar: \n\n\n\n\n\n\n\nBrute Force:\n\n\n\n\n1)\nFind all the interesting days\n\n\n\n\n\n\nCreating pairs for all the plants (double for loop)\n\n\n\n\n\n\n\n\nComputing the interesting days between all pairs and store in a list\n\n\n\n\n\n2)\n\n\nFor loop over all the interesting days\n\n\n\n\n\n3)\nCompute all heights\n\n\n\n\n\n\n# Check if the ordering of the trees at this day matches the desired ordering\n\n\n\n\n\n\nFor p in plants:\n\n\n\n\n\n\nCompare p to every other plant\, and count how many are bigger than itself\n\n\n\n\n\n4)\n\n\nCheck if this count matches the index at T\n\n\n\n\n\n\nNotes:\nYou can reach out to me at ddjapri@ayclogic.com if you have any questions! \nYou can find class notes here (Tues7PM_IntroToCompProgramming is our excel sheet for visuals).
URL:https://www.ayclogic.com/event/7-pm-usaco-bronze-darin-2/
CATEGORIES:Intro To Competitive,Java
END:VEVENT
END:VCALENDAR