[PA2014]Lustra
[PA2014]Lustra
题目大意:
有n个工厂参加竞标。每个工厂能生产长度在\([a_i,b_i]\)之间,宽度在\([c_i,d_i]\)之间的镜子,镜子不可以旋转。
问是否有某个工厂能生产出其它所有工厂能生产的镜子。
思路:
查询是否有某个工厂,\(a_i,c_i\)最小,\(b_i,d_i\)最大即可。
源代码:
#include<cstdio>
#include<cctype>
#include<algorithm>
inline int getint() {
register char ch;
while(!isdigit(ch=getchar()));
register int x=ch^'0';
while(isdigit(ch=getchar())) x=(((x<<2)+x)<<1)+(ch^'0');
return x;
}
const int N=1e5;
int a[N],b[N],c[N],d[N];
int main() {
for(register int T=getint();T;T--) {
const int n=getint();
for(register int i=0;i<n;i++) {
a[i]=getint();
b[i]=getint();
c[i]=getint();
d[i]=getint();
}
const int mina=*std::min_element(&a[0],&a[n]);
const int maxb=*std::max_element(&b[0],&b[n]);
const int minc=*std::min_element(&c[0],&c[n]);
const int maxd=*std::max_element(&d[0],&d[n]);
for(register int i=0;i<n;i++) {
bool flag=true;
flag&=a[i]==mina;
flag&=b[i]==maxb;
flag&=c[i]==minc;
flag&=d[i]==maxd;
if(flag) {
puts("TAK");
goto Next;
}
}
puts("NIE");
Next:;
}
return 0;
}
[PA2014]Lustra的更多相关文章
- BZOJ3715: [PA2014]Lustra
3715: [PA2014]Lustra Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 237 Solved: 149[Submit][Status ...
- bzoj3715: [PA2014]Lustra(乱搞)
3715: [PA2014]Lustra 题目:传送门 题解: 随手一发水题x1 随便排序一下...小学生题??? 代码: #include<cstdio> #include<cst ...
- BZOJ 3715: [PA2014]Lustra
Description Byteasar公司专门外包生产带有镜子的衣柜.刚刚举行的招标会上,有n个工厂参加竞标.所有镜子都是长方形的,每个工厂能够制造的镜子都有其各自的最大.最小宽度和最大.最小高度. ...
- 【set】bzoj3715 [PA2014]Lustra
对每种属性开一个set,只要某个厂家符合该属性的最值,就加进set,最后判断是否有某个厂家在4个set里都存在即可. #include<cstdio> #include<set> ...
- bzoj AC倒序
Search GO 说明:输入题号直接进入相应题目,如需搜索含数字的题目,请在关键词前加单引号 Problem ID Title Source AC Submit Y 1000 A+B Problem ...
- BZOJ 3721: PA2014 Final Bazarek
3721: PA2014 Final Bazarek Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 645 Solved: 261[Submit][ ...
- BZOJ 3709: [PA2014]Bohater
3709: [PA2014]Bohater Time Limit: 5 Sec Memory Limit: 128 MBSec Special JudgeSubmit: 1050 Solved: ...
- [PA2014] [BZOJ 3709]~[BZOJ 3719] 合集
今天起尝试做套题喵~ (当然是因为被最大流的题目弄得恶心死了) 一共是 10 道题一道一道做 预计 3~4 内做完 尽情期待 [BZOJ 3709]Bohater 一眼就能感受到贪心的气息 因为很直观 ...
- bzoj3714: [PA2014]Kuglarz
[PA2014]KuglarzTime Limit: 20 Sec Memory Limit: 128 MBSubmit: 553 Solved: 317[Submit][Status][Discus ...
随机推荐
- NodeJs——router报错原因
rout.js var http = require('http'); var url = require('url'); var router = require('./models/router. ...
- hbase启动后HMaster进程自动关闭
1.情况描述如题所示,hbase启动以后,HMaster进程启动了,几秒钟以后自动关闭,但是HRegionServer进程正常运行: 原因是,hdfs的默认端口号是8020,而我core-site.x ...
- Elasticsearch 备忘
Elasticsearch7.0版本在查询时需要增加 “track_total_hits”:true 来强制进行准确的计数,默认为 “track_total_hits”:10000, 而且返回的hit ...
- 关于浏览器对html, js,css的解析先后顺序的理解
1.首先要了解页面的结构(包含哪些元素?哪些计算机语言能够在页面中运行 ) (1)html 不仅可以包含文字,还可以包含图片.链接,甚至音乐.程序等非文字元素的标记语言 ...
- python安装plinter
我下的python2.7是有pip的,但是直接在cmd中输入pip是无响应的.要去环境变量中配置D:/python/Script 这样就可以了. pip install splinter就能下载了
- Visual Studio 中使用万能头文件 #include <bits/stdc++.h>
最近开始使用VS,之前用的DEV C++软件可直接使用 #include <bits/stdc++.h> ,但VS中并没有,为了使用方便,可直接在VS中添加此头文件,方法如下: 1.在安 ...
- [转]简单三步,用 Python 发邮件
https://zhuanlan.zhihu.com/p/24180606 0. 前言 发送电子邮件是个很常见的开发需求.比如你写了个监控天气的脚本,发现第二天要下雨,或者网站上关注的某个商品降价了, ...
- eclipse 编辑代码区字体大小
wiondow-->preferences-->general-->appearance-->colors and fonts-->java-->java edit ...
- postgresql 查询某一个表中的所有字段
select * from information_schema.columns where table_schema='public' and table_name='表名称 ';
- eclipse启动web应用
在建好web项目的基础上: (1)配置tomcat服务器 点击window---->Preference----->Server---->Runtime Environment--- ...