#p163. 习题3.3.7 平面分割
习题3.3.7 平面分割
题目描述
同一平面内有 n(n≤500)条直线,已知其中 p(p≥2)条直线相交于同一点,则这 n 条直线最多能将 平面分割成多少个不同的区域?
输入格式
两个整数 n(n≤500)和 p(2≤p≤n)。
输出格式
一个正整数,代表最多分割成的区域数目。
样例数据
input
12 5
output
73
数据规模与约定
时间限制:
空间限制:
同一平面内有 n(n≤500)条直线,已知其中 p(p≥2)条直线相交于同一点,则这 n 条直线最多能将 平面分割成多少个不同的区域?
两个整数 n(n≤500)和 p(2≤p≤n)。
一个正整数,代表最多分割成的区域数目。
input
12 5
output
73
时间限制:1s
空间限制:256MB
By signing up a code-fans universal account, you can submit code and join discussions in all online judging services provided by us.