1.题目描写叙述:点击打开链接

2.解题思路:本题是一道简单的模拟题。每次扫描一个输入的长方形,然后将内部全部点都+1,终于统计数组全部元素的和就可以。

3.代码:

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<string>
#include<sstream>
#include<set>
#include<vector>
#include<stack>
#include<map>
#include<queue>
#include<deque>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<ctime>
#include<functional>
using namespace std; typedef long long ll;
typedef unsigned long long ull; #define me(s) memset(s,0,sizeof(s))
#define For(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define sz size
#define clr clear
#define F(a,b) for(int i=a;b;i++) const int N=110;
int a[N][N];
int main()
{
int n;
while(~scanf("%d",&n))
{
me(a);
int x1,x2,y1,y2;
while(n--)
{
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
for(int i=y1;i<=y2;i++)
for(int j=x1;j<=x2;j++)
a[i][j]++;
}
int ans=0;
for(int i=1;i<=100;i++)
for(int j=1;j<=100;j++)
ans+=a[i][j];
printf("%d\n",ans);
}
return 0;
}

#308 (div.2) A. Vanya and Table的更多相关文章

  1. 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table

    题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...

  2. Codeforces Round #308 (Div. 2) A. Vanya and Table 暴力

    A. Vanya and Table Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/pr ...

  3. 数学 Codeforces Round #308 (Div. 2) B. Vanya and Books

    题目传送门 /* 水题:求总数字个数,开long long竟然莫名其妙WA了几次,也没改啥又对了:) */ #include <cstdio> #include <iostream& ...

  4. 暴力/进制转换 Codeforces Round #308 (Div. 2) C. Vanya and Scales

    题目传送门 /* 题意:问是否能用质量为w^0,w^1,...,w^100的砝码各1个称出重量m,砝码放左边或在右边 暴力/进制转换:假设可以称出,用w进制表示,每一位是0,1,w-1.w-1表示砝码 ...

  5. Codeforces Round #308 (Div. 2)----C. Vanya and Scales

    C. Vanya and Scales time limit per test 1 second memory limit per test 256 megabytes input standard ...

  6. Codeforces Round #308 (Div. 2) D. Vanya and Triangles 水题

    D. Vanya and Triangles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55 ...

  7. Codeforces Round #308 (Div. 2) C. Vanya and Scales dfs

    C. Vanya and Scales Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/p ...

  8. Codeforces Round #308 (Div. 2)B. Vanya and Books 数学

    B. Vanya and Books Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/pr ...

  9. #308 (div.2) B. Vanya and Books

    1.题目描写叙述:点击打开链接 2.解题思路:本题要求统计数位的个数,简单的试验一下发现有例如以下规律:一个n位数的个数有9*(10^n)个.因此全部n位数的数位是n*9*(10^n)个.因此能够利用 ...

随机推荐

  1. Grunt之学习历程(转自网上资源-整理自用)

    认识Grunt Grunt中文文档 安装Node环境 CNode 配置Grunt Grunt中文文档-配置任务 什么是package.json package.json中文文档 关于Grunt资料 应 ...

  2. javascript 多行字符串

    javascript 字符串多行 平时一般使用 字符串+,或者[].join('')的方式 同事推荐了这样的形式 ExceptionDivHtml="<div class='gameI ...

  3. mysql 与 mysqli的区别

    mysqli.dll是PHP对mysql新特性的一个扩展支持.在PHP5中可以在php.ini中加载mysql后面的i,指improved, interface, ingenious, incompa ...

  4. Windows2008 VPN登录

    上一章已经讲过Windows2008RT搭建VPN服务器搭建过程,接下来说一下win2008和win8的VPN登录 win8VPN连接过程 先说win2008的VPN登录过程.很简单: 打开网络和共享 ...

  5. 【java】静态方法声明与调用习题

    public class dengd { static int getTt(int table[]) { for(int b=0; b<table.length;b++) { System.ou ...

  6. cocos2d-x -------之笔记篇 3D动作说明

    CCShaky3D::create(时间,晃动网格大小,晃动范围,Z轴是否晃动);    //创建一个3D晃动的效果 CCShakyTiles3D::create(时间,晃动网格大小,晃动范围,Z轴是 ...

  7. JS获取浏览器窗口大小 获取屏幕,浏览器,网页高度宽度

    网页可见区域宽:document.body.clientWidth 网页可见区域高:document.body.clientHeight 网页可见区域宽:document.body.offsetWid ...

  8. 接收时物料必须为Active状态

    应用 Oracle Inventory 层 Level Function 函数名 Funcgtion Name RCV_RCVRCERC 表单名 Form Name RCVRCERC 说明 Descr ...

  9. RMA编码为必输

    应用 Oracle Inventory 层 Level Function 函数名 Funcgtion Name RCV_RCVTXERE 表单名 Form Name RCVTXERE 说明 Descr ...

  10. 【转】Ubuntu Linux 下文件名乱码(无效的编码)的快速解决办法

    原博文地址:http://www.cnblogs.com/york-hust/archive/2012/07/07/2580388.html 文件是在WIndows 下创建的,Windows 的文件名 ...