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/ ...
随机推荐
- MAC地址,使用java获取IP地址和MAC地址。
MAC地址,通常在http连接的项目中,来区分唯一客户端. MAC:六组十六进制字符组成. 如:E0-3F-49-AB-DB-EB IP:四组八位的二进制字符组成. 如:10.6.62.244 /** ...
- iOS开发——UI基础-自定义构造方法,layoutSubviews,Xib文件,利用Xib自定义View
一.自定义构造方法 有时候需要快速创建对象,可以自定义构造方法 + (instancetype)shopView { return [[self alloc] init]; } - (instance ...
- css3常用标签
30个最常用css选择器解析 你也许已经掌握了id.class.后台选择器这些基本的css选择器.但这远远不是css的全部.下面向大家系统的解析css中30个最常用的选择器,包括我们最头痛的浏览器 ...
- Android学习笔记(七)——常见控件
//此系列博文是<第一行Android代码>的学习笔记,如有错漏,欢迎指正! Android 给我们提供了大量的 UI控件,下面我们简单试试几种常用的控件. 一.TextView 在布局文 ...
- MySQL 同主机不同数据库之间的复制
MySQL同主机不同数据库的复制命令:注意运行在Terminal中,不运行在MySQL命令行中. mysqldump Portal_DEV -u root -ppassword1 --add-drop ...
- BZOJ 1485: [HNOI2009]有趣的数列
Description 求长度为 \(2n\) 的序列.要求 1. \(a_1<a_3<a_5<...<a_{2n-1}\) . 2. \(a_2<a_4<a_6& ...
- QT 信号与槽connect
QT 信号与槽connect QT 信号与槽connect connect函数调用几个限制 connect函数代码 QT中信号与槽的连接使用的connect函数是一个静态函数,在类QObject中定义 ...
- 解决maven项目移动
解决使用maven的工程移动到另一台电脑(电脑无法访问maven中央仓库问题) 移动后出现下述结果: Publishing failedPublishing failed with multiple ...
- hadoop小试
standard mode(标准模式) 下载 wget http://mirror.bit.edu.cn/apache/hadoop/common/stable/hadoop-2.7.2.tar.gz ...
- django 实战 - eLeave Form
需求: 实现请假单的电子审批 1. 支持国际化 2. 支持模型级别的访问记录 here we go: 这里会写一系列的文章,来记录我实战的过程,由于接触django没多久,难免有疏漏之处,望拍砖不要太 ...