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
  • 相关阅读:
    虚拟化资料
    Windows线程+进程通信
    Linux进程+进程间通信IPC
    COM/DOM/COM+
    C# 2.0新特性与C# 3.5新特性[转]
    [CruiseControl]配置文件config.xml
    C#的Delegate和Event
    [BuildRelease Management]Visual Build
    软件培训机构
    可以自动输入密码的Runas
  • 原文地址:https://www.cnblogs.com/rausen/p/4106403.html
Copyright © 2011-2022 走看看