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=9

Sample Output

Y = 3
X=9

Source

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的更多相关文章

  1. 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 ...

  2. TJU Problem 2548 Celebrity jeopardy

    下次不要被长题目吓到,其实不一定难. 先看输入输出,再揣测题意. 原文: 2548.   Celebrity jeopardy Time Limit: 1.0 Seconds   Memory Lim ...

  3. POJ - 3062 Borg Maze

    题目链接:http://poj.org/problem?id=3026 Svenskt Masterskap我程序员/ Norgesmesterskapet 2001 Description The ...

  4. 【POJ 3062】Party(2-SAT、tarjan)

    2-SAT的入门题. a,a',b,b'分别表示两对夫妇,如果a,b有矛盾,那么a要来,就只能来b',b要来,就只能来a'.于是建了两条边(a,b'),(b,a'). 用tarjan强连通分量缩点染色 ...

  5. 【转】POJ百道水题列表

    以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...

  6. POJ解题经验交流

    感谢范意凯.陈申奥.庞可.杭业晟.王飞飏.周俊豪.沈逸轩等同学的收集整理.   题号:1003 Hangover求1/2+1/3+...1/n的和,问需多少项的和能超过给定的值 类似于Zerojudg ...

  7. 算法之路 level 01 problem set

    2992.357000 1000 A+B Problem1214.840000 1002 487-32791070.603000 1004 Financial Management880.192000 ...

  8. HDU 3062 && HDU 1824 && POJ 3678 && BZOJ 1997 2-SAT

    一条边<u,v>表示u选那么v一定被选. #include <iostream> #include <cstring> #include <cstdio> ...

  9. 【转载】图论 500题——主要为hdu/poj/zoj

    转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并 ...

随机推荐

  1. TreeView

    添加项目 TreeView1.Items.Add(nil,'ABC');       删除选中的节点 TreeView1.Selected.Delete;   删除鼠标右键选中的节点   var    ...

  2. 创建MySQL从库

    我们知道Oracle有DataGuard实时备份数据.能够做主备切换,而MySQL也有自己的一套备库方案.称之为主从复制. 搭建MySQL从库是为了实时同步主库数据,同一时候也能够分担主库的读压力.对 ...

  3. Android 4.1源码编译找不到资源文件解决办法

    我们在Android framework中修改资源文件时,在Android 4.0之前,都是直接在sourcecode/frameworks/base/core/res/res下面添加对应的资源文件, ...

  4. iOS开发——实用篇Swift篇&项目开发常用实用技术

    项目开发常用实用技术 实现拨打电话 要实现打电话功能,最简单最直接的方式便是:直接跳到拨号界面 (注意:这个需要真机调试,模拟器无效果)     UIApplication.sharedApplica ...

  5. SQL SERVER NULL值和连接注意问题

    联接表的列中的 null 值(如果有)互相不匹配.如果其中一个联接表的列中出现空值,只能通过外部联接返回这些空值(除非 WHERE 子句不包括空值).   下面的两个表中,每个表中要参与联接的列中均包 ...

  6. 一般php创建的文件默认不是utf-8格式的,在网上搜罗的解决办法如下:

    1.PHP本身是无编码的,所有的字符串通常都视为二进制流.因此只需要输入的字符串为Utf-8即可.若字符串采用其他编码,可以使用iconv系列函数转换编码. 2.注$content = iconv(& ...

  7. Qt设置horizontal line 和vertical line 的颜色

    Qt的horizontal line 和vertical line 是由QFame实现的 QFrame *line = new QFrame(this); line->setGeometry(Q ...

  8. poj3080解题报告(暴力、最大公共子串)

    POJ 3080,题目链接http://poj.org/problem?id=3080 题意: 就是求m个长度为60的字符串的最长连续公共子串,2<=m<=10 规定: 1.最长公共串长度 ...

  9. Volly的使用及图片错位优化

    listview显示数据,利用第三方jar包Volley下的ImageLoader加载图片时,当数据类型不一致,布局复用的时候会出现图片错位,因此需要自定义IMymageLoader实现ImageLo ...

  10. Python 基础【第四篇】参数

    程序运行避免不了需要一些参数来支持 那么如何让程序接收参数呢?这里先简单的用sys模块的参数 sys.argv[]方法来实现参数获取 1.用法: import sys   //导入sys模块后期会详细 ...