uva 1587 - Box
来源:互联网 发布:淘宝店铺名称怎么修改 编辑:程序博客网 时间:2024/05/02 01:07
判断6个面能否组成立方体
#include <cstdio>#include <cstdlib>#include <iostream>#include <iostream>#include <cstdio>#include <vector>#include <cstring>#include <cctype>#include <algorithm>#include <cmath>#include <cstdlib>#include <queue>#include <map>#define maxn 100000 + 10#define INF 0x7fffffffusing namespace std;struct NODE{ int h, w; bool operator < (const NODE& rha) const{ if(h == rha.h) return w < rha.w; return h < rha.h; }}a[10];bool ok(){ if(a[0].h != a[1].h || a[0].w != a[1].w) return false; if(a[2].h != a[3].h || a[2].w != a[3].w) return false; if(a[4].h != a[5].h || a[4].w != a[5].w) return false; if(a[1].h != a[2].h) return false; if(a[1].w != a[4].h) return false; if(a[3].w != a[4].w) return false; return true;}int main(){ while(scanf("%d%d", &a[0].h, &a[0].w) != EOF) { if(a[0].h > a[0].w) swap(a[0].h, a[0].w); for(int i = 1; i < 6; ++i) { scanf("%d%d", &a[i].h, &a[i].w); if(a[i].h > a[i].w) swap(a[i].h, a[i].w); } sort(a, a+6); if(ok()) puts("POSSIBLE"); else puts("IMPOSSIBLE"); } return 0;}
0 0
- uva 1587 - Box
- uva 1587 - Box
- UVa 1587 - Box
- UVa 1587 - Box
- UVa 1587 Box
- Uva-1587-Box-AC
- UVA - 1587 Box
- UVa 1587 Box
- Box UVa 1587
- UVA - 1587 Box 麻烦
- UVa 1587 - Box
- UVa 1587 - Box
- UVa-1587 - Box
- UVa 1587 Box
- Uva - 1587 - Box
- UVA - 1587 Box
- UVA 1587 BOX
- UVa 1587 BOX
- ubuntu启用和锁定root账户
- 定义两个整型指针,分别用malloc、calloc对其分配空间保存3个元素,malloc分配的空间用memset清零,随机对数组进行赋值随机范围1-3,赋值后用memcmp比较两个数组。如果相同打印G
- JAVA序列化和反序列化
- HDU 2594 Simpsons’ Hidden Talents (字符串-KMP)
- 树莓派实战实例(六)安装无线网卡TP-WN322G+
- uva 1587 - Box
- 鸟哥的Linux私房菜03_Linux的文件权限与目录配置
- HDU3663--Power Stations(Dancing Links)
- java 日期工具类
- 10种AD采样的软件滤波方法
- UBIFS文件系统搭建与配置(Micro2440 + linux 2.6.39)
- nginx相关命令
- 字典树详解(转载)
- 鸟哥的Linux私房菜04_Linux文件与目录管理