#308 (div.2) A. Vanya and Table
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的更多相关文章
- 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table
题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...
- 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 ...
- 数学 Codeforces Round #308 (Div. 2) B. Vanya and Books
题目传送门 /* 水题:求总数字个数,开long long竟然莫名其妙WA了几次,也没改啥又对了:) */ #include <cstdio> #include <iostream& ...
- 暴力/进制转换 Codeforces Round #308 (Div. 2) C. Vanya and Scales
题目传送门 /* 题意:问是否能用质量为w^0,w^1,...,w^100的砝码各1个称出重量m,砝码放左边或在右边 暴力/进制转换:假设可以称出,用w进制表示,每一位是0,1,w-1.w-1表示砝码 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- #308 (div.2) B. Vanya and Books
1.题目描写叙述:点击打开链接 2.解题思路:本题要求统计数位的个数,简单的试验一下发现有例如以下规律:一个n位数的个数有9*(10^n)个.因此全部n位数的数位是n*9*(10^n)个.因此能够利用 ...
随机推荐
- 【Howie玩docker】-使用mono编译c#程序
根据前面的方法,在windows和Linux共享文件夹,然后就可以开发了! Start up an Ubuntu container $ docker run -it ubuntu bash Upda ...
- Visual Studio 2008中控制台程序一闪而过的解决方法
VS2008中编写C/C++的程序时,调试运行,控制台窗口会在执行完毕后立即关闭,这样就无法看到运行的结果.为了解决这个问题,可以使用①system("pause"); ②getc ...
- jni note
2016-1-15 javah 使用javah可以自动从java文件生成jni头文件, 用法:javah [选项] <类> 其中 [选项] 包括: -help ...
- delphi写的整合汇编与api的简单的窗口程序
program Project1; { Types and Structures Definition }type WNDCLASSEX = packed record cbSize: Lon ...
- [Leetcode][Python][DP]Regular Expression Matching
# -*- coding: utf8 -*-'''https://oj.leetcode.com/problems/regular-expression-matching/ Implement reg ...
- mongodb的 或 查询,实践总结
PostcardRecord.findOne({user:userid, $or : [ { at:{$gte:start.valueOf(), $lte:end.valueOf()} } , { i ...
- frameset常用属性
框架是网页画面分成几个框窗(不同的窗口对应不同页面以几个网页的形式显示),同时取得多个 src的地址.页面所有框架标记需要放在一个总起的 html 档,这个档案只记录了该框架如何分割 ,不会显示任何资 ...
- cmd命令 拷贝某文件夹及其子文件夹文件到其它文件夹
@ECHO OFF cd/d %H:\FileLoc\CNET&cd.. ::echo 拷贝"%H:\FileLoc\CNET"中文件到"H:\FileLocTe ...
- javascript DOM,它到底是什么-------Day32
这一晚上看的我是头疼不已啊,为什么呢? 终究是半路出家,我对javascript的理解仅仅停留在:调用javascript,改变页面样式,元素和实现一些事件的响应,尽管须要的时候可能会用,可是到底使用 ...
- hahahahah
dsfsefesfsffsfsfsfsfesfsfsfsfsfsfspackage realm; import java.util.ArrayList; import java.util.List ...