您当前的位置: 首页 > 

对方正在debug

暂无认证

  • 5浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

HDU6560 The Hermit(思维)

对方正在debug 发布时间:2019-11-09 23:06:05 ,浏览量:5

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6560 参考题解:https://blog.csdn.net/timeclimber/article/details/96280798 一开始以为是数据结构题,在训练时卡其他题,就没做这道,看了题解后不得不惊叹,原来题目正解,本身可以这么简单,证明也很好理解。

#include 
using namespace std;
int main()
{
    int t,cas=1;scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        int ans=0;
        for(int i=1,x;i2&&x>2) ans^=(x-2);
        }
        printf("Case %d: %d\n",cas++,ans);
    }
    return 0;
}


关注
打赏
1664895754
查看更多评论
立即登录/注册

微信扫码登录

0.0369s