题目传送门

这道题 枚举一波y就好了 要求x,y整数 所以y最多1000个 然后算一波答案更新就好了 233

#include<cstdio>
#include<cstring>
#include<algorithm>
#define LL long long
using namespace std;
LL read(){
LL ans=,f=,c=getchar();
while(c<''||c>''){if(c=='-') f=-; c=getchar();}
while(c>=''&&c<=''){ans=ans*+(c-''); c=getchar();}
return ans*f;
}
LL m,b,ans;
int main()
{
m=read(); b=read();
for(LL y=b;y>=;y--){
LL x=m*b-m*y;
LL sum1=(+x)*x*(y+)/,sum2=(+y)*y*(x+)/;
ans=max(ans,sum1+sum2);
}
printf("%lld\n",ans);
return ;
}

codeforces B. 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. #420 Div2 Problem B Okabe and Banana Trees (math && 暴力枚举)

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

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

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

  5. Codeforces 321D Ciel and Flipboard(结论题+枚举)

    题目链接   Ciel and Flipboard 题意  给出一个$n*n$的正方形,每个格子里有一个数,每次可以将一个大小为$x*x$的子正方形翻转 翻转的意义为该区域里的数都变成原来的相反数. ...

  6. CF821B Okabe and Banana Trees

    思路: 暴力枚举. 实现: #include <iostream> #include <cstdio> using namespace std; typedef long lo ...

  7. codeforces 1269D. Domino for Young (二分图证明/结论题)

    链接:https://codeforces.com/contest/1269/problem/D 题意:给一个不规则的网格,在上面放置多米诺骨牌,多米诺骨牌长度要么是1x2,要么是2x1大小,问最多放 ...

  8. [codevs5578][咸鱼]tarjan/结论题

    5578 咸鱼  时间限制: 1 s  空间限制: 128000 KB   题目描述 Description 在广袤的正方形土地上有n条水平的河流和m条垂直的河流,发达的咸鱼家族在m*n个河流交叉点都 ...

  9. BZOJ_1367_[Baltic2004]sequence_结论题+可并堆

    BZOJ_1367_[Baltic2004]sequence_结论题+可并堆 Description Input Output 一个整数R Sample Input 7 9 4 8 20 14 15 ...

随机推荐

  1. Apache 配置说明

    ServerRoot ServerRoot: The top of the directory tree under which the server's configuration, error, ...

  2. beanshell引用参数化数据

    步骤: 1.添加参数化组件CSV Data Set  Config: 2.添加beanshell preprocessor,引用变量: 验证: 2个线程,迭代2次,分别取了4个不同的值.

  3. gitbash避免每次push都输入密码

    gitbash每次提交都要输密码真有点头疼,所以就: 1 创建验证文件:touch  .git-credentials(windows) 2 编辑验证文件:vim  .git-credentials ...

  4. Django数据模型--字段详解

    一.字段 1.CharField: 字段数据类型为字符串 class Test(models.Model): test = models.CharField(max_length=) 2.Intege ...

  5. Visual Studio 2003安装包

    点击下载

  6. Understand:高效代码静态分析神器详解(一) | 墨香博客 http://www.codemx.cn/2016/04/30/Understand01/

    Understand:高效代码静态分析神器详解(一) | 墨香博客 http://www.codemx.cn/2016/04/30/Understand01/ ===== 之前用Windows系统,一 ...

  7. C#的internal访问修饰符

    文章:C# 访问修饰符internal的访问范围误区释疑 internal访问修饰符限定的类,只能在本程序集中访问.

  8. 【UML】状态图介绍

    1.Statechart Diagram 即状态图,主要用于描述一个对象在其生存期间的动态行为,表现为一个对象所经历的状态序列.引起状态转移的事件(Event).因状态转移而伴随的动作(Action) ...

  9. OSCache页面缓存的使用

    完成项目时,为了减少对数据库的频繁操作,引出了缓存,缓存分为以下几种: 1.一级缓存 一级缓存的存储域是session,作用于单个的dao 2.二级缓存 二级缓存的存储域是sessionFactory ...

  10. mplab c30 注册方法

    http://blog.csdn.net/q553716434/article/details/7459036 关键文件是: C:\Program Files\Microchip\MPLAB C30\ ...