TJU Problem 2548 Celebrity jeopardy
下次不要被长题目吓到,其实不一定难。
先看输入输出,再揣测题意。
原文:
2548. Celebrity jeopardy
Time Limit: 1.0 Seconds Memory Limit: 65536K
Total Runs: 1306 Accepted Runs: 898
will get it, yet still difficult enough to be worthy of some respect. Usually,
we err on one side or the other. How simple can a problem really be?
Here, as in Celebrity Jepoardy, questions and answers are a bit confused,
and, because the participants are celebrities, there's a real need to make the
challenges simple. Your program needs to prepare a question to be solved --- an
equation to be solved --- given the answer. Specifically, you have to write a
program which finds the simplest possible equation to be solved given the
answer, considering all possible equations using the standard mathematical
symbols in the usual manner. In this context, simplest can be defined
unambiguously several different ways leading to the same path of resolution. For
now, find the equation whose transformation into the desired answer requires the
least effort.
For example, given the answer X = 2, you might create the equation 9 - X = 7.
Alternately, you could build the system X > 0; X^2 = 4. These may not be the
simplest possible equations. Solving these mind-scratchers might be hard for a
celebrity.
Input
Each input line contains a solution in the form <symbol> =
<value>
Output
For each input line, print the simplest system of equations which would to
lead to the provided solution, respecting the use of space exactly as in the
input.
Sample Input
Y = 3
X=9
Sample Output
Y = 3
X=9
Source: Southeastern
European 2006
源代码:
#include <iostream>
#include <string>
using namespace std; int main() {
string aaa;
while (getline(cin, aaa)) {
cout << aaa << endl;
}
return ;
}
TJU Problem 2548 Celebrity jeopardy的更多相关文章
- Poj 3062 Celebrity jeopardy
1.Link: http://poj.org/problem?id=3062 2.Content: Celebrity jeopardy Time Limit: 1000MS Memory Lim ...
- Problem C: Celebrity Split
题目描写叙述 Problem C: Celebrity Split Jack and Jill have decided to separate and divide their property e ...
- Uva 01124, POJ 3062 Celebrity jeopardy
It's hard to construct a problem that's so easy that everyone will get it, yet still difficult enoug ...
- TJU Problem 2101 Bullseye
注意代码中: result1 << " to " << result2 << ", PLAYER 1 WINS."<& ...
- TJU Problem 2857 Digit Sorting
原题: 2857. Digit Sorting Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 3234 Accepted ...
- TJU Problem 1015 Gridland
最重要的是找规律. 下面是引用 http://blog.sina.com.cn/s/blog_4dc813b20100snyv.html 的讲解: 做这题时,千万不要被那个图给吓着了,其实这题就是道简 ...
- TJU Problem 1065 Factorial
注意数据范围,十位数以上就可以考虑long long 了,断点调试也十分重要. 原题: 1065. Factorial Time Limit: 1.0 Seconds Memory Limit ...
- TJU Problem 1100 Pi
注: 1. 对于double计算,一定要小心,必要时把与double计算相关的所有都变成double型. 2. for (int i = 0; i < N; i++) //N 不 ...
- TJU Problem 2520 Quicksum
注意: for (int i = 1; i <= aaa.length(); i++) 其中是“ i <= ",注意等号. 原题: 2520. Quicksum Time L ...
随机推荐
- Vue中 computed 和 methods的区别
涉及到计算部分的时候,计算属性是基于它们的依赖进行缓存的,如果说值不变,那么它就不会去重新执行,只有当值发生了改变,它才会去重新执行一次,其它时候它都是缓存的.而方法则会反复计算处理.二者之间的差距就 ...
- CentOS配置教程
1.配置网卡开机自动启动 查看/etc/sysconfig/network-scripts/ifcfg-eth0的初始内容: cat /etc/sysconfig/network-scripts/if ...
- Spring之缓存注解@Cacheable
https://www.cnblogs.com/fashflying/p/6908028.html https://blog.csdn.net/syani/article/details/522399 ...
- 事务隔离级别引发的"血案"
事务引发的"血案"见的多了也麻木了,这回遇到个事务隔离级别的"案子",坑了我小半天的时间...也怪自己细节不牢.. 敲着代码遇到这么一个怪事情: class X ...
- static与全局变量区别
作用域不同: 全局变量是不显式用static修饰的全局变量,但全局变量默认是动态的,作用域是整个工程,在一个文件内定义的全局变量,在另一个文件中,通过extern 全局变量名的声明,就可以使用全局变量 ...
- Win10系列:VC++绘制几何图形5
打开D2DBasicAnimation.h头文件,并在D2DBasicAnimation类中添加如下的代码: private: //声明成员变量point D2D1_POINT_2F ...
- Win10系列:VC++媒体播放控制2
(3)停止视频播放 接下来添加对视频文件播放的停止控制,打开MainPage.xaml文件,并在Grid元素中添加一个"停止"按钮,用于停止视频的播放,代码如下所示: <Bu ...
- Java冒泡排序与选择排序
Java排序: 一.冒泡排序算法的运作如下: 比较相邻的元素.如果第一个比第二个大,就交换他们两个. 对每一对相邻元素作同样的工作,从开始第一对到结尾的最后一对.在这一点,最后的元素应该会是最大的数. ...
- day2-python工具的选择使用
Python 编辑工具的选择 在Python的交互式命令行写程序,好处是一下就能得到结果,坏处是没法保存,下次还想运行的时候,还得再敲一遍. 所以,实际开发的时候,我们总是使用一个编辑器来写代码,写完 ...
- 每天CSS学习之caption-side
caption-side是CSS2的属性,其作用是规定标题的位置在表格的上面还是下面. 1.top:默认值,将表格标题定位在表格之上.如下例子: caption{ caption-side:top; ...