"HDU" 1850 Being a good boy in Spring Festival

Source: Internet
Author: User

http://acm.hdu.edu.cn/showproblem.php?pid=1850

Test instructions: With Nim ... By the way the number of programs ...

#include <cstdio> #include <cstring>using namespace Std;int a[105];int main () {int n;while (scanf ("%d", & n) {int ans=0, T, as=0;for (int i=0; i<n; ++i) {scanf ("%d", &a[i]); ans^=a[i];} for (int i=0; i<n; ++i) {t=ans^a[i];if (t<a[i]) ++as;} printf ("%d\n", as);} return 0;}

  

Because every time I take a bunch of ... By the nature of the SG and the nature of the game theory ... The whole situation of the SG and XOR current heap after the SG, only need to know to get the situation of SG and can be from the current heap of I cards into the game and for 0, that is, the winning state transferred to the required state, that is, sg=0.

It seems to be the speed of the CF hand = =

"HDU" 1850 Being a good boy in Spring Festival

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.