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 =============================以下是最小生成树+并 ...
随机推荐
- Java中for循环以及循环中标签
1.第一种,通过迭代的方式 File[] listFiles = file.listFiles(); for (Iterator iterator = files.iterator(); iterat ...
- VC++制作DLL具体解释
1. DLL的基本概念 应用程序(exe)要引用目标代码(.obj)外部的函数时,有两种实现途径--静态链接和动态链接. 1. 静态链接 链接程序搜索相应的库文件(.lib),然后将这个对 ...
- 赵雅智_Fragment生命周期
官网帮助文档链接: http://developer.android.com/guide/components/fragments.html 主要看两张图.和跑代码 一,Fragment的生命周 w ...
- 在Linux里设置环境变量的方法(export PATH)
一般来说,配置交叉编译工具链的时候需要指定编译工具的路径,此时就需要设置环境变量.例如我的mips-linux-gcc编译器在“/opt/au1200_rm/build_tools/bin”目录下,b ...
- PAT 1021
1021. Deepest Root (25) A graph which is connected and acyclic can be considered a tree. The height ...
- PHP设计模式之策略模式
前提: 在软件开发中也常常遇到类似的情况,实现某一个功能有多种算法或者策略,我们可以根据环境或者条件的不同选择不同的算法或者策略来完成该功能.如查 找.排序等,一种常用的方法是硬编码(Hard Cod ...
- log4j个人使用整理
Log4j介绍: 略过. 配置: Eclipse项目中添加log4j.jar到lib下. 在bin目录下新建log4j.properties,编辑好log4j配置文件. 样例分析: log4j.roo ...
- python打印详细的异常信息
#!/usr/bin/env python #coding=utf-8 import traceback try: 1/0 except Exception, e: print e print tra ...
- Android快速开发框架ZBLibrary源码分享
坐标标准库ZBLibrary,是一个MVP架构的Android快速开发框架,提供一套开发标准(UI,Data,Listener)以及模板和工具类并规范代码. 封装层级少,简单高效兼容性好.Androi ...
- 分享一个java线程专栏
专栏 : java线程基础 转载自 http://blog.csdn.net/column/details/yinwenjiethread.html 专栏内容: 1.线程基础:线程(1)--操作系统和 ...