博客
关于我
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/

你可能感兴趣的文章
Mysql8.0的特性
查看>>
MySQL8修改密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
查看>>
MySQL8修改密码的方法
查看>>
Mysql8在Centos上安装后忘记root密码如何重新设置
查看>>
Mysql8在Windows上离线安装时忘记root密码
查看>>
MySQL8找不到my.ini配置文件以及报sql_mode=only_full_group_by解决方案
查看>>
mysql8的安装与卸载
查看>>
MySQL8,体验不一样的安装方式!
查看>>
MySQL: Host '127.0.0.1' is not allowed to connect to this MySQL server
查看>>
Mysql: 对换(替换)两条记录的同一个字段值
查看>>
mysql:Can‘t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock‘解决方法
查看>>
MYSQL:基础——3N范式的表结构设计
查看>>
MYSQL:基础——触发器
查看>>
Mysql:连接报错“closing inbound before receiving peer‘s close_notify”
查看>>
mysqlbinlog报错unknown variable ‘default-character-set=utf8mb4‘
查看>>
mysqldump 参数--lock-tables浅析
查看>>
mysqldump 导出中文乱码
查看>>
mysqldump 导出数据库中每张表的前n条
查看>>
mysqldump: Got error: 1044: Access denied for user ‘xx’@’xx’ to database ‘xx’ when using LOCK TABLES
查看>>
Mysqldump参数大全(参数来源于mysql5.5.19源码)
查看>>