Poj 3062 Celebrity jeopardy
1.Link:
http://poj.org/problem?id=3062
2.Content:
Celebrity jeopardy
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15015 Accepted: 8471 Description
It's hard to construct a problem that's so easy that everyone 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 elebrities, 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=9Sample Output
Y = 3
X=9Source
3.Method:
4.Code:
#include<iostream>
#include <cstdio>
using namespace std;
int main()
{
char a[];
while(gets(a)) puts(a);
return ;
}
5.Reference:
Poj 3062 Celebrity jeopardy的更多相关文章
- 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 2548 Celebrity jeopardy
下次不要被长题目吓到,其实不一定难. 先看输入输出,再揣测题意. 原文: 2548. Celebrity jeopardy Time Limit: 1.0 Seconds Memory Lim ...
- POJ - 3062 Borg Maze
题目链接:http://poj.org/problem?id=3026 Svenskt Masterskap我程序员/ Norgesmesterskapet 2001 Description The ...
- 【POJ 3062】Party(2-SAT、tarjan)
2-SAT的入门题. a,a',b,b'分别表示两对夫妇,如果a,b有矛盾,那么a要来,就只能来b',b要来,就只能来a'.于是建了两条边(a,b'),(b,a'). 用tarjan强连通分量缩点染色 ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- POJ解题经验交流
感谢范意凯.陈申奥.庞可.杭业晟.王飞飏.周俊豪.沈逸轩等同学的收集整理. 题号:1003 Hangover求1/2+1/3+...1/n的和,问需多少项的和能超过给定的值 类似于Zerojudg ...
- 算法之路 level 01 problem set
2992.357000 1000 A+B Problem1214.840000 1002 487-32791070.603000 1004 Financial Management880.192000 ...
- HDU 3062 && HDU 1824 && POJ 3678 && BZOJ 1997 2-SAT
一条边<u,v>表示u选那么v一定被选. #include <iostream> #include <cstring> #include <cstdio> ...
- 【转载】图论 500题——主要为hdu/poj/zoj
转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并 ...
随机推荐
- Spark Core源代码分析: Spark任务运行模型
DAGScheduler 面向stage的调度层,为job生成以stage组成的DAG,提交TaskSet给TaskScheduler运行. 每个Stage内,都是独立的tasks,他们共同运行同一个 ...
- 升级、备份红帽PaaS openshift 上的 wordpress
红帽提供了一个很稳定的PAAS服务平台:openshift!此博客即作为wordpress建在里面. 这里记录怎样升级与备份wordpress. 预备: 安装 openshift command li ...
- [Angular 2] Create Shareable Angular 2 Components
Components that you use across multiple applications need to follow a module pattern that keeps them ...
- iOS开发——面试总结(一)
面试总结(一) 通过网络搜寻和自己总结经历找了一些IOS面试经常被问道的问题: 1.搞清楚touch事件的传递(事件的响应链) 事件的响应(responder chain) 只有继承了UIRespon ...
- JS原型连
[推荐]关于JS中的constructor与prototype[转] 最初对js中 object.constructor 的认识: 在学习JS的面向对象过程中,一直对constructor与proto ...
- PHP泛域名应用
以Windows开发环境 1.windows =>hosts文件 127.0.0.1 asia.t127.0.0.1 *.asia.t127.0.0.1 www.asia.t1 ...
- 小米2及其他Android手机无法连接mac解决方案
一般的android连接mac 很方便不用安装驱动就可以啦,可是不知道为什么二般情况下有的android手机(小米2,华为等)就是连接不上,下来就说说二般情况下如何连接. 1.关于本机-->更多 ...
- [ZZ]C++中,引用和指针的区别
(1) 引用总是指向一个对象,没有所谓的 null reference .所有当有可能指向一个对象也由可能不指向对象则必须使用 指针. 由于C++ 要求 reference 总是指向一个对象所以 re ...
- Android中this.*与*.this还有*.class的区别是什么?
这些是java的基础知识.首先this代表本类的一个引用,this.*表示调用本类的某个方法,这个时候通常可以省略this:但在内部类中不能省略,否则编译器会认为是内部类的引用,所以要在this前加上 ...
- Android studio设置参数提示
在Android studio的使用的过程中,那么就需要对当前的代码显示当前的方式做一个的提示信息,那么可以通过Android studio的的设置的方法,来对Android studio方法的提示显 ...