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