HBC15681ZJH and Monkeys题解

水水月牙 算法基础篇 56 0
挑战自我,勇攀编程高峰!全网最全C++题库,助您成为编程达人。
It’s universally acknowledged that there’re innumerable trees in the campus of HUST. One day, zjh is wandering in the campus,and he finds a tree with n monkeys on it, and he labels the monkeys from 1 to n. A triple of monkeys is called happy if and only if the absolute value of the difference of the distance from c to a the distance from c to b holds the same parity(奇偶性) as n. Now zjh wants to know how many triples of monkeys are happy.

It’s universally acknowledged that there’re innumerable trees in the campus of HUST.   One day, zjh is wandering in the campus,and he finds a tree with n monkeys on it, and he labels the monkeys from 1 to n. A triple of monkeys (a,b,c) is called happy if and only if the absolute value of the difference of the distance from c to a the distance from c to b holds the same parity(奇偶性) as n. Now zjh wants to know how many triples of monkeys are happy.

HBC15681ZJH and Monkeys题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断学习,不断挑战,才能在编程领域中脱颖而出!全网最全C++题库,助您成为编程高手!

标签: HBC15681ZJH and Monkeys题解