Daiichi Sankyo Co. has agreed to buy U.S.-based Ambit Biosciences Corp. for as much as $410 million to bolster its pipeline of cancer treatments.