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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

【打CF,学算法——二星级】Codeforces Round #313 (Div. 2) B. Gerald is into Art(水题)...

發布時間:2025/6/15 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【打CF,学算法——二星级】Codeforces Round #313 (Div. 2) B. Gerald is into Art(水题)... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

【CF簡單介紹】

提交鏈接:http://codeforces.com/contest/560/problem/B


題面:

B. Gerald is into Art time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

Gerald bought two very rare paintings at the Sotheby's auction and he now wants to hang them on the wall. For that he bought a special board to attach it to the wall and place the paintings on the board. The board has shape of ana1?×?b1 rectangle, the paintings have shape of aa2?×?b2 anda3?×?b3 rectangles.

Since the paintings are painted in the style of abstract art, it does not matter exactly how they will be rotated, but still, one side of both the board, and each of the paintings must be parallel to the floor. The paintings can touch each other and the edges of the board, but can not overlap or go beyond the edge of the board. Gerald asks whether it is possible to place the paintings on the board, or is the board he bought not large enough?

Input

The first line contains two space-separated numbers a1 andb1 — the sides of the board. Next two lines contain numbersa2,?b2,?a3 andb3 — the sides of the paintings. All numbersai,?bi in the input are integers and fit into the range from1 to 1000.

Output

If the paintings can be placed on the wall, print "YES" (without the quotes), and if they cannot, print "NO" (without the quotes).

Sample test(s) Input 3 2 1 3 2 1 Output YES Input 5 5 3 3 3 3 Output NO Input 4 2 2 3 1 2 Output YES Note

That's how we can place the pictures in the first test:

And that's how we can do it in the third one.

解題:

??? 就是看能不能把兩塊畫。放進板內,要求畫必須平行于板。


代碼:

#include <iostream> #include <algorithm> #include <cstdio> using namespace std; int main() {int l1,w1,l2,w2,l3,w3;scanf("%d%d",&l1,&w1);scanf("%d%d",&l2,&w2);scanf("%d%d",&l3,&w3);bool flag=false;if((l2+l3)<=l1&&(w2<=w1&&w3<=w1))flag=true;else if((l2+w3)<=l1&&(w2<=w1)&&(l3<=w1))flag=true;else if((w2+l3)<=l1&&(l2<=w1)&&(w3<=w1))flag=true;else if((w2+w3)<=l1&&(l2<=w1&&l3<=w1))flag=true;else if((w2+w3)<=w1&&(l2<=l1)&&(l3<=l1))flag=true;else if((w2+l3)<=w1&&(l2<=l1)&&(w3<=l1))flag=true;else if((l2+w3)<=w1&&(w2<=l1)&&(l3<=l1))flag=true;else if((l2+l3)<=w1&&(w2<=l1)&&(w3<=l1))flag=true;if(flag)printf("YES\n");else printf("NO\n");return 0; }


總結

以上是生活随笔為你收集整理的【打CF,学算法——二星级】Codeforces Round #313 (Div. 2) B. Gerald is into Art(水题)...的全部內容,希望文章能夠幫你解決所遇到的問題。

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

主站蜘蛛池模板: 亚洲成人高清在线观看 | 九九视频这里只有精品 | 欧洲精品久久 | 在线观看日本一区 | 韩国av网| 欧美极品视频在线观看 | 蜜桃9999| 国产熟妇搡bbbb搡bbbb搡 | 澳门免费av| 国产人妖在线 | 99黄色片| 日韩亚洲视频 | 亚洲精品国产91 | 国产无遮挡免费观看视频网站 | 91在线观看视频 | 18禁免费观看网站 | 国产美女在线观看 | 久久国产精品久久久久久 | 色老板精品凹凸在线视频观看 | 精品一区二区三区四 | 欧美日韩不卡合集视频 | 欧美日韩一本 | 国产视频综合 | 91高清免费| 好大好爽好舒服 | 一级aaaa毛片 | 天堂网av2014| 精品乱 | 岳睡了我中文字幕日本 | 午夜精品视频在线观看 | 3d动漫精品啪啪一区二区下载 | 精品无码国产av一区二区三区 | 久久乐av | 久久精彩视频 | 色射射| 日韩在线播放视频 | 日韩一级片免费看 | 国产一区二三区 | 日韩在线不卡av | 精品人妻一区二区三区日产乱码 | 伊人成人动漫 | 国产精品夫妻自拍 | 97精品熟女少妇一区二区三区 | 国产鲁鲁视频在线观看免费 | 国产3区 | 99色在线观看 | 热热色原网址 | 久久久久亚洲av成人网人人软件 | 天天躁日日摸久久久精品 | 黄色小说在线免费观看 | 国产成人99 | 日本一区二区视频在线播放 | 久草综合在线观看 | 麻豆一区二区三区四区 | 老司机午夜视频 | 91成人免费在线观看 | 日韩一区二区三区精 | 日韩精品免费视频 | 日韩a级一片 | 国产大奶在线观看 | av成人免费在线观看 | 麻豆精品免费观看 | 日韩有码在线视频 | 一区二区日韩视频 | 91热久久 | 舐め犯し波多野结衣在线观看 | 色婷婷久久一区二区三区麻豆 | 久久激情网 | 熟女少妇a性色生活片毛片 亚洲伊人成人网 | 五月婷婷激情综合网 | 国产超碰| 九九色综合网 | 亚洲无码乱码精品国产 | 午夜黄色在线观看 | 国产精品av久久久久久无 | 午夜久久剧场 | 久久久久久国产精品无码 | 国产欧美精品一区 | 污污视频在线观看网站 | 日韩国产亚洲欧美 | 中文字幕乱码一区 | 欧美hdse | 色臀av| 久久久96人妻无码精品 | 日日夜夜欧美 | 免费黄色视屏 | 日韩欧美精品国产 | 成人午夜视频免费观看 | 九九热精品视频在线播放 | 激情五月婷婷小说 | 欧美日韩在线视频 | 伊人狠狠| 一道本无吗一区 | 亚洲成av人在线观看 | 天天碰免费视频 | 国产理论视频在线观看 | 精品国产无码在线 | 欧美黄色免费在线观看 | 怡春院在线视频 |