UVa 10812 - Beat the Spread!
题目大意:知道一场橄榄球比赛比分的和以及差的绝对值,算出这两个数。注意判断结果的可能性(比分为非负数)。
#include <cstdio> int main()
{
#ifdef LOCAL
freopen("in", "r", stdin);
#endif
int n;
scanf("%d", &n);
int s, d, a, b;
while (n--)
{
scanf("%d%d", &s, &d);
if (s < d || (s+d)%)
{
printf("impossible\n");
continue;
}
a = (s+d) / ;
b = s - a;
printf("%d %d\n", a, b);
}
return ;
}
UVa 10812 - Beat the Spread!的更多相关文章
- 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. ...
- HDOJ 1194 Beat the Spread!(简单题)
Problem Description Superbowl Sunday is nearly here. In order to pass the time waiting for the half- ...
- HDU 1194 - Beat the Spread!
给两数之和和两数之差,求两数,两数还必须同奇偶 #include <iostream> using namespace std; int main() { int a,b,t; cin&g ...
- HDU1194_Beat the Spread!
Beat the Spread! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- ACM学习
转:ACM大量习题题库 ACM大量习题题库 现在网上有许多题库,大多是可以在线评测,所以叫做Online Judge.除了USACO是为IOI准备外,其余几乎全部是大学的ACM竞赛题库. US ...
- (转载)ACM训练计划,先过一遍基础再按此拼搏吧!!!!
ACM大量习题题库 ACM大量习题题库 现在网上有许多题库,大多是可以在线评测,所以叫做Online Judge.除了USACO是为IOI准备外,其余几乎全部是大学的ACM竞赛题库. USACO ht ...
- POJ 题目分类(转载)
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965 ...
随机推荐
- ZOJ 2866 Overstaffed Company
树状数组 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> ...
- 报错:“不是有效的Win32应用程序”的解决办法
Win7.Win8下用VS2013编译完的程序,拿到32位WindowsXP虚拟机下运行有时候会报错:
- 未能加载文件或程序集 Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0 解决 亲测
项目打开winform程序做的某些窗体时报错: ************* 异常文本 ************** System.Reflection.TargetInvocationExceptio ...
- 使用PHP实现文件上传和多文件上传
PHP 2013 年 9 月 4 日 暂无评论 在PHP程序开发中,文件上传是一个使用非常普遍的功能,也是PHP程序员的必备技能之一.值得高兴的是,在PHP中实现文件上传功能要比在Java.C#等语言 ...
- DedeCMS织梦文章内容图片绝对路径修改方法
这几天在网站改版,想把网站做大,想做频道页二级域名,于是在做网站的过程中发现一个问题,dedecms开设二级域名后,在二级域名的文章页无法显示图片,查看源代码后发现问题,由于dedecms文章页中的图 ...
- bash报错./mq.sh: line 15: warning: here-document at line 10 delimited by end-of-file (wanted `eof')
[root@localhost tmp]# ./mq.sh./mq.sh: line 15: warning: here-document at line 10 delimited by end-of ...
- linux下libreoffice安装测试
一.Linux安装 wget http://download.documentfoundation.org/libreoffice/stable/4.4.6/rpm/x86_64/LibreOffic ...
- 单词接龙(dragon)
单词接龙(dragon) 题目描述 单词接龙是一个与我们经常玩的成语接龙相类似的游戏,现在我们已知一组单词,且给定一个开头的字母,要求出以这个字母开头的最长的“龙”(每个单词都最多在“龙”中出现两次) ...
- POJ 3254 Corn Fields(状态压缩)
一道状态压缩的题,错了好多次....应该先把满足的情况预处理出来 #include<iostream> #include<cstdio> #include<cstring ...
- USACO Section 1.2 Palindromic Squares 解题报告
题目 题目描述 输入一个基数B,现在要从1到300之间找出一些符合要求的数字N.如果N的平方转换成B进制数之后是一个回文串,那么N就符合要求.我们将N转换成B进制数输出,然后再将N的平方转换成B进制数 ...