3715: [PA2014]Lustra

题目:传送门


题解:

   随手一发水题x1

   随便排序一下...小学生题???

  


代码:

 #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
using namespace std;
struct node
{
int w1,w2,h1,h2;
}a[];
int T,n;
bool cmp(node n1,node n2)
{
if(n1.w2!=n2.w2)return n1.w2<n2.w2;
if(n1.w1!=n2.w1)return n1.w1>n2.w1;
if(n1.h2!=n2.h2)return n1.h2<n2.h2;
if(n1.h1!=n2.h1)return n1.h1>n2.h1;
return false;
}
int main()
{
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
for(int i=;i<=n;i++)scanf("%d%d%d%d",&a[i].w1,&a[i].w2,&a[i].h1,&a[i].h2);
sort(a+,a+n+,cmp);int wo=a[n].w1,wt=a[n].w2,ho=a[n].h1,ht=a[n].h2;bool bk=true;
for(int i=;i<n;i++)if(wo>a[i].w1 || wt<a[i].w2 || ho>a[i].h1 || ht<a[i].h2){bk=false;break;}
if(bk==true)printf("TAK\n");
else printf("NIE\n");
}
return ;
}

最新文章

  1. 给大家推荐一款高大上的代码高亮插件(sublime,github风格)——highlight.js
  2. ACM 过河问题
  3. 译 - 第 1 章:EF入门
  4. ubuntu下git clone 出现Permission denied (publickey).
  5. linux安装禅道的步骤
  6. python request
  7. ASP.NET Core 实战:使用 ASP.NET Core Web API 和 Vue.js 搭建前后端分离项目
  8. Oracle 11g ogg单表初始化步骤
  9. TestNg 6.异常测试
  10. switch和if语句
  11. kettle杂记
  12. Visual Studio 2013百度云下载地址
  13. java多线程--实现Runnable接口方式
  14. 1150: [CTSC2007]数据备份Backup
  15. HTML头部声明文件类型
  16. DataSet转化为DataTable
  17. Entity Framework Tutorial Basics(9):Entity Relationships
  18. winfrom浏览器控件
  19. 彻底删除kafka下面的topic
  20. luogu 1325 雷达安装

热门文章

  1. BZOJ 2324 (有上下界的)费用流
  2. swi prolog 与c#
  3. [hihocoder][Offer收割]编程练习赛44
  4. Educational Codeforces Round 35
  5. CSS vs. JS Animation: 哪个更快
  6. Oracle数据库实例
  7. spring之pom.xml配置
  8. 第八周读书笔记(人月神话X月亮与六便士)——到底什么才是一个程序员的自我修养?
  9. nyoj___大数阶乘
  10. redis的跳跃表