codeforces 764D
脑洞
很早以前没有补掉的题目
四色问题肯定使有解的,然后就是怎么构造。注意到边长是奇数,那么我们就可以分类,按左上角坐标的奇偶性分类,正好对应四种颜色。因为当两个矩形左上角横纵坐标奇偶性不同时,那么肯定不会相邻,所以可以任意填,否则分类就可以了。
#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
scanf("%d", &n);
puts("YES");
while(n--)
{
int x1, x2, y1, y2; scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
printf("%d\n", (abs(x1) % ) * + (abs(y1) % ) + );
}
return ;
}
codeforces 764D的更多相关文章
- 【codeforces 764D】Timofey and rectangles
[题目链接]:http://codeforces.com/contest/764/problem/D [题意] 给你n个矩形,以左下角坐标和右上角坐标的形式给出; (保证矩形的边长为奇数) 问你有没有 ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
- CodeForces - 662A Gambling Nim
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...
- CodeForces - 274B Zero Tree
http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...
- CodeForces - 261B Maxim and Restaurant
http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...
- CodeForces - 696B Puzzles
http://codeforces.com/problemset/problem/696/B 题目大意: 这是一颗有n个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...
随机推荐
- Oracle 把一个用户所有表的读权限授予另一个用户
create user <USER_NAME> identified by <PASSWORD>; grant create session TO <USER_NAME& ...
- svn更新报错Please execute the 'Cleanup' command.
更新svn报错 要Clearnup一下就可以再更新了 点击svn中 clear up ok之后恢复正常
- ProgressDialog的样式
ProgressDialog的样式有两种,一种是圆形不明确状态,一种是水平进度条状态 第一种方式:圆形进度条 final ProgressDialog dialog = new ProgressDia ...
- <MySQL>入门四 事务控制语言 TCL
-- TCL /* Transcation Control Language 事务控制语言 事务:一个或一组sql语句组成一个执行单元,这个执行单元要么全部执行,要么全部不执行 案例:转账 name ...
- VNC 安装 (适用Redhat 9.0 和 CentOS 7.0+)
Remote Service 本文转自https://www.cnblogs.com/yjscloud/p/6695388.html VNC 安装 (适用Redhat 9.0 和 CentOS 7.0 ...
- 06 Python流程控制
目录: 12) if语句 13) 三目运算 14) while语句 15) break与continue关键字 16) while…else语句 12,if语句 Note: 在一个if语 ...
- PAT 1138 Postorder Traversal
Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and in ...
- Java基础学习总结(85)——Java中四种线程安全的单例模式实现方式
- POJ 1226 Substrings
Substrings Time Limit: 1000ms Memory Limit: 10000KB This problem will be judged on PKU. Original ID: ...
- 438D - The Child and Sequence
D. The Child and Sequence time limit per test 4 seconds memory limit per test 256 megabytes input st ...