当前位置:网站首页>CCF drawing (full mark code + problem solving ideas + skill summary) February 2, 2014
CCF drawing (full mark code + problem solving ideas + skill summary) February 2, 2014
2022-06-30 14:41:00 【A cute little monkey】
Title Description

Their thinking
Because the data range is very small , So it can be solved directly
It is equivalent to marking all colored points on a square grid paper
Finally, count all colored points
Code implementation
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 110;
int n;
bool m[N][N];
int main()
{
cin >> n;
while(n --)
{
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
for (int i = x1; i < x2; i ++)
{
for (int j = y1; j < y2; j ++)
{
m[i][j] = true;
}
}
}
int res = 0;
for (int i = 0; i < N; i ++)
{
for (int j = 0; j < N; j ++)
{
res += m[i][j];
}
}
cout << res;
return 0;
}
Skill summary
- Data range is important , First of all, think about the most stupid act of violence , When the data range is not allowed , Think again about the algorithm for optimization
- Don't solve problems in a proper way , for example : My inherent thinking in this problem is to add large areas , Subtract coincident area , Then I don't know how to judge the weight … It's going to crash …
- If the data range is relatively small, we must think about the violent solution !!
边栏推荐
- Knowledge learned from the water resources institute project
- About the problems encountered when using the timer class to stop with a button (why does the QPushButton (for the first time) need to be clicked twice to respond?)
- PHP excel export function encapsulation (based on phpexcel class)
- Notepad regular delete the line of the keyword
- PHP conditional operator
- Upgrade centos7 mysql5.5 to mysql5.7 non RPM in the form of tar package
- NoViableAltException([email protected][])
- Mutex lock, read / write lock, spin lock, pessimistic lock, and optimistic lock
- Why is the resolution of the image generated by PHP GD library 96? How to change it to 72
- KnightCTF WEB
猜你喜欢

Summary of use of laravel DCAT admin

Go language mutex lock

2021 geek challenge Web

Shangpinhui knowledge points of large e-commerce projects

DiceCTF - knock-knock

After the MySQL service on the local computer is started and stopped, some services will automatically stop when they are not used by other services or programs

go channel && select

Crypto questions

Zend studio how to import an existing project

ctfshow nodejs
随机推荐
Crypto questions
數據恢複軟件EasyRecovery15下載
Meaning of while (~scanf ("%d%d", & A, & B))
V3 03_ Getting started
Double pointer letter matching
JS time conversion standard format, timestamp conversion standard format
The first three passes of sqli Labs
从控制层返回到js的json数据带“\”转译符,怎么去掉
Why does the folder appear open in another program
Finding the root of an integer by dichotomy
数据恢复软件EasyRecovery15下载
PHP conditional operator
Three uses of golang underscores
Use of laravel repository mode
Querywrapper in mybaits plus
JS to realize simple lottery function
XSS challenge (1-5) more detailed answers
Zend studio how to import an existing project
MySQL back to table query optimization
PHP generate images into Base64