Binary Search

USACO 2006 DEC #3(Silver): River Hopscotch

Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a rock at the start and another rock at the end, L units away from the start (1 <= L <=…

USACO 2018 DEC #1 (Silver): Convention

Farmer John is hosting a new bovine grass-eating convention at his farm! Cows from all over the world are arriving at the local airport to attend the convention and eat grass. Specifically, there are N cows arriving at the airport (1≤N≤10^5) and cow ii arrives at time Ti (0≤Ti≤10^9). Farmer John has arranged M (1≤M≤10^5) buses to transport the cows from the airport.…

USACO 2020 JAN #1 (Silver): Berry Picking

Bessie and her little sister Elsie are picking berries in Farmer John’s berry patch. Farmer John’s patch has exactly N berry trees (1≤N≤1000); tree i contains exactly Bi berries (1≤Bi≤1000). Bessie has exactly K baskets (1≤K≤1000, K even). Each basket can hold as many berries from a single tree as Bessie wants, but cannot contain berries from two different trees as their flavors will…


Create your own website, free on WordPress.com.Create your own website.
Start free