码迷,mamicode.com
首页 > 其他好文 > 详细

p2148 [SDOI2009]E&D

时间:2019-02-09 17:51:25      阅读:302      评论:0      收藏:0      [点我收藏+]

标签:div   can   ret   ace   color   size   include   flash   --   

传送门

分析

https://www.luogu.org/blog/flashblog/solution-p2148

代码

#include<bits/stdc++.h>
using namespace std;
int main(){
    int t,n,i,x,y,Ans,cnt;
    scanf("%d",&t);
    while(t--){
      scanf("%d",&n);
      n/=2;
      Ans=0;
      for(i=1;i<=n;i++){
          scanf("%d%d",&x,&y);
          cnt=0;
          x=(x-1)|(y-1);
          while(x&1)cnt++,x>>=1;
          Ans^=cnt;
      }
      if(Ans)puts("YES");
        else puts("NO");
    } 
    return 0;
}

p2148 [SDOI2009]E&D

标签:div   can   ret   ace   color   size   include   flash   --   

原文地址:https://www.cnblogs.com/yzxverygood/p/10357673.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!