日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

洛谷 P2084 进制转换

發布時間:2023/12/20 编程问答 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 洛谷 P2084 进制转换 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

P4122 [USACO17DEC]Blocked Billboard

題目描述

During long milking sessions, Bessie the cow likes to stare out the window of her barn at two huge rectangular billboards across the street advertising "Farmer Alex's Amazingly Appetizing Alfalfa" and "Farmer Greg's Great Grain". Pictures of these two cow feed products on the billboards look much tastier to Bessie than the grass from her farm.

One day, as Bessie is staring out the window, she is alarmed to see a huge rectangular truck parking across the street. The side of the truck has an advertisement for "Farmer Smith's Superb Steaks", which Bessie doesn't quite understand, but she is mostly concerned about the truck potentially blocking the view of her two favorite billboards.

Given the locations of the two billboards and the location of the truck, please calculate the total combined area of both billboards that is still visible. It is possible that the truck obscures neither, both, or only one of the billboards.

在平面直角坐標系中,有兩個矩形(保證不相交),然后給出第三個矩形,求這兩個矩形沒有被第三個矩形遮住的部分的面積。

輸入輸出格式

輸入格式:

?

The first line of input contains four space-separated integers: x1 y1 x2 y2, where (x1,y1) and (x2,y2) are the coordinates of the lower-left and upper-right corners of the first billboard in Bessie's 2D field of view. The next line contains four more integers, similarly specifying the lower-left and upper-right corners of the second billboard. The third and final line of input contains four integers specifying the lower-left and upper-right corners of the truck. All coordinates are in the range -1000 to +1000. The two billboards are guaranteed not to have any positive area of overlap between themselves.

題目給出三個坐標,分別表示三個矩形的左下、右上坐標

?

輸出格式:

?

Please output the total combined area of both billboards that remains visible.

?

輸入輸出樣例

輸入樣例#1:?復制 1 2 3 5 6 0 10 4 2 1 8 3 輸出樣例#1:?復制 17

說明

Here, 5 units of area from the first billboard and 12 units of area from the second billboard remain visible.

Problem credits: Brian Dean

思路:模擬即可。

#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; struct nond{ int x1,y1,x2,y2; }; int area(nond r){return (r.x2-r.x1)*(r.y2-r.y1); } int intersect_area(nond p,nond q){int x_overlap=max(0,min(p.x2,q.x2)-max(p.x1,q.x1));int y_overlap=max(0,min(p.y2,q.y2)-max(p.y1,q.y1));return x_overlap*y_overlap; } int main(){nond a,b,t;cin>>a.x1>>a.y1>>a.x2>>a.y2;cin>>b.x1>>b.y1>>b.x2>>b.y2;cin>>t.x1>>t.y1>>t.x2>>t.y2;cout<<area(a)+area(b)-intersect_area(a,t)-intersect_area(b,t); }

?

轉載于:https://www.cnblogs.com/cangT-Tlan/p/8831679.html

總結

以上是生活随笔為你收集整理的洛谷 P2084 进制转换的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 操极品女神 | 亚洲射吧| 97人人爽人人爽人人爽 | 葵司有码中文字幕二三区 | 欧美一级片在线播放 | 成人免费毛片色戒 | 免看一级片 | 91精品人妻互换一区二区 | 自拍偷拍国内 | 亚洲av成人片色在线观看高潮 | 精品一区二区久久久久蜜桃 | 深夜福利国产精品 | 聚色屋| 亚洲美女视频 | 国产夫妻露脸 | 国产在线精品福利 | 欧美激情va永久在线播放 | 亚洲欧美日韩国产综合 | 福利视频第一页 | 亚洲AV无码一区二区伊人久久 | 伊人久久中文字幕 | 日韩激情电影在线 | 蜜臀av夜夜澡人人爽人人 | 国产又好看的毛片 | 狼人精品一区二区三区在线 | 日本精品一区二区三区四区的功能 | 色噜噜日韩精品欧美一区二区 | 亚洲三级成人 | 奇米色婷婷 | 粉嫩av| 911色| 9999av| 久久超| 在线视频观看 | 91嫩草网| 91成人国产综合久久精品 | 亚洲乱码视频在线观看 | av美女在线| 99热这里只有精品首页 | 日韩精品一区二区三区视频 | 国产第八页 | 日韩黄片一区二区三区 | 人人干人 | 国产视频三区 | 国模丫头1000人体 | 美国黄色一级大片 | 日本一区二区视频在线播放 | 精品999www| 人妻少妇偷人精品视频 | 2018国产精品 | 精品国产人妻一区二区三区 | 欧美人与物videos另类 | 就去色综合 | 精品一二三 | 国产一区二区精品 | 91精品国产自产精品男人的天堂 | 黑人操日本女人视频 | 亚洲a∨无码无在线观看 | 无限资源日本好片 | www.天堂av.com | 欧美精品成人一区二区三区四区 | 色综合久久88色综合天天6 | 久久久久麻豆v国产精华液好用吗 | 亚欧视频在线观看 | 我爱52av | 在线观看一区 | 国产精品-色哟哟 | 国产黄a三级三级三级 | 免费黄色三级 | 欧美成人免费播放 | 天天摸天天添 | 超碰在线国产 | 日韩精品免费电影 | 精品久久久网站 | 尤物影院在线观看 | 欧美岛国国产 | 亚洲一区二区三区激情 | 熟妇高潮一区二区 | 国产在线网站 | 成年人网站av | 亚洲av日韩精品久久久久久久 | 偷拍老头老太高潮抽搐 | 情欲超| 一本色道久久综合无码人妻 | 欧美深夜福利 | 日韩av男人天堂 | 欧美一区二区三区系列电影 | 在线观看免费视频一区 | 亚洲图片在线视频 | 中出一区二区 | 波多野结衣视频一区二区 | 午夜免费播放观看在线视频 | 姑娘第5集高清在线观看 | 国产精品--色哟哟 | 亚洲福利影院 | 亚洲永久精品视频 | 啪啪网免费 | 四季av一区二区凹凸精品 | free性丰满69性欧美 |