ural 2066. Simple Expression
2066. Simple Expression
Memory limit: 64 MB
Input
Output
Sample
| input | output |
|---|---|
1 |
-5 |
Problem Source: Ural Regional School Programming Contest 2015
#include <iostream>
using namespace std;
typedef long long LL;
int main()
{
ios::sync_with_stdio();
LL a, b, c;
cin >> a >> b >> c;
LL ans = a + b + c;
ans = min(ans, a + b - c);
ans = min(ans, a + b * c);
ans = min(ans, a * b + c);
ans = min(ans, a * b - c);
ans = min(ans, a * b * c);
ans = min(ans, a - b + c);
ans = min(ans, a - b - c);
ans = min(ans, a - b * c);
cout << ans << endl;
return ;
}
ural 2066. Simple Expression的更多相关文章
- URAL 2066 Simple Expression (水题,暴力)
题意:给定三个数,让你放上+-*三种符号,使得他们的值最小. 析:没什么好说的,全算一下就好.肯定用不到加,因为是非负数. 代码如下: #pragma comment(linker, "/S ...
- Simple Expression
Description You probably know that Alex is a very serious mathematician and he likes to solve seriou ...
- Ural 2003: Simple Magic(数论&思维)
Do you think that magic is simple? That some hand-waving and muttering incomprehensible blubber is e ...
- Expression Tree Basics 表达式树原理
variable point to code variable expression tree data structure lamda expression anonymous function 原 ...
- Evaluation of Expression Tree
Evaluation of Expression Tree Given a simple expression tree, consisting of basic binary operators i ...
- ElasticSearch 5学习(2)——Kibana+X-Pack介绍使用(全)
Kibana是一个为 ElasticSearch 提供的数据分析的 Web 接口.可使用它对日志进行高效的搜索.可视化.分析等各种操作.Kibana目前最新的版本5.0.2,回顾一下Kibana 3和 ...
- [LeetCode] Basic Calculator II 基本计算器之二
Implement a basic calculator to evaluate a simple expression string. The expression string contains ...
- [LeetCode] Basic Calculator 基本计算器
Implement a basic calculator to evaluate a simple expression string. The expression string may conta ...
- Basic Calculator II
Implement a basic calculator to evaluate a simple expression string. The expression string contains ...
随机推荐
- vector reserve与resize区别
vector 的reserve增加了vector的capacity,但是它的size没有改变!而resize改变了vector的capacity同时也增加了它的size!原因如下:reserve是容器 ...
- poj1417(种类并查集+dp)
题目:http://poj.org/problem?id=1417 题意:输入三个数m, p, q 分别表示接下来的输入行数,天使数目,恶魔数目: 接下来m行输入形如x, y, ch,ch为yes表示 ...
- hdu 2020
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2020 思路:优先队列水过priority_queue #include <cstdio> ...
- redis 列出所有的键
> KEYS * (empty list or set)
- .NET Expression Tree
Expression Tree 第一个简单的例子. [TestMethod] public void GodTest() { Expression<Func<int, int, int&g ...
- cordova+angularJS+ionic
1.创建项目 2.路由 angular.module("starter",['ionic']) // 依赖 ionic 提供的ui-router .config(function ...
- angularjs 菜鸟教程 版本1.4.6
最简angularJS webstorm代码提示 在 head 里面添加:<script src="https://ajax.googleapis.com/ajax/libs/angu ...
- PHP商品秒杀计时实现(解决大流量方案)
PHP商品秒杀功能我们多半以整点或时间点为例子,这样对于php来说处理不复杂,但有一个问题就是如果流量大要如何来处理,下面我们一起来看看解决办法. 要求要有小时分钟秒的实时倒计时的显示,用户端修改日期 ...
- hdu 5000 dp **
题目中提到 It guarantees that the sum of T[i] in each test case is no more than 2000 and 1 <= T[i]. 加 ...
- 深入剖析iLBC的丢包补偿技术(PLC)
转自:http://blog.csdn.net/wanggp_2007/article/details/5136609 丢包补偿技术(Packet Loss Concealment——PLC)是iLB ...