思路:

暴力枚举。

实现:

 #include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;
ll m, b;
int main()
{
cin >> m >> b;
ll maxn = ;
for (ll i = ; i <= m * b; i++)
{
ll j = - i / m + b;
if (m * j + i - m * b <= )
{
ll ans = (i + ) * (j + ) * (i + j) / ;
if (ans > maxn)
maxn = ans;
}
}
cout << maxn << endl;
return ;
}

CF821B Okabe and Banana Trees的更多相关文章

  1. Codeforces821B Okabe and Banana Trees 2017-06-28 15:18 25人阅读 评论(0) 收藏

    B. Okabe and Banana Trees time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  2. 【Codeforces Round #420 (Div. 2) B】Okabe and Banana Trees

    [题目链接]:http://codeforces.com/contest/821/problem/B [题意] 当(x,y)这个坐标中,x和y都为整数的时候; 这个坐标上会有x+y根香蕉; 然后给你一 ...

  3. CF821 B. Okabe and Banana Trees 简单数学

    Link 题意:给出一条直线,在直线上取一点,其垂直x,y轴作成一个,求矩阵中所有包含的点的x,y坐标之和的最大值. 思路:对于一个任意一点我们计算公式,对于任意一点$(x, y)$,有$(x+y)^ ...

  4. codeforces B. Okabe and Banana Trees 结论题

    题目传送门 这道题 枚举一波y就好了 要求x,y整数 所以y最多1000个 然后算一波答案更新就好了 233 #include<cstdio> #include<cstring> ...

  5. #420 Div2 Problem B Okabe and Banana Trees (math && 暴力枚举)

    题目链接 :http://codeforces.com/contest/821/problem/B 题意 :给出 m 和 b 表示在坐标轴上的一条直线  要求你在这条直线和x.y轴围成的区域中找出一个 ...

  6. Codeforces Round #420 (Div. 2)

    /*************************************************************************************************** ...

  7. Codeforces Round #420 (Div. 2) A,B,C

    A. Okabe and Future Gadget Laboratory time limit per test 2 seconds memory limit per test 256 megaby ...

  8. Codeforces Round #420 (Div. 2) A-E

    本来打算划划水洗洗睡了,突然听到这次的主人公是冈部伦太郎 石头门(<steins;gate>)主题的比赛,岂有不打之理! 石头门真的很棒啊!人设也好剧情也赞曲子也特别好听. 推荐http: ...

  9. codeforces round 420 div2 补题 CF 821 A-E

    A Okabe and Future Gadget Laboratory 暴力 #include<bits/stdc++.h> using namespace std; typedef l ...

随机推荐

  1. 【SQL Server 学习系列】-- 清除SQL Server 2012连接过的服务器名称

    需要删除两个地方,删除前请注意备份! 1.  %AppData%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin 2.  %A ...

  2. [转]Attribute在.net编程中的应用

    Attribute在.net编程中的应用(一) Attribute的基本概念 经常有朋友问,Attribute是什么?它有什么用?好像没有这个东东程序也能运行.实际上在.Net中,Attribute是 ...

  3. mybatis collection标签和association标签(一对多,一对一)转载

    mybatis 一对一与一对多collection和association的使用   在mybatis如何进行一对一.一对多的多表查询呢?这里用一个简单的例子说明. 一.一对一 1.associati ...

  4. python操作mysql方法和常见问题

    http://www.cnblogs.com/ma6174/archive/2013/02/21/2920126.html 安装mysql模块 sudo easy_install mysql-pyth ...

  5. qq xxs

    qq xxs qq xxs 有很多举个简单例子 : QQ空间发段文章 带上 <script> 提交(document.cookie) 到 自己服务端获取 </script> 在 ...

  6. go17---并发

    yjf512 · 2015-02-21 11:09:07 · 1076 次点击 · 预计阅读时间 2 分钟 · 大约1分钟之前 开始浏览     这是一个创建于 2015-02-21 11:09:07 ...

  7. H264 层次构成[2]

    H264层次构成 H264标准是由JVT(Joint Video Team,视频联合工作组)组织提出的新一代数字视频编码标准.JVT于2001年12月在泰国Pattaya成立.它由ITU-T的VCEG ...

  8. Android7.0源码编译运行指南【转】

    见连接: http://blog.csdn.net/HardReceiver/article/details/52650303

  9. NSubstitute

    https://github.com/nsubstitute/NSubstitute http://nsubstitute.github.io/help/creating-a-substitute/

  10. 关于ExecuteNonQuery执行存储过程的返回值 、、实例讲解存储过程的返回值与传出参数、、、C#获取存储过程的 Return返回值和Output输出参数值

    关于ExecuteNonQuery执行存储过程的返回值 用到过ExecuteNonQuery()函数的朋友们在开发的时候肯定这么用过. if(cmd.ExecuteNonQuery("xxx ...