南昌邀请赛 暴力模拟
#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. 【HANA系列】SAP HANA计算视图(calculation views)使用RANK报错

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP HANA计算视图(cal ...

  2. spring中@Autowired与 @Resource区别

    @Autowired 与@Resource的区别: 1. @Autowired与@Resource都可以用来装配bean. 都可以写在字段上,或写在setter方法上. 2. @Autowired默认 ...

  3. Far and away the best prize that life has given to us is the chance to work hard at work worth doing

    work at:侧重于某个工作场所,或者是工作领域内研究 work on:侧重于思想上的从事于某个工作. marvel:n.漫威.奇迹 means.n.方法 tailor.n.裁缝 brighten. ...

  4. 05.vue-resource的基本使用

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. Java学习day9面向对象编程2-方法的可变个数的参数和方法的参数传递

    一.方法的可变个数的参数. 问题:我们能够打印的信息都是来源于方法的参数,也就是形参的传递.那如何要给方法传递不同的参数? .1.采用数组形参来定义方法 public static void test ...

  6. Qt之UI文件设计和运行机制

    1.项目文件组成在QtCreator中新建一个WidgetApplocation项目,选中窗口基类中选中QWidget作为窗口基类,并选中"GnerateForm"复选框.创建后项 ...

  7. Leading and Trailing LightOJ - 1282 题解

    LightOJ - 1282 Leading and Trailing 题解 纵有疾风起 题目大意 题意:给你一个数n,让你求这个数的k次方的前三位和最后三位. \(2<=n<2^{31} ...

  8. 利用ssh-copy-id实现SSH无密码登录

    第一步: 在远程服务器产生公钥与私钥对: $ ssh-keygen -t rsa 按照提示输入完后,会在~/.ssh目录下生成id_rsa和id_rsa.pub这两个文件 第二步:用ssh-copy- ...

  9. EPROCESS ETHREAD PEB重要成员

    -----------------------------------------------------------------------win7 x86中-------------------- ...

  10. java 企业 网站源码 后台 springmvc SSM 前台 静态化 代码生成器

    前台: 支持四套模版, 可以在后台切换 系统介绍: 1.网站后台采用主流的 SSM 框架 jsp JSTL,网站后台采用freemaker静态化模版引擎生成html 2.因为是生成的html,所以访问 ...