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

题目传送门

 /*
水题:读懂题目就能做
*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
using namespace std; const int MAXN = 1e2 + ;
const int INF = 0x3f3f3f3f;
int a[MAXN][MAXN]; int main(void) //Codeforces Round #308 (Div. 2) A. Vanya and Table
{
// freopen ("A.in", "r", stdin); int n;
while (scanf ("%d", &n) == )
{
memset (a, , sizeof (a));
int x1, y1, x2, 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 = ;
for (int i=; i<=; ++i)
{
for (int j=; j<=; ++j) ans += a[i][j];
} printf ("%d\n", ans);
} return ;
}
上一篇:《时间序列分析及应用:R语言》读书笔记--第二章 基本概念


下一篇:使用libcurl开源库和Duilib做的下载文件并显示进度条的小工具