标签:style blog color io ar for 2014 div sp
/******************************************************************** @file Main_practise.cpp @date 2014-9-17 @author Tiger @brief Revenge of Nim @details 博弈 谁拿到第一个大于1的堆谁获胜 ********************************************************************/ #include <cstdio> int main(int argc, const char* argv[]) { int nTestCases = 0; scanf("%d", &nTestCases); while (nTestCases--) { int nNumbers = 0; scanf("%d", &nNumbers); int* pArr = new int[nNumbers]; for (int i=0; i<nNumbers; ++i) { scanf("%d", &pArr[i]); } int nCnt = 0; for (int i=0; i<nNumbers-1; ++i) { if (1 == pArr[i]) { ++nCnt; } else { break; } } delete [] pArr; (nCnt & 1) == 1 ? printf("No\n") : printf("Yes\n"); } return 0; }
标签:style blog color io ar for 2014 div sp
原文地址:http://www.cnblogs.com/roronoa-zoro-zrh/p/3977765.html