zoukankan      html  css  js  c++  java
  • BZOJ1228 [SDOI2009]E&D

    蒟蒻不会= =

    话说写题解的巨巨也只会打表233

    反正先A掉再说

     1 /**************************************************************
     2     Problem: 1228
     3     User: rausen
     4     Language: C++
     5     Result: Accepted
     6     Time:184 ms
     7     Memory:804 kb
     8 ****************************************************************/
     9  
    10 #include <cstdio>
    11  
    12 using namespace std;
    13  
    14 int n, SG;
    15  
    16 inline int read() {
    17     int x = 0;
    18     char ch = getchar();
    19     while (ch < '0' || '9' < ch)
    20         ch = getchar();
    21     while ('0' <= ch && ch <= '9') {
    22         x = x * 10 + ch - '0';
    23         ch = getchar();
    24     }
    25     return x;
    26 }
    27  
    28 inline int work(int x, int y) {
    29     int t = 1 << 30, i, res = 31;
    30     for (i = 30; i; --i, t >>= 1)
    31         if (x <= t && y <= t) res = i;
    32         else {
    33             x -= x > t ? t : 0;
    34             y -= y > t ? t : 0;
    35         }
    36     return x == 1 && y == 1 ? 0 : res;
    37 }
    38  
    39 int main() {
    40     int T = read(), i, x, y;
    41     while (T--) {
    42         n = read(), SG = 0;
    43         for (i = 1, n >>= 1; i <= n; ++i) {
    44             x = read(), y = read();
    45             SG ^= work(x, y);
    46         }
    47         if (SG) puts("YES");
    48         else puts("NO");
    49     }
    50     return 0;
    51 }
    View Code
    By Xs酱~ 转载请说明 博客地址:http://www.cnblogs.com/rausen
  • 相关阅读:
    iis日志时间与本地日期不一样
    iis原理介绍
    IIS如何确定请求的处理程序
    handle 和module
    调试IIS服务器
    JS面向对象学习
    图片垂直居中大杂烩
    淘宝双十一页面(Flexible)
    用rem适配移动端
    About getByClass
  • 原文地址:https://www.cnblogs.com/rausen/p/4106403.html
Copyright © 2011-2022 走看看