POJ 2160 Box G++
来源:互联网 发布:如何下载plc编程软件 编辑:程序博客网 时间:2024/06/01 07:13
#include <iostream>using namespace std;//谢谢博友翻译 int main(){int x[6],y[6];for(int i=0;i<6;i++){int a,b;cin>>a>>b;if(a>b){int t;t=a;a=b;b=t;}x[i]=a;y[i]=b;}for(int i=0;i<6;i++)//排序 {for(int j=i+1;j<6;j++){if(x[i]>x[j]){int t1,t2;t1=x[i];t2=y[i];x[i]=x[j];y[i]=y[j];x[j]=t1;y[j]=t2;}else if((x[i]==x[j])&&(y[i]>y[j])){int t1,t2;t1=x[i];t2=y[i];x[i]=x[j];y[i]=y[j];x[j]=t1;y[j]=t2;}}} int m[3],n[3];int js=0;for(int i=0;i<6;)//提取3个不同的板子 {if((x[i]==x[i+1])&&(y[i]==y[i+1])){m[js]=x[i];n[js]=y[i];js++;}i++;i++;}int jg=0;int a=0,b=0;if(js==3){if((m[0]==m[1])||(n[0]==m[1])){jg++;a=n[1]; }else if((m[0]==n[1])||(n[0]==n[1])){jg++;a=m[1];}if((m[0]==m[2])||(n[0]==m[2])){jg++;b=n[2];}else if((m[0]==n[2])||(n[0]==n[2])){jg++;b=m[2];}if(a==b){jg++;}}if(jg==3){cout<<"POSSIBLE";}else{cout<<"IMPOSSIBLE";}return 0;}
0 0
- POJ 2160 Box G++
- POJ 1477 Box of Bricks G++
- poj 2160 Box 模拟
- poj-2160 BOX
- POJ 2160 BOX
- poj 2504 Bounding box
- poj 1442 Black Box
- poj 2977 Box walking
- POJ 1442 Black Box
- poj--1442--black box
- POJ 1442 Black Box
- POJ 1442 Black Box
- POJ 1442 Black Box
- POJ 1442 Black Box
- poj 1442 Black Box
- POJ 1442 Black Box
- POJ 1442 Black Box
- POJ 1442 Black Box
- timer 公司内部用法
- 第七章:函数表达式(模仿块级作用域和私有变量)
- [Codeforces452E]Three strings(后缀自动机)
- HDU 2923 Einbahnstrasse(两种方法)
- Bootstrap焦点轮播图
- POJ 2160 Box G++
- 【.NET MVC分页】.NET MVC 使用pagelist 分页
- DI v6.2,用户的DI数据库做了迁移,相关配置已修改,但是启动作业的时候报如下图中错误并执行失败,而服务器配置中并没有server1的调度服务器配置,这个该如何解决?
- Bootstrap后台导航
- 后台侧边功能栏
- java实现九九乘法表的打印
- Unix网络编程二:传输层:TCP、UDP、SCTP
- Bootstrap后台主区域
- CF容器安全