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 ...
随机推荐
- UI自动化之异常与截图处理
对操作不成功时,希望能够继续执行其他操作,或者是,希望操作不成功时,能够写日志记录 目录 1.常见异常 2.截图处理 1.常见异常 1.NoSuchElementException:没有找到元素 2. ...
- 不起眼的vim.转自https://blog.csdn.net/iplayvs2008/article/details/51508599
如果我的关于这个话题的最新帖子没有提醒到你的话,那我明确地说,我是一个 Vim 的粉丝.所以在你们中的某些人向我扔石头之前,我先向你们展示一系列“鲜为人知的 Vim 命令”.我的意思是,一些你可能以前 ...
- MVC Html.AntiForgeryToken(); 防止跨站伪造请求(建议所有表单提交都加这个)
视图页面from表单中添加 @Html.AntiForgeryToken(); 然后每个表单提交的时候都会带__RequestVerificationToken 字段 后端控制器验证时添加 [Val ...
- js提交图片转换为base64
$("#picAjax").change(function () { var strs = ""; var file = $("#picAjax&qu ...
- 【洛谷p1970】花匠
莫得致敬lz谢谢.lz的题解是优秀的题解谢谢! 看算法标签 但是我并不会DP的思路,用一个很神奇的码量超级少的代码(虽然我码了超多),然后其实这个数据可以看做是一个函数嘛对吧:(比如说样例) 那么要注 ...
- Windows注册表内容详解
Windows注册表内容详解 http://blog.sina.com.cn/s/blog_4d41e2690100q33v.html (2011-04-05 10:46:17) 第一课 注册表 ...
- HDU 4549题解 & luogu【模板】矩阵加速(数列)
M斐波那契数列 此题对数学基础要求较高 来源矩阵乘法_百度百科 一个m*n的矩阵是一个由m行n列元素排成的矩形阵列.矩阵里的元素可以是数字符号或者数学式. 形如[acbd][abcd]的数表称为二阶矩 ...
- 进程通信(multiprocessing.Queue)
from multiprocessing import Queue Queue([maxsize]) 创建共享的进程队列.maxsize是队列中允许的最大项数.如果省略此参数,则无大小限制.底层队列使 ...
- CSS3进度条动画
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- C#中的==和Equals的区别
一,值类型中的比较,对于值类型,如果对象的值相等,则相等运算符 (==) 返回 true,否则返回 false. ; ; bool bi1 = ai.Equals(bi); //true bool b ...