亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

Codeforces Round #395 (Div. 2) D. Timofey and rectangles

2019-11-14 10:27:13
字體:
來源:轉載
供稿:網友

D. Timofey and rectangles

time limit per test:2 seconds

memory limit per test:256 megabytes

input:standard input

output:standard output

One of Timofey’s birthday PResents is a colourbook in a shape of an infinite plane. On the plane n rectangles with sides parallel to coordinate axes are situated. All sides of the rectangles have odd length. Rectangles cannot intersect, but they can touch each other.

Help Timofey to color his rectangles in 4 different colors in such a way that every two rectangles touching each other by side would have different color, or determine that it is impossible.

Two rectangles intersect if their intersection has positive area. Two rectangles touch by sides if there is a pair of sides such that their intersection has non-zero length

The picture corresponds to the first example

Input

The first line contains single integer n (1?≤?n?≤?5·105) — the number of rectangles.

n lines follow. The i-th of these lines contains four integers x1, y1, x2 and y2 (?-?109?≤?x1?<?x2?≤?109, ?-?109?≤?y1?<?y2?≤?109), that means that points (x1,?y1) and (x2,?y2) are the coordinates of two opposite corners of the i-th rectangle.

It is guaranteed, that all sides of the rectangles have odd lengths and rectangles don’t intersect each other.

Output

Print “NO” in the only line if it is impossible to color the rectangles in 4 different colors in such a way that every two rectangles touching each other by side would have different color.

Otherwise, print “YES” in the first line. Then print n lines, in the i-th of them print single integer ci (1?≤?ci?≤?4) — the color of i-th rectangle.

Example

Input 8 0 0 5 3 2 -1 5 0 -3 -4 2 -1 -1 -1 2 0 -3 0 0 5 5 2 10 3 7 -3 10 2 4 -2 7 -1

Output YES 1 2 2 3 2 2 4 1 題意:給n個矩形染色,要求相鄰不能同色。問能否做到。如果能,輸出每個矩形被染得顏色(1,2,3.。。)。 題解:因為四色定理,很明顯可以知道一定是可以的。但是沒有好好理解題干中給出的矩形邊長為奇數的意義。 按大神們的思路來說,因為這個可以把矩形按左下角坐標分成(奇奇,奇偶,偶奇,偶偶)四種類型, 代碼:

