2015北京邀请赛 UVALive7267 Mysterious Antiques in Sackler Museum
来源:互联网 发布:淘宝迅雷0.1没了 编辑:程序博客网 时间:2024/05/29 17:20
呀,再次展示了英文不好的问题。我一直以为是选三个,问是否可以刚好完美塞进第四个矩形里面。因为我看到了这一句Maybe the one who could pick exactly three pieces of those bones to form a larger rectangle was considered smart at that time。
但是题意是,选出三个,看看是否可以凑成一个新的矩形。
然后就删了删,改了改,就好了,完全用暴力去模拟。
代码如下:
#include<bits/stdc++.h>using namespace std;struct node{int cnt[2];}a[5];bool Check(node x, node y, node z){for(int i = 0; i < 2; i++)for(int j = 0; j < 2; j++)for(int k = 0; k < 2; k++)if(x.cnt[i^1] == y.cnt[j^1] && x.cnt[i] + y.cnt[j] == z.cnt[k])return 1;else if(x.cnt[i] == y.cnt[j] && y.cnt[j] == z.cnt[k])return 1;return 0; }int main(){bool flag;int T;cin >> T;while(T--){flag = 0;for(int i = 0; i < 4; i++)scanf("%d%d", &a[i].cnt[0], &a[i].cnt[1]);for(int i = 0; i < 4; i++)for(int j = 0; j < 4; j++)for(int k = 0; k < 4; k++){if(i == j || j == k || i == k)continue;if(Check(a[i], a[j], a[k]))flag = 1;}if(flag)cout << "Yes" << endl;elsecout << "No" << endl;}return 0;}
0 0
- 2015北京邀请赛 UVALive7267 Mysterious Antiques in Sackler Museum
- ACM-ICPC北京赛区2015 G Mysterious Antiques in Sackler Museum hihoCoder 1255
- hihocoder 1255 Mysterious Antiques in Sackler Museum
- hihoCoder 1255 Mysterious Antiques in Sackler Museum(水)
- UVALive 7267 Mysterious Antiques in Sackler Museum(dfs)
- UVALive 7267Mysterious Antiques in Sackler Museum (判断长方形)
- UVA7267 Mysterious Antiques in Sackler Museum (强行模拟)
- 【hihocoder1255 2015北京赛区G】【简单模拟 简化写法超棒哦】 Mysterious Antiques in Sackler Museum 四个矩形选三个 恰好拼成大矩形
- UVALive 7267 Mysterious Antiques in Sackler Museum 思维题 拼接矩形
- 北京邀请赛
- 2015北京邀请赛 UVALive7270 Osu! Master
- In the national museum
- 2014 北京邀请赛 B
- 2014 北京、西安邀请赛
- ACM-ICPC2014北京邀请赛感受
- 2014北京邀请赛 Happy Reversal
- 2014北京邀请赛(部分题解)
- 北京邀请赛 H. Happy Reversal
- iOS定义字符串常量
- 欢迎使用CSDN-markdown编辑器
- 微信公众号开发中进入的第一个页面,点击浏览器的返回,返回到公众号聊天窗口
- mysql中的索引(聚簇索引和非聚簇索引)
- 百度地图API-自定义图标覆盖物
- 2015北京邀请赛 UVALive7267 Mysterious Antiques in Sackler Museum
- 算法导论 练习题 13.1-6
- vi中如何在多行行首或行尾插入删除指定字符串
- MongoDB 关系、引用、覆盖索引查询
- [乐意黎原创]]CuteFTP 操作文件时,中文文件名显示乱码的解决
- Domino – JnpServer集成【一】-- 研究
- [译] 计算图上的微积分:Backpropagation
- Volley 的线程能力调查
- Linux学习之十二bash脚本之变量、变量类型