矩形A + B HDU2524
题意
给你n*m的棋盘问有多少个矩形
分析
先看只有一行或一列的情况有1+2+....+n个,因为矩形的类型有1个最小单位格子n个,2个最小单位格子n-1个,n个最小单位格子有一个
code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,m,n,a,b,c;
cin>>t;
while(t--)
{ a=0;
b=0;
cin>>m>>n;
for(int i=1;i<=m;i++)
a+=i;
for(int j=1;j<=n;j++)
b+=j;
c=a*b;
cout<<c<<endl;
}
}
矩形A + B HDU2524的更多相关文章
- hdu2524 (求矩形个数,水题。。。)
hdu 2524 N - 暴力求解.打表 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64 ...
- [BOT] 一种android中实现“圆角矩形”的方法
内容简介 文章介绍ImageView(方法也可以应用到其它View)圆角矩形(包括圆形)的一种实现方式,四个角可以分别指定为圆角.思路是利用"Xfermode + Path"来进行 ...
- C语言 · 矩形面积交
问题描述 平面上有两个矩形,它们的边平行于直角坐标系的X轴或Y轴.对于每个矩形,我们给出它的一对相对顶点的坐标,请你编程算出两个矩形的交的面积. 输入格式 输入仅包含两行,每行描述一个矩形. 在每行中 ...
- canvas快速绘制圆形、三角形、矩形、多边形
想看前面整理的canvas常用API的同学可以点下面: canvas学习之API整理笔记(一) canvas学习之API整理笔记(二) 本系列文章涉及的所有代码都将上传至:项目代码github地址,喜 ...
- [LeetCode] Perfect Rectangle 完美矩形
Given N axis-aligned rectangles where N > 0, determine if they all together form an exact cover o ...
- [LeetCode] Rectangle Area 矩形面积
Find the total area covered by two rectilinear rectangles in a2D plane. Each rectangle is defined by ...
- [LeetCode] Maximal Rectangle 最大矩形
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and ...
- [LeetCode] Largest Rectangle in Histogram 直方图中最大的矩形
Given n non-negative integers representing the histogram's bar height where the width of each bar is ...
- [翻译svg教程]svg中矩形元素 rect
svg 元素<rect> 是一个矩形元素,用这个元素,可以你可以绘制矩形,设置矩形宽高,边框的宽度颜色,矩形的填充颜色,是否用圆角等 rect 示例 <svg xmlns=" ...
随机推荐
- Centos7.5调试/etc/sysctl.conf文件导致宕机
今天安装greenplus数据库,需要调试一个核心文件/etc/sysctl.conf文件,结果导致系统异常宕机,出现的问题就是使用任何命令都不能输出正确的结果,只有这个显示: 不知道是什么原因,ls ...
- 第 16 章 C 预处理器和 C 库(条件编译)
/*-------------------------------------- names_st.h -- names_st 结构的头文件 ----------------------------- ...
- UGUI 文字效果实现(Shadow\Gradient\Outline)
NGUI直接在UILabel组件中接入了Shadow.Gradient和outline选项,但在UGUI中是通过另外的组件单独提供,比如outline.shader等.这篇文章主要记录这几个文字效果实 ...
- Alpha冲刺博客汇总(麻瓜制造者)
目录 Alpha冲刺报告 Github项目地址 测试报告与用户反馈博客地址 课程展示博客地址 事后诸葛亮 Alpha冲刺报告 Alpha冲刺报告(1/12)(麻瓜制造者) Alpha冲刺报告(2/12 ...
- Ubuntu18.04 安装tomcat9
1.官网下载 2.移动到/usr/local/tomcat 3.解压 4.修改权限,否则在idea中不能正常使用
- Cannot uninstall 'pyserial'. It is a distutils installed project and thus we cannot a ccurately determine which files belong to it which would lead to only a partial uninstall. 解决方法
最近再升级 pyserial模块时,采用 pip install --upgrade pyserial,待模块下载完成准备卸载原版本时 提示:“Cannot uninstall 'pyserial'. ...
- el-table-column v-if条件渲染报错h.$scopedSlots.default is not a function
我们在实际项目中经常会遇到el-table-column条件渲染出现报错的情况 报错内容: h.$scopedSlots.default is not a function 究其原因,是因为表格是el ...
- luogu P2860 [USACO06JAN]冗余路径Redundant Paths
题目描述 In order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1- ...
- mysql删除数据左右空格
select trim(字段) from 表 删除左右空格 select ltrim(字段) from 表 删除左空格 select rtrim(字段) from 表 删除右空格
- npm 常用命令 查看版本、安装、卸载
npm list // 查看本地已安装模块清单 npm list [packageName] // 查看本地已安装模块版本 npm info [packageName] //查看模块的详细信息 包括各 ...