#include <bits/stdc++.h>#define ll long longusing namespace std;int main(){ int n; while(~scanf("%d",&n)) { printf("YES/n"); int a,b,c,d; for(int i=0; i<n; i++) { scanf("%d%d%d%d",&a,&b,&c,&d); printf("%d/n",1+2*(abs(a)%2)+abs(b)%2); } } return 0;}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
69影院欧美专区视频| 欧美性猛交xxxxx免费看| 韩国三级日本三级少妇99| 欧美性视频网站| 欧美性少妇18aaaa视频| 国产精品日韩久久久久| 欧美国产精品人人做人人爱| 最近中文字幕mv在线一区二区三区四区| 亚洲精品色婷婷福利天堂| 欧美一级黄色网| 97精品一区二区三区| 国产亚洲一区二区精品| 国产+人+亚洲| 国外视频精品毛片| 免费不卡在线观看av| 欧美高跟鞋交xxxxxhd| 成人在线精品视频| 亚洲精品视频在线播放| 国产一区二区美女视频| 狠狠久久五月精品中文字幕| 国产精品久久久久久久久久ktv| 国产精品视频一区国模私拍| 日韩中文综合网| 久久久久久久影视| 国产精品香蕉国产| 国产综合在线视频| 日本韩国欧美精品大片卡二| 久久久久久中文字幕| 欧美精品videos另类日本| 韩剧1988在线观看免费完整版| 欧美日韩成人在线观看| 亚洲精品午夜精品| 91精品国产99| 国产成人综合久久| 欧美电影在线免费观看网站| 国产精品久久一区| 91久久久久久久一区二区| 91久久久久久久久久| 国产亚洲欧洲高清一区| 国内精品伊人久久| 欧美日韩国产一区中文午夜| 日韩精品一二三四区| 97热在线精品视频在线观看| 91天堂在线观看| 亚洲一区二区久久久| 久久综合伊人77777蜜臀| 91精品免费看| 精品国产成人av| 亚洲成**性毛茸茸| 久久久久亚洲精品| 国产精品高清在线| 国产精国产精品| 国产国产精品人在线视| 国产精品综合不卡av| 日韩毛片在线观看| 在线成人激情视频| 91亚洲va在线va天堂va国| 欧美性猛交xxx| 亚洲激情在线视频| 精品av在线播放| 久久99久久99精品中文字幕| 热久久这里只有| 精品久久中文字幕| 亚洲精品xxxx| 亚洲欧美成人一区二区在线电影| 久久久久中文字幕| 美女视频久久黄| 久久国产加勒比精品无码| 国产精品永久免费观看| 亚洲欧美一区二区激情| 最近2019好看的中文字幕免费| 国产精品国产福利国产秒拍| 久久91精品国产91久久跳| 国产视频精品va久久久久久| 欧美人交a欧美精品| 深夜福利日韩在线看| 久久久精品电影| 亚洲精品综合精品自拍| 91精品久久久久久久久久久久久久| 日韩中文在线中文网在线观看| 亚洲成人教育av| 777国产偷窥盗摄精品视频| 亚洲国产欧美日韩精品| 青青草原成人在线视频| 亚洲精品中文字幕av| 欧美在线观看网站| 国产精品免费视频xxxx| 国产精品美女免费视频| 美女国内精品自产拍在线播放| 亚洲人成77777在线观看网| 孩xxxx性bbbb欧美| 欧美福利视频在线观看| 中文字幕在线精品| 欧美日韩亚洲系列| 日韩在线中文视频| 国产91精品久久久久久| 精品av在线播放| 国产美女搞久久| 亚洲精品少妇网址| 精品国产91乱高清在线观看| 亚洲天堂网在线观看| 国产成人精品视频在线| 久久艳片www.17c.com| 国产在线999| 久久国产精品亚洲| 最近2019年手机中文字幕| 日韩精品久久久久久久玫瑰园| 国内自拍欧美激情| 精品精品国产国产自在线| 91影院在线免费观看视频| 国产精品成人av在线| 欧美性猛交xxxx富婆弯腰| 国产一区二区日韩精品欧美精品| 日本中文字幕久久看| 日韩欧美亚洲成人| 精品国产一区二区三区在线观看| 欧美片一区二区三区| 亚洲精品一区二区网址| 欧美一级视频在线观看| 亚洲欧美日韩在线一区| 国产成+人+综合+亚洲欧洲| 国产精品免费观看在线| 欧美成人激情图片网| 国产精品视频久久久| 欧美日韩第一页| 精品中文字幕久久久久久| 欧美性猛交xxxx黑人猛交| 欧美一级免费视频| 社区色欧美激情 | 久久成人在线视频| 最新中文字幕亚洲| 欧美精品videofree1080p| 91视频88av| 国产成人a亚洲精品| 亚洲成av人片在线观看香蕉| 欧美整片在线观看| 姬川优奈aav一区二区| 日韩av在线不卡| 日韩av手机在线| 中文字幕免费国产精品| 亚洲福利小视频| 国产精品视频永久免费播放| 欧美精品一区二区免费| 日韩天堂在线视频| 欧美性色视频在线| 国产精品嫩草视频| 国产999精品久久久影片官网| 91人人爽人人爽人人精88v| 久久久99久久精品女同性| 在线亚洲男人天堂| 蜜臀久久99精品久久久久久宅男| 成人国产亚洲精品a区天堂华泰| 亚洲精品二三区| 一区二区成人精品| 伊人久久精品视频| 亚洲欧美在线磁力| 国内外成人免费激情在线视频| 色妞欧美日韩在线| 97久久国产精品| 2019中文字幕免费视频| 国产最新精品视频| 91精品久久久久久久久久| 国内偷自视频区视频综合| 欧美老女人在线视频|