您的位置:首页 > 其它

CodeForces - 821B Okabe and Banana Trees(阅读题)

2017-08-24 10:37 295 查看
读读题意推个公式就好了~

代码:

#include<bits/stdc++.h>
using namespace std;
int m,b;
int main()
{
scanf("%d%d",&m,&b);
long long int best=0;
for(int i=0;i<=b;i++)
{
long long int y=i;long long int x=(long long int)m*(long long int)(b-y);
//if(x<0)continue;
long long int t=(x+y)*(x+1)*(y+1)/2;
if(best<t)best=t;
}
printf("%lld",best);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  阅读 codeforces