1. Link:
Http://poj.org/problem? Id = 3062
2. content:
Celebrity Jeopardy
Time limit:1000 ms |
|
Memory limit:65536 K |
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 participates ipants 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 cocould 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 wocould to lead to the provided solution, respecting the use of space exactly as in the input.
Sample Input
Y = 3X=9
Sample output
Y = 3X=9
Source
Southeastern Europe 2006
3. Method:
4. Code:
1 #include<iostream>2 #include <cstdio>3 using namespace std;4 int main()5 {6 char a[100];7 while(gets(a)) puts(a);8 return 0;9 }
5. Reference:
Poj 3062 celebrity Jeopardy