bnuoj 24251 Counting Pair
一道简单的规律题,画出二维表将数字分别相加可以发现很明显的对称性
题目链接:http://www.bnuoj.com/v3/problem_show.php?pid=24251

#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<math.h>
using namespace std; int main()
{
int sum,n,m,Num,i,t;
scanf("%d",&sum);
for(i=;i<=sum;i++)
{
scanf("%d %d",&n,&m);
if(n>m)
{
int x=n;
n=m;
m=x;
}
scanf("%d",&t);
printf("Case #%d:\n",i);
while(t--)
{
scanf("%d",&Num);
if(Num>n+m)
printf("0\n");
else if(Num>n && Num>m)
printf("%d\n",n+m-Num+);
else if(Num<=n && Num<=m)
{
if(Num == )
printf("0\n");
else
printf("%d\n",Num-);
}
else if(Num>n && Num<=m)
{
printf("%d\n",n);
}
else if(Num==n && Num<=m)
{
printf("%d\n",n-);
} } }
return ;
}
bnuoj 24251 Counting Pair的更多相关文章
- Counting Pair
Counting Pair Time Limit: 1000 ms Memory Limit: 65535 kB Solved: 112 Tried: 1209 Submit Status Best ...
- Sichuan State Programming Contest 2012 C。Counting Pair
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=118254#problem/C 其实这道题目不难...就是没有仔细分析... 我们可以发现 ...
- HDU 4358 Boring counting(莫队+DFS序+离散化)
Boring counting Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 98304/98304 K (Java/Others) ...
- HDU 1264 Counting Squares(线段树求面积的并)
Counting Squares Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- SDUT 2610 Boring Counting(离散化+主席树区间内的区间求和)
Boring Counting Time Limit: 3000MS Memory Limit: 65536KB Submit Statistic Discuss Problem Descriptio ...
- HDU 5952 Counting Cliques 【DFS+剪枝】 (2016ACM/ICPC亚洲区沈阳站)
Counting Cliques Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) ...
- BZOJ2023: [Usaco2005 Nov]Ant Counting 数蚂蚁
2023: [Usaco2005 Nov]Ant Counting 数蚂蚁 Time Limit: 4 Sec Memory Limit: 64 MBSubmit: 56 Solved: 16[S ...
- Counting Islands II
Counting Islands II 描述 Country H is going to carry out a huge artificial islands project. The projec ...
- Counting Intersections
Counting Intersections Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/ ...
随机推荐
- Java Io 之拷贝文件性能比较
前面我们共讨论了拷贝文件有三种方式: 1. 第一种,一个字节一个字节的进行拷贝文件操作. 2. 第二种,使用字节数据批量的进行拷贝文件操作. 3. 第三种,使用带缓冲输入输出流来拷贝文件. 那么哪一种 ...
- Codeforces 260 B. Fedya and Maths
题目链接:http://codeforces.com/contest/456/problem/B 解题报告:输入一个n,让你判断(1n + 2n + 3n + 4n) mod 5的结果是多少?注意n的 ...
- 迷之this?(转)
1. 迷之this 对于刚开始进行 JavaScript 编程的开发者来说,this 具有强大的魔力,它像谜团一样需要工程师们花大量的精力去真正理解它. 在后端的一些编程语言中,例如 Java.PHP ...
- 2016移动端web5分钟速成(适合新手)
http://www.w3cfuns.com/notes/20813/fecbb840a2574cf712a8625f88a7ab3a.html
- OpenCV成长之路(3):模仿PhotoShop中魔术棒工具
本文的主题实际上是图像的颜色空间的转换,借助一个颜色选取程序来说明OpenCV中颜色转换函数的用法以及一些注意事项. 一.几种常见的颜色空间: RGB颜色空间:RGB采用加法混色法,因为它是描述各种“ ...
- DMZ
DMZ是英文“demilitarized zone”的缩写,中文名称为“隔离区”,也称“非军事化区”.它是为了解决安装防火墙后外部网络的访问用户不能访问内部网络服务器的问题,而设立的一个非安全系统与安 ...
- py代码模糊工具
https://github.com/astrand/pyobfuscate 使用方法,调用下图文件即可,方法 python pyobfuscate.py your_code.py 即可输出在cmd ...
- iOS_隐藏顶部状态栏方式
关键词:IOS.UIViewController. Status Bar iOS6和iOS7在隐藏 Status Bar 三种方式比较: Storyboard 界面上选中UIViewControlle ...
- TextMate 小小心得
在Vim.Emacs之间纠结了很久之后,却选择了TextMate P.S. 为何Emacs和Vim被称为两大神器 中文的资料不是很多,一狠心,找了James Edward Gray II的TextMa ...
- git生成秘钥之后同步到服务器
现在本地生成ssh私钥和公钥 设置本地git用户配置 $ git config --global user.name "username"$ git config --global ...