CF821B Okabe and Banana Trees
思路:
暴力枚举。
实现:
#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的更多相关文章
- 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根香蕉; 然后给你一 ...
- CF821 B. Okabe and Banana Trees 简单数学
Link 题意:给出一条直线,在直线上取一点,其垂直x,y轴作成一个,求矩阵中所有包含的点的x,y坐标之和的最大值. 思路:对于一个任意一点我们计算公式,对于任意一点$(x, y)$,有$(x+y)^ ...
- codeforces B. Okabe and Banana Trees 结论题
题目传送门 这道题 枚举一波y就好了 要求x,y整数 所以y最多1000个 然后算一波答案更新就好了 233 #include<cstdio> #include<cstring> ...
- #420 Div2 Problem B Okabe and Banana Trees (math && 暴力枚举)
题目链接 :http://codeforces.com/contest/821/problem/B 题意 :给出 m 和 b 表示在坐标轴上的一条直线 要求你在这条直线和x.y轴围成的区域中找出一个 ...
- Codeforces Round #420 (Div. 2)
/*************************************************************************************************** ...
- 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 ...
- Codeforces Round #420 (Div. 2) A-E
本来打算划划水洗洗睡了,突然听到这次的主人公是冈部伦太郎 石头门(<steins;gate>)主题的比赛,岂有不打之理! 石头门真的很棒啊!人设也好剧情也赞曲子也特别好听. 推荐http: ...
- codeforces round 420 div2 补题 CF 821 A-E
A Okabe and Future Gadget Laboratory 暴力 #include<bits/stdc++.h> using namespace std; typedef l ...
随机推荐
- HAProxy教程收集
市面上HA的教程不是很多,基本都是基于LVS+HA实践的打包资料. 要最权威的文档应该去官方. 官方文档入口: http://www.haproxy.org/#docs 中文文档收集: http:// ...
- 根据身份证号,取得行政区划的Javascript实现
原文:http://www.cnblogs.com/baibaluo/archive/2011/06/03/2071255.html#2585076 项目里需要一个根据身份证号,取得发证地行政区划的的 ...
- VS打包部署图文具体步骤及程序防卸载的制作(password验证卸载)
1. 在vs2010 选择"新建项目->"其它项目类型"->" Visual StudioInstallerà "安装项目": ...
- 比真机还快的Android模拟器——Genymotion
比真机还快的Android模拟器--Genymotion ----转载请注明出处:coder-p ...
- cout 堆栈,operator<< 运算符重载输出问题
在C++中cout的输出流其中,有一些问题非常easy出错,就比方以下这道简单程序.看似简单.但却是一个值得深思的问题~~ #include <iostream> using namesp ...
- SQL Server 海量数据查询代码优化以及建议
1.应尽量避免在 where 子句中对字段进行 null 值推断,否则将导致引擎放弃使用索引而进 行全表扫描,如: select id from t where num is nu ...
- APICloud平台的融云2.0集成
融云2.0的官方文档地址:http://docs.apicloud.com/端API/开放SDK/rongCloud2 项目须要IM模块,最后还是选择了融云.在iOS原生开发中,融云sdk集成了聊天界 ...
- HDU 5428 分解质因数
The F ...
- 【bzoj4602】[Sdoi2016]齿轮
dfs,连边,边权为比值,赋值搜索,遇到矛盾时退出 #include<algorithm> #include<iostream> #include<cstdlib> ...
- 特征列 属性值 获取 vowpal wabbit 生成DNN 的训练测试数据
用户特征文件 userFeature.data 每 行 代 表 一 个 用 户 的 特 征 数 据, 格 式 为: “uid|features”,uid 和 features 用竖线“|”分隔.其中 ...