codeforces B. Okabe and Banana Trees 结论题
这道题 枚举一波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 结论题的更多相关文章
- 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 ...
- 【Codeforces Round #420 (Div. 2) B】Okabe and Banana Trees
[题目链接]:http://codeforces.com/contest/821/problem/B [题意] 当(x,y)这个坐标中,x和y都为整数的时候; 这个坐标上会有x+y根香蕉; 然后给你一 ...
- #420 Div2 Problem B Okabe and Banana Trees (math && 暴力枚举)
题目链接 :http://codeforces.com/contest/821/problem/B 题意 :给出 m 和 b 表示在坐标轴上的一条直线 要求你在这条直线和x.y轴围成的区域中找出一个 ...
- CF821 B. Okabe and Banana Trees 简单数学
Link 题意:给出一条直线,在直线上取一点,其垂直x,y轴作成一个,求矩阵中所有包含的点的x,y坐标之和的最大值. 思路:对于一个任意一点我们计算公式,对于任意一点$(x, y)$,有$(x+y)^ ...
- Codeforces 321D Ciel and Flipboard(结论题+枚举)
题目链接 Ciel and Flipboard 题意 给出一个$n*n$的正方形,每个格子里有一个数,每次可以将一个大小为$x*x$的子正方形翻转 翻转的意义为该区域里的数都变成原来的相反数. ...
- CF821B Okabe and Banana Trees
思路: 暴力枚举. 实现: #include <iostream> #include <cstdio> using namespace std; typedef long lo ...
- codeforces 1269D. Domino for Young (二分图证明/结论题)
链接:https://codeforces.com/contest/1269/problem/D 题意:给一个不规则的网格,在上面放置多米诺骨牌,多米诺骨牌长度要么是1x2,要么是2x1大小,问最多放 ...
- [codevs5578][咸鱼]tarjan/结论题
5578 咸鱼 时间限制: 1 s 空间限制: 128000 KB 题目描述 Description 在广袤的正方形土地上有n条水平的河流和m条垂直的河流,发达的咸鱼家族在m*n个河流交叉点都 ...
- BZOJ_1367_[Baltic2004]sequence_结论题+可并堆
BZOJ_1367_[Baltic2004]sequence_结论题+可并堆 Description Input Output 一个整数R Sample Input 7 9 4 8 20 14 15 ...
随机推荐
- Apache 配置说明
ServerRoot ServerRoot: The top of the directory tree under which the server's configuration, error, ...
- beanshell引用参数化数据
步骤: 1.添加参数化组件CSV Data Set Config: 2.添加beanshell preprocessor,引用变量: 验证: 2个线程,迭代2次,分别取了4个不同的值.
- gitbash避免每次push都输入密码
gitbash每次提交都要输密码真有点头疼,所以就: 1 创建验证文件:touch .git-credentials(windows) 2 编辑验证文件:vim .git-credentials ...
- Django数据模型--字段详解
一.字段 1.CharField: 字段数据类型为字符串 class Test(models.Model): test = models.CharField(max_length=) 2.Intege ...
- Visual Studio 2003安装包
点击下载
- Understand:高效代码静态分析神器详解(一) | 墨香博客 http://www.codemx.cn/2016/04/30/Understand01/
Understand:高效代码静态分析神器详解(一) | 墨香博客 http://www.codemx.cn/2016/04/30/Understand01/ ===== 之前用Windows系统,一 ...
- C#的internal访问修饰符
文章:C# 访问修饰符internal的访问范围误区释疑 internal访问修饰符限定的类,只能在本程序集中访问.
- 【UML】状态图介绍
1.Statechart Diagram 即状态图,主要用于描述一个对象在其生存期间的动态行为,表现为一个对象所经历的状态序列.引起状态转移的事件(Event).因状态转移而伴随的动作(Action) ...
- OSCache页面缓存的使用
完成项目时,为了减少对数据库的频繁操作,引出了缓存,缓存分为以下几种: 1.一级缓存 一级缓存的存储域是session,作用于单个的dao 2.二级缓存 二级缓存的存储域是sessionFactory ...
- mplab c30 注册方法
http://blog.csdn.net/q553716434/article/details/7459036 关键文件是: C:\Program Files\Microchip\MPLAB C30\ ...