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 ...
随机推荐
- 《高性能SQL调优精要与案例解析》一书谈主流关系库SQL调优(SQL TUNING或SQL优化)核心机制之——索引(index)
继<高性能SQL调优精要与案例解析>一书谈SQL调优(SQL TUNING或SQL优化),我们今天就谈谈各主流关系库中,占据SQL调优技术和工作半壁江山的.最重要的核心机制之一——索引(i ...
- MySQL自带功能介绍
前言: 数据库相关的操作 1.SQL语句 *****(MySql(一)已经介绍): 2.利用mysql内部提供的功能(视图.触发器.函数.存储过程: 一.视图: 把经常使用的查询结果,做成临时视图表, ...
- ISO/OSI七层网络参考模型、TCP/IP四层网络模型和教学五层网络模型
一.说明 直接的原因是昨晚<计算机网络(自顶向下方法)>到货了,以为能讲得有些不一样,但看完整本也就是老调地讲过来讲应用层.传输层.网络层.网络接口层.感觉比之谢希仁的<计算机网络& ...
- php删除文件夹下面所有文件包括(删除文件夹)不删除文件夹
function deldir($dir) { //先删除目录下的文件: $dh=opendir($dir); while ($file=readdir($dh)) { if($file!=" ...
- linux nginx 添加到全局变量中(环境变量)
ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/ /usr/local/bin/就是环境变量目录
- ubuntu启用root登陆
ubuntu系统不能够默认以root用户登陆系统如果你为了方便开发想每次登陆的时候以root用户登陆那么需要手动的做写更改打开终端 首先输入命令 sudo passwd root更新你的密码然后输入 ...
- html盒子水平和垂直居中
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- 服务消费和负载(Ribbon)
使用RestTemplate调用服务 在上一篇教程中,我们是这样调用服务的,先通过 LoadBalancerClient 选取出对应的服务,然后使用 RestTemplate 进行远程调用. Load ...
- [BZOJ3173]最长上升子序列
Problem 给你n个数A1~An,每次将i插入第Ai位后,最后输出每次插入后这个数列的最长上升子序列 Solution 这道题非常的妙.首先如果新加入的这个数构成了最长上升子序列,由于在它插入之前 ...
- TiDB 深度实践之旅--真实“踩坑”经历
美团点评 TiDB 深度实践之旅(9000 字长文 / 真实“踩坑”经历) 4 PingCAP · 154 天前 · 3956 次点击 这是一个创建于 154 天前的主题,其中的信息可能已经有所发 ...