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
Uva 01124, POJ 3062 Celebrity jeopardy的更多相关文章
- Poj 3062 Celebrity jeopardy
1.Link: http://poj.org/problem?id=3062 2.Content: Celebrity jeopardy Time Limit: 1000MS Memory Lim ...
- TJU Problem 2548 Celebrity jeopardy
下次不要被长题目吓到,其实不一定难. 先看输入输出,再揣测题意. 原文: 2548. Celebrity jeopardy Time Limit: 1.0 Seconds Memory Lim ...
- 括号序列问题 uva 1626 poj 1141【区间dp】
首先考虑下面的问题:Code[VS] 3657 我们用以下规则定义一个合法的括号序列: (1)空序列是合法的 (2)假如S是一个合法的序列,则 (S) 和[S]都是合法的 (3)假如A 和 B 都是合 ...
- UVA 820 --- POJ 1273 最大流
找了好久这两个的区别...UVA820 WA了 好多次.不过以后就做模板了,可以求任意两点之间的最大流. UVA 是无向图,因此可能有重边,POJ 1273是有向图,而且是单源点求最大流,因此改模板的 ...
- uva 101 POJ 1208 The Blocks Problem 木块问题 vector模拟
挺水的模拟题,刚开始题目看错了,poj竟然过了...无奈.uva果断wa了 搞清题目意思后改了一下,过了uva. 题目要求模拟木块移动: 有n(0<n<25)快block,有5种操作: m ...
- 开篇,UVA 755 && POJ 1002 487--3279 (Trie + DFS / sort)
博客第一篇写在11月1号,果然die die die die die alone~ 一道不太难的题,白书里被放到排序这一节,半年前用快排A过一次,但是现在做的时候发现可以用字典树加深搜,于是乐呵呵的开 ...
- UVa 10405 & POJ 1458 Longest Common Subsequence
求最长公共子序列LCS,用动态规划求解. UVa的字符串可能含有空格,开始用scanf("%s", s);就WA了一次...那就用gets吧,怪不得要一行放一个字符串呢. (本来想 ...
- POJ - 3062 Borg Maze
题目链接:http://poj.org/problem?id=3026 Svenskt Masterskap我程序员/ Norgesmesterskapet 2001 Description The ...
- uva 1601 poj 3523 Morning after holloween 万圣节后的早晨 (经典搜索,双向bfs+预处理优化+状态压缩位运算)
这题数据大容易TLE 优化:预处理, 可以先枚举出5^3的状态然后判断合不合法,但是由于题目说了有很多墙壁,实际上没有那么多要转移的状态那么可以把底图抽出来,然后3个ghost在上面跑到时候就不必判断 ...
随机推荐
- Anaconda快捷搭建Python2和Python3环境
我们在使用Pycharm编辑Python程序经常会因为不熟悉Python2和Python3的一些代码区别而导致错误,我们知道他们之间很多代码是必须运行在对应版本中的,否则是会报错的.因此,本文介绍一个 ...
- Mybatis框架的搭建和基本使用方法
1.1MyBatis的下载 最新yBatis可以在github官网上下载: https://github.com/mybatis/mybatis-3 1.2 Mybatis Jar包 1.3MyBat ...
- Win10下Docker学习(1)安装
Docker简介 Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化.容器是完全使用沙箱机制, ...
- [转载] ConcurrentHashMap原理分析
转载自http://blog.csdn.net/liuzhengkang/article/details/2916620 集合是编程中最常用的数据结构.而谈到并发,几乎总是离不开集合这类高级数据结构的 ...
- List实现
1.元素添加 #include <stdio.h> #include <stdlib.h> struct ListNode{ struct ListNode* next; in ...
- 2017/10/10 jar包错误
Description Resource Path Location Type Archive for required library: 'WebContent/WEB-IN ...
- 基于MyBatis的数据服务接口
背景 作为软件系统开发,数据操作是系统开发不可避免的一个重要组成部分.因为其重要性围绕着数据操作也出现了众多框架.成熟框架是为了普适众多数据操作要求的,因此为了更好的实现技术落地,需要对框架进行丰富和 ...
- django作业2
管理后台 1.登陆Form 2.Session (用装饰器实现) 3.装饰器 4.主机,主机组 添加(主机,主机组) 删除 修改 查询
- 【Java】单词倒序输出
如何将一段单词倒序输出?把"Hello Java Hello China"变成"China Hello Java Hello"? 看起来好像很简单,只需要把字符 ...
- [最短路]P1339 [USACO09OCT]热浪Heat Wave
题目描述 The good folks in Texas are having a heatwave this summer. Their Texas Longhorn cows make for g ...