博客
关于我
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 - 解读MySQL事务与锁机制
查看>>
MTTR、MTBF、MTTF的大白话理解
查看>>
mt_rand
查看>>
mysql /*! 50100 ... */ 条件编译
查看>>
mudbox卸载/完美解决安装失败/如何彻底卸载清除干净mudbox各种残留注册表和文件的方法...
查看>>
mysql 1264_关于mysql 出现 1264 Out of range value for column 错误的解决办法
查看>>
mysql 1593_Linux高可用(HA)之MySQL主从复制中出现1593错误码的低级错误
查看>>
mysql 5.6 修改端口_mysql5.6.24怎么修改端口号
查看>>
MySQL 8.0 恢复孤立文件每表ibd文件
查看>>
MySQL 8.0开始Group by不再排序
查看>>
mysql ansi nulls_SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON 什么意思
查看>>
multi swiper bug solution
查看>>
MySQL Binlog 日志监听与 Spring 集成实战
查看>>
MySQL binlog三种模式
查看>>
multi-angle cosine and sines
查看>>
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多通道无监督图像翻译
查看>>