zoukankan      html  css  js  c++  java
  • 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. Speci cally, 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 de ned 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

  • 相关阅读:
    Linux下wget下载软件小技巧以及安装jdk、tomcat与ftp服务器
    C++计算二叉树的节点数和高度
    转:POST 400 Bad Request The request sent by the client was syntactically incorrect
    SSM项目spring配置文件详细步骤(分门别类、灵巧记忆)
    IntelliJ IDEA里找不到javax.servlet的jar包
    51nod 1533 && CF538F
    51nod 1189
    51nod 1225
    51nod 1040
    51nod 1610
  • 原文地址:https://www.cnblogs.com/foxblogs/p/7708067.html
Copyright © 2011-2022 走看看