博客
关于我
D. Timofey and rectangles[四色定理]
阅读量:529 次
发布时间:2019-03-08

本文共 963 字,大约阅读时间需要 3 分钟。

关于, 和歌德巴赫猜想/ 费马大定理 为数学3大数学 猜想 之一,由某大学生提出

题意:给n个矩形的坐下角坐标和右上角坐标.问如何染色(四种颜色),使得相邻矩形颜色不同

思路: 一定有解

1) 对左下角坐标进行讨论

坐标 颜色(任意一种排序)
奇偶 1
偶奇 2
偶偶 3
奇奇 4

如果左下角为奇偶,那么左下角还是奇偶的就一定不会和这个矩形相邻(画图证明四个角的坐标奇偶性)

#include
#define PI acos(-1.0)#define pb push_back#define F first#define S second#define debug puts#define setp cout << fixed << setprecision(15)#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);using namespace std;typedef long long ll;const int N=2e3+3;const int MOD=998244373;//ll rain[N],dp[N],u[N];int main(void){ FAST_IO;// cout << -1%2 << endl; int n; cin >> n; cout <<"YES"<
>a >> b >> c >> d; if(a<0) a=-a; if(b<0) b=-b; if(c<0) c=-c; if(d<0) d=-d; if(a%2==1&&b%2==1) cout << 1 << endl; else if(a%2==1&&b%2==0) cout << 2 << endl; else if(a%2==0&&b%2==0) cout << 3 << endl; else if(a%2==0&&b%2==1) cout << 4 << endl; } return 0;}/********50267*********/

转载地址:http://uykiz.baihongyu.com/

你可能感兴趣的文章
MySQL - 4种基本索引、聚簇索引和非聚索引、索引失效情况、SQL 优化
查看>>
MySQL - ERROR 1406
查看>>
mysql - 视图
查看>>
MySQL - 解读MySQL事务与锁机制
查看>>
mysql 1264_关于mysql 出现 1264 Out of range value for column 错误的解决办法
查看>>
mysql 1593_Linux高可用(HA)之MySQL主从复制中出现1593错误码的低级错误
查看>>
mysql ansi nulls_SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON 什么意思
查看>>
MySQL Binlog 日志监听与 Spring 集成实战
查看>>
Mysql Can't connect to MySQL server
查看>>
mysql case when 乱码_Mysql CASE WHEN 用法
查看>>
Multicast1
查看>>
MySQL Cluster 7.0.36 发布
查看>>
Multimodal Unsupervised Image-to-Image Translation多通道无监督图像翻译
查看>>
multipart/form-data与application/octet-stream的区别、application/x-www-form-urlencoded
查看>>
mysql cmake 报错,MySQL云服务器应用及cmake报错解决办法
查看>>
Multiple websites on single instance of IIS
查看>>
mysql CONCAT()函数拼接有NULL
查看>>
multiprocessing.Manager 嵌套共享对象不适用于队列
查看>>
multiprocessing.pool.map 和带有两个参数的函数
查看>>
MYSQL CONCAT函数
查看>>