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在上面跑到时候就不必判断 ...
随机推荐
- C#实现的apache htpasswd加密
一.VisualSvn Server 这个软件大家都知道,具体使用时创建用户名密码和组时,每次都要登陆到VisualSvn Server所在的机器上,次次如此... 由于一些原因要把这个用户管理的功能 ...
- [转载] java多线程学习-java.util.concurrent详解(三)ScheduledThreadPoolExecutor
转载自http://janeky.iteye.com/blog/770441 ------------------------------------------------------------- ...
- EditText 限制输入整数和小数 的位数
如题,本文主要说的就是 如何限制 EditText 中 可输入整数和小数 的位数 . 近期,由于公司业务需求中有价格输入功能,给出的要求说是,必须整数能输入几位,小数能输入几位...好嘛,产品一句话 ...
- Python [习题] 文件操作:目录间copy 文件
[习题] 指定一个源文件,实现copy到目标目录.例如把/tmp/sample1.txt 拷贝到/tmp/sample2.txt原文件需要有读权限(默认rt权限),目标文件需要给写(w即可)权限. I ...
- Fedora 23建立wifi热点(Android手机可用)
在ubuntu14.04下使用ap-hotspot,速度还不错.但是在15.04下就用不了了,不知为啥.现在使用fedora23,在学校还是挺需要给手机连wifi的,于是google看看ap-hots ...
- tomcat集群日志切割和远程备份脚本分享
笔者一共有3台tomcat服务器,一共4个tomcat服务,未来还会增加4个作为负载,笔者想通过在存储服务器对tomcat服务的日志进行远程切割和备份到存储上. 文中采用清空日志的方式,优点是不用重启 ...
- C语言一些知识点总结
一.关键字 1. 什么是关键字 1> 关键字就是C语言提供的有特殊含义的符号,也叫做“保留字” 2> C语言一共提供了32个关键字,这些关键字都被C语言赋予了特殊含义 auto doubl ...
- 51Nod 1352 集合计数 扩展欧几里得
基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 给出N个固定集合{1,N},{2,N-1},{3,N-2},...,{N-1,2},{N,1}.求出有多少个集合满足 ...
- PHP求解一个值是否为质数
/** * 求解一个值是否为质数 * * @param $a * @return int 0是 1不是 */ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 function ...
- 计算rem
(function(doc, win) { var docEl = doc.documentElement, resizeEvt = 'orientationchange' in window ? ' ...