HBC24441HarderGcdProblem[USACO 2013 Dec B]Cow Baseball题解

一沫阳光 算法基础篇 40 0
挑战自我,勇攀编程高峰!全网最全C++题库,助您成为编程达人。
Farmer John's N cows (3

Farmer John's N cows (3 <= N <= 1000) are standing in a row, each located at a distinct position on the number line. They are practicing throwing a baseball around, getting ready for an important game against the cows on the neighboring farm.  As Farmer John watches, he observes a group of three cows (X,Y,Z) completing two successful throws. Cow X throws the ball to cow Y on her right, and then cow Y throws the ball to cow Z on her right. Farmer John notes that the second throw travels at least as far and no more than twice as far as the first throw. Please count the number of possible triples of cows (X,Y,Z) that Farmer John could have been watching.

HBC24441HarderGcdProblem[USACO 2013 Dec B]Cow Baseball题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
全网最全C++题库,助您挑战自我,突破极限,成为编程领域的佼佼者!

标签: HBC24441HarderGcdProblem[USACO 2013 Dec B]Cow Baseball题解