南昌邀请赛 暴力模拟
#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的更多相关文章

  1. HDU 5754 Life Winner Bo 组合博弈

    Life Winner Bo Problem Description   Bo is a "Life Winner".He likes playing chessboard gam ...

  2. HDU 2509 Be the Winner nim博弈变形

    Be the Winner Problem Description   Let's consider m apples divided into n groups. Each group contai ...

  3. HDU5754 Life Winner Bo(博弈)

    题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=5754 Description Bo is a "Life Winner" ...

  4. Codeforces Beta Round #2 A. Winner

    A. Winner time limit per test 1 second memory limit per test 64 megabytes input standard input outpu ...

  5. HDU2509 Be the Winner

    Be the Winner Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

  6. 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 ...

  7. winner tree 胜者树

    在树形选择排序中,利用锦标赛思想建立的树称为胜者树. 1.每个非终端节点存储的是左右孩子节点中的优胜者. 2.通过减少比较次数,提高效率. 3.胜者树就是一颗特殊的线段树. 一.构建树 Procedu ...

  8. cf------(round 2)A. Winner

    A. Winner time limit per test 1 second memory limit per test 64 megabytes input standard input outpu ...

  9. CrowdFlower Winner's Interview: 1st place, Chenglong Chen

    CrowdFlower Winner's Interview: 1st place, Chenglong Chen The Crowdflower Search Results Relevance c ...

  10. HDU 5754 Life Winner Bo (博弈)

    Life Winner Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5754 Description Bo is a "Life W ...

随机推荐

  1. [转载]借助openssl解析ECC公钥

    void GetPubKey(const char* FilePath, char* PubKey) { unsigned ]; unsigned char *pTmp = NULL; FILE *f ...

  2. package__init__用途

    baidu包,假设在baidu包下有N个模块,分别是baidu1.py.baidu2.py,baidu3.py, baiduHq.py(baidu1.py,baidu2.py,baidu3.py模块代 ...

  3. C++笔记(6)——关于OJ的单点测试和多点测试

    单点测试 PAT使用的就是单点测试(LeetCode应该也是单点测试).单点测试中系统会判断每组数据的输出结果是否正确,正确则通过测试并获得这则测试的分值.题目的总得分等于通过的数据的分值之和. 代码 ...

  4. vue组件通信之父子组件通信

    准备工作: 首先,新建一个项目,如果这里有不会的同学,可以参考我转载过的文章 http://www.cnblogs.com/Sky-Ice/p/8875958.html  vue 脚手架安装及新建项目 ...

  5. Java日志使用slf4j 配置log4j后,有日志文件 但日志文件内容为空

    SLF4J的全称是Simple Logging Facade for Java,即简单日志门面. SLF4J并不是具体的日志框架,而是作为一个简单门面服务于各类日志框架,如java.util.logg ...

  6. [Python3] 012 元组:list,我们不一样!

    目录 0. 元组的独白 1. 元组的创建 2. 元组的特性 (1) 概述 (2) 少废话,上例子 1) 索引 2) 分片 3) 序列运算 4) 成员检测 3. 元组的遍历 (1) 简单总结 (2) 少 ...

  7. [19/05/08-星期三] JDBC(Java DataBase Connectivity)_ORM(Object Relationship Mapping, 对象关系映射)

    一.概念 基本思想: – 表结构跟类对应: 表中字段和类的属性对应:表中记录和对象对应: – 让javabean的属性名和类型尽量和数据库保持一致! – 一条记录对应一个对象.将这些查询到的对象放到容 ...

  8. stl(set或map)

    https://nanti.jisuanke.com/t/41384 There are nnn points in an array with index from 111 to nnn, and ...

  9. RMQ 的入门 hdu1806

    RMQ(Range Minimum/Maximum Query),即区间最值查询,是指这样一个问题:对于长度为n的数列A,回答若干次询问RMQ(i,j),返回数列A中下标在区间[i,j]中的最小/大值 ...

  10. 构造函数与new的汇编实现

    this指针,通常是通过ecx传递:gcc是通过堆栈传递的,是最后一个被压栈.传递this指针是为了访问成员变量.除了虚函数,所有成员函数被编译之后都是全局函数.mov eax,[ecx] ; 将第一 ...