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 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 partici-
pants 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. Specically, you have to
write a program which nds 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 dened unambiguously several different ways leading to the same path of resolution.
For now, nd 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; X2 = 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
======================================================================================================================
这题是在Steven Halim 的 Competitive Programming 3 的 Uva oj 题目列表中属于 super simple,一开始看题目中也出现各种simple,然而看完题目有点懵。
大意是输入键值对,对每一行 ,输出符合这个键值对的 最简 代数系统。
然后我的脑子里全是 贵族 怎么这么笨,代数系统具体是什么东西... 后来查题号,并没有人写了这题,最后查题名,发现POJ也有这一题,有大神给出了解答,但是没有很好地解释原因。
这题主要在与其背景长,废话多,而且还有example的误导,实质上就是把键值对转化成等式 (键值对是一个等式的另一种形式),根本上就是怎么输入怎么输出。
#include<stdio.h> int main(){ char c; while( (c = getchar() )!= EOF) printf("%c",c); return 0; }
有同学有更好的想法,欢迎邮件ethanxlj@foxmail.com