TJU Problem 2548 Celebrity jeopardy
下次不要被长题目吓到,其实不一定难。
先看输入输出,再揣测题意。
原文:
2548. Celebrity jeopardy
Time Limit: 1.0 Seconds Memory Limit: 65536K
Total Runs: 1306 Accepted Runs: 898
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 participants 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. 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 could 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 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
Source: Southeastern
European 2006
源代码:
#include <iostream>
#include <string>
using namespace std; int main() {
string aaa;
while (getline(cin, aaa)) {
cout << aaa << endl;
}
return ;
}
TJU Problem 2548 Celebrity jeopardy的更多相关文章
- Poj 3062 Celebrity jeopardy
1.Link: http://poj.org/problem?id=3062 2.Content: Celebrity jeopardy Time Limit: 1000MS Memory Lim ...
- Problem C: Celebrity Split
题目描写叙述 Problem C: Celebrity Split Jack and Jill have decided to separate and divide their property e ...
- 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 enoug ...
- TJU Problem 2101 Bullseye
注意代码中: result1 << " to " << result2 << ", PLAYER 1 WINS."<& ...
- TJU Problem 2857 Digit Sorting
原题: 2857. Digit Sorting Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 3234 Accepted ...
- TJU Problem 1015 Gridland
最重要的是找规律. 下面是引用 http://blog.sina.com.cn/s/blog_4dc813b20100snyv.html 的讲解: 做这题时,千万不要被那个图给吓着了,其实这题就是道简 ...
- TJU Problem 1065 Factorial
注意数据范围,十位数以上就可以考虑long long 了,断点调试也十分重要. 原题: 1065. Factorial Time Limit: 1.0 Seconds Memory Limit ...
- TJU Problem 1100 Pi
注: 1. 对于double计算,一定要小心,必要时把与double计算相关的所有都变成double型. 2. for (int i = 0; i < N; i++) //N 不 ...
- TJU Problem 2520 Quicksum
注意: for (int i = 1; i <= aaa.length(); i++) 其中是“ i <= ",注意等号. 原题: 2520. Quicksum Time L ...
随机推荐
- iOS block 机制
本文要将block的以下机制,并配合具体代码详细描述: block 与 外部变量 block 的存储域:栈块.堆块.全局块 定义 块与函数类似,只不过是直接定义在另一个函数里,和定义它的那个函数共享同 ...
- [LeetCode] 231. Power of Two ☆(是否2 的幂)
描述 Given an integer, write a function to determine if it is a power of two. 给定一个整数,编写一个函数来判断它是否是 2 的 ...
- Dagger2不自动生成daggerXXXcomponent
在Fragment里面初始化dagger2创建对象时,不自动生成daggerXXXcomponent. 百思不得其解,后来发现是import android.app.Fragment;所以不自动生成. ...
- JDK自带的keytool证书工具详解
一.生成证书 keytool -genkey -alias tomcat -keyalg RSA -keystore D:/tomcat.keystore -keypass 123456 -store ...
- Introduction to Cryto & Crptocurrencies Lecture 1
Lecture 1.2 Hash Pointer & Data Structure Use Case 1. 什么是Block Chain呢? 想象一个像链表一样的结构,只不过与通常的指向下一块 ...
- jsp下载excel文件
jsp下载excel文件的的实现方法很多,今天也遇到这个问题,乱敲了一阵,终于搞定了,记下来和朋友们分享吧. 假设需要下载excel文件的jsp页面名为:down.jsp 对应的后台action名为: ...
- python 学习 map /reduce
python 内建了map()和reduce()函数 map()函数接收两个参数,一个是函数,一个是Iterable,map将传入的函数依次作用到序列的每个元素,并把结果作为新的Iterator返回. ...
- mybatis实战教程
参考:http://blog.csdn.net/techbirds_bao/article/details/9233599/
- day037 行记录的操作
1.库操作 2.表操作 3.行操作 1.库操作 1)创建数据库 语法: create database 数据库名 charset utf8; 数据库命名规则: 由数字,字母,下划线,@,#,$ 等组成 ...
- react全家桶-服务端与客户端配置
全家桶内装有: react - github react-router - github redux - github react-redux - github react-router-redux ...