HDU 1194 - Beat the Spread!
给两数之和和两数之差,求两数,两数还必须同奇偶
#include <iostream>
using namespace std;
int main()
{
int a,b,t;
cin>>t;
while(t--)
{
cin>>a>>b;
int x = ( a + b ) / ;
int y = ( a - b ) / ;
if((a-b)%||(a+b)%||x<||y<) puts("impossible");
else cout<<x<<" "<<y<<endl;
}
}
HDU 1194 - Beat the Spread!的更多相关文章
- HDOJ 1194 Beat the Spread!(简单题)
Problem Description Superbowl Sunday is nearly here. In order to pass the time waiting for the half- ...
- Beat the Spread![HDU1194]
Beat the Spread! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- ZOJ2388 Beat the Spread! 2017-04-16 19:18 91人阅读 评论(0) 收藏
Beat the Spread! Time Limit: 2 Seconds Memory Limit: 65536 KB Superbowl Sunday is nearly here. ...
- zoj 2388 Beat the Spread!
Beat the Spread! Time Limit: 2 Seconds Memory Limit: 65536 KB Superbowl Sunday is nearly here. ...
- HDU 2614 Beat 深搜DFS
这道题目还是比较水的,但是题意理解确实费了半天劲,没办法 谁让自己是英渣呢! 题目大意: 猪脚要解决问题, 他有个习惯,每次只解决比之前解决过的问题的难度要大. 他给我们一个矩阵 矩阵的 i 行 j ...
- HDU 2614 Beat(DFS)
题目链接 Problem Description Zty is a man that always full of enthusiasm. He wants to solve every kind o ...
- UVa 10812 - Beat the Spread!
题目大意:知道一场橄榄球比赛比分的和以及差的绝对值,算出这两个数.注意判断结果的可能性(比分为非负数). #include <cstdio> int main() { #ifdef LOC ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- HDU1194_Beat the Spread!
Beat the Spread! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
随机推荐
- Spark IDEA开发环境构建
本文档基于IEDA构建spark maven应用. date: 2016/8/1 author: wangxl 1.下载IDEA https://www.jetbrains.com/idea/ 2.安 ...
- label的for属性与inputde的id元素绑定
<form> <label for="male">Male</label> <input type="radio" n ...
- 关于thinkphp中Hook钩子的解析
在tp框架下的Library/Think 下有一个Hook类,这个是用来以插件形式来实例化类并且执行方法的 static private $tags = array(); 这里有一个 ...
- GTW likes gt(BC 模拟 or 优先队列)
GTW likes gt Accepts: 54 Submissions: 782 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 13107 ...
- inotifywait实现目录监控
http://blog.csdn.net/firefoxbug/article/details/8188804
- LeetCode_Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. class Solutio ...
- usb mass storage之旅
前面总结了usb hid keyboard,现在总结usb mass storage,在枚举阶段没什么好总结的,hid和mass storage差不多,都是同样的枚举过程,但是在他们的配置描述符.接口 ...
- SQL Serverf 索引 - 索引压缩 、附加特性 <第十篇>
一.索引压缩 数据和索引压缩在SQL Server2008被引入.压缩一个索引意味着将在一个页面中获得更多的关键字信息.这可以造成重大的性能改进,因为存储索引需要的页面和索引级别更少.因为索引中的键值 ...
- Generate Parentheses 解答
Question Given n pairs of parentheses, write a function to generate all combinations of well-formed ...
- Binary Tree Zigzag Level Order Traversal 解答
Question Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, fro ...