给两数之和和两数之差,求两数,两数还必须同奇偶

 #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!的更多相关文章

  1. HDOJ 1194 Beat the Spread!(简单题)

    Problem Description Superbowl Sunday is nearly here. In order to pass the time waiting for the half- ...

  2. Beat the Spread![HDU1194]

    Beat the Spread! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  3. 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. ...

  4. zoj 2388 Beat the Spread!

    Beat the Spread! Time Limit: 2 Seconds      Memory Limit: 65536 KB Superbowl Sunday is nearly here. ...

  5. HDU 2614 Beat 深搜DFS

    这道题目还是比较水的,但是题意理解确实费了半天劲,没办法 谁让自己是英渣呢! 题目大意: 猪脚要解决问题, 他有个习惯,每次只解决比之前解决过的问题的难度要大. 他给我们一个矩阵  矩阵的 i 行 j ...

  6. HDU 2614 Beat(DFS)

    题目链接 Problem Description Zty is a man that always full of enthusiasm. He wants to solve every kind o ...

  7. UVa 10812 - Beat the Spread!

    题目大意:知道一场橄榄球比赛比分的和以及差的绝对值,算出这两个数.注意判断结果的可能性(比分为非负数). #include <cstdio> int main() { #ifdef LOC ...

  8. HDU——PKU题目分类

    HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...

  9. HDU1194_Beat the Spread!

    Beat the Spread! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

随机推荐

  1. MySQL主从同步、读写分离配置步骤

    现在使用的两台服务器已经安装了MySQL,全是rpm包装的,能正常使用. 为了避免不必要的麻烦,主从服务器MySQL版本尽量保持一致; 环境:192.168.0.1 (Master) 192.168. ...

  2. Struts2体系结构图以及详解

    Strut2的体系结构如图所示: 一个请求在Struts2框架中的处理大概分为以下几个步骤: 1.客户端初始化一个指向Servlet容器(例如Tomcat)的请求: 2.这个请求经过一系列的过滤器(F ...

  3. 内存操作相关内核 API 的使用

    1.RtlCopyMemory .RtlCopyBytes.RtlMoveMemory: 2.RtlZeroMemory.RtlFillMemory: 3.RtlEqualMemory: 4.ExAl ...

  4. UVA11806Cheerleaders(容斥)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud 题目意思:在m行n列的矩形网格中放k个相同的石子,问有多少中方法?每个格子最多放一 ...

  5. Java的反射机制及应用实例

    一:什么是反射机制 简单的来说,反射机制指的是程序在运行时能够获取自身的信息.在Java中,只要给定类的名字,那么就可以通过反射机制来获得类的所有信息. 二:哪里用到反射机制 我们用过一些知识,但是并 ...

  6. makefile 单独编译一个文件

    #!/sh/bin .SUFFIXES:.c.o CDIR = /Users/shelley/c BINDIR = $(CDIR)/bin CC = gcc CFLAGS = -g -O RM = r ...

  7. 基于C#—WPF的扫雷游戏

    自学教材:<C#入门经典(第六版)>,1月28日购入,1月29日到2月9日学习了前十六章,由于有C语言基础,在语法阶段学习起来比较轻松,不过在接触到面向对象的时候遇到了一些困难,对于一些概 ...

  8. select操作

    // 1.判断select选项中 是否存在Value="paraValue"的Item         function jsSelectIsExitItem(objSelect, ...

  9. Multi-Channel MAC for Ad Hoc Networks: Handling Multi-Channel Hidden Terminals Using A Single Transceiver

    MAC协议 2004 这是一个单纯的Multi-Channel Ad Hoc场景,多信道,但不是DSA.没有PU,只是多信道利用问题,相对传统Ad Hoc,要解决的就是1)信道访问(如何使用多个信道) ...

  10. 【转】android 电池(一):锂电池基本原理篇

    关键词:android  电池关机充电 androidboot.mode charger 平台信息:内核:linux2.6/linux3.0系统:android/android4.0 平台:S5PV3 ...