Winner
#include<bits/stdc++.h>
using namespace std;
struct Nod
{
int i;
int a,b,c;
} A[];
bool f[];
int B[][];
bool cmp1(Nod a,Nod b)
{
return a.a<b.a;
}
bool cmp2(Nod a,Nod b)
{
return a.b<b.b;
}
bool cmp3(Nod a,Nod b)
{
return a.c<b.c;
}
int main()
{
int N,Q;
scanf("%d%d",&N,&Q);
int t;
for(int i=; i<=N-; i++)
{
scanf("%d",&t);
A[i].i=i+;
A[i].a=t;
}
for(int i=; i<=N-; i++)
{
scanf("%d",&t);
A[i].b=t;
}
for(int i=; i<=N-; i++)
{
scanf("%d",&t);
A[i].c=t;
}
bool g=;
sort(A,A+N,cmp1);
f[A[N-].i]=;
for(int i=; i<N; i++)
{
B[i][]=A[i].i;
}
sort(A,A+N,cmp2);
f[A[N-].i]=;
g=;
for(int i=; i<N; i++)
{
B[i][]=A[i].i;
if(f[A[i].i])
{
g=;
}
if(g&&f[A[i].i]==)
{
f[A[i].i]=;
}
}
sort(A,A+N,cmp3);
f[A[N-].i]=;
g=;
for(int i=; i<N; i++)
{
B[i][]=A[i].i;
if(f[A[i].i])
{
g=;
}
if(g&&f[A[i].i]==)
{
f[A[i].i]=;
}
}
while(true)
{
bool ch=;
g=;
for(int i=; i<N; i++)
{
if(f[B[i][]])
{
g=;
}
if(g&&f[B[i][]]==)
{
ch=;
f[B[i][]]=;
}
}
g=;
for(int i=; i<N; i++)
{
if(f[B[i][]])
{
g=;
}
if(g&&f[B[i][]]==)
{
ch=;
f[B[i][]]=;
}
}
g=;
for(int i=; i<N; i++)
{
if(f[B[i][]])
{
g=;
}
if(g&&f[B[i][]]==)
{
ch=;
f[B[i][]]=;
}
}
if(!ch)break;
}
while(Q--)
{
scanf("%d",&t);
if(f[t])
{
puts("YES");
}
else puts("NO");
}
}
Winner的更多相关文章
- HDU 5754 Life Winner Bo 组合博弈
Life Winner Bo Problem Description Bo is a "Life Winner".He likes playing chessboard gam ...
- HDU 2509 Be the Winner nim博弈变形
Be the Winner Problem Description Let's consider m apples divided into n groups. Each group contai ...
- HDU5754 Life Winner Bo(博弈)
题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=5754 Description Bo is a "Life Winner" ...
- Codeforces Beta Round #2 A. Winner
A. Winner time limit per test 1 second memory limit per test 64 megabytes input standard input outpu ...
- HDU2509 Be the Winner
Be the Winner Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- Recruit Coupon Purchase Winner's Interview: 2nd place, Halla Yang
Recruit Coupon Purchase Winner's Interview: 2nd place, Halla Yang Recruit Ponpare is Japan's leading ...
- winner tree 胜者树
在树形选择排序中,利用锦标赛思想建立的树称为胜者树. 1.每个非终端节点存储的是左右孩子节点中的优胜者. 2.通过减少比较次数,提高效率. 3.胜者树就是一颗特殊的线段树. 一.构建树 Procedu ...
- cf------(round 2)A. Winner
A. Winner time limit per test 1 second memory limit per test 64 megabytes input standard input outpu ...
- CrowdFlower Winner's Interview: 1st place, Chenglong Chen
CrowdFlower Winner's Interview: 1st place, Chenglong Chen The Crowdflower Search Results Relevance c ...
- HDU 5754 Life Winner Bo (博弈)
Life Winner Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5754 Description Bo is a "Life W ...
随机推荐
- docker进阶——数据管理与网络
一.数据卷管理 用户在使用 Docker 的过程中,势必需要查看容器内应用产生的数据,或者 需要将容器内数据进行备份,甚至多个容器之间进行数据共享,这必然会涉及 到容器的数据管理 (1)Data Vo ...
- Caffe参数交换源码分析
对境准备:对于多个GPU而言,一台机器2个GPU,参数交换的流程图: 参数交换从main()进入train()函数,在train函数中找到对应源码为: . . . . . ) { caffe::P2P ...
- github.com/oschwald/maxminddb-golang 安装报错
安装 maxminddb-golang错误: dill@ubuntu-vm:~/workspace/go/src/github.com$ go get github.com/oschwald/maxm ...
- 修改JAVA_HOME失效
在修改JDK的安装目录的情况下会出现失效的时候,因为jdk在安装的时候自己在path中添加了 C:\ProgramData\Oracle\Java\javapath 这个路径. 解决: 删除 path ...
- springboot An incompatible version [1.1.32] of the APR based Apache Tomcat Native library is installed, while Tomcat requires version [1.2.14]
1.错误 An incompatible version [1.1.32] of the APR based Apache Tomcat Native library is installed, wh ...
- GMS认证测试FQA
---摘要 本文档用于收录GMS认证测试的异常问题,提供一般性指导.对于本文档中未提供解答的问题请咨询@开发经理或@领域技术专家 cts测试工具如何获取? A:见Google官网 https://so ...
- mooc-IDEA 快速通过mapper定位到XML
intellij 快速通过mapper定位到XML 方法一:在线安装Mybatis插件 安装完毕,重启IDEA生效! =>Mapper文件效果 点击向下键头即可定位到XML文件中的具体SQL = ...
- Java相关面试题总结+答案(五)
[异常] 74. throw 和 throws 的区别? throw 是真实抛出一个异常: throws 是声明可能会抛出一个异常. 75. final.finally.finalize 有什么区别? ...
- C/C++ 引入头文件时 #include<***.h> 与 #include"***.h" 区别
两种情况区分: 1.#include <> 编译器只会去系统文件目录中查找,找不到就报错. 2.#include " " 编译器会先在用户目录中查找,再到编译器设定的 ...
- this,static,执行程序的顺序等等留意点
self.static 和 $this 的区别为了更好地理解 self.static 和 $this 的区别,先来看一个示例. <?phpclass A { protected $name = ...