1729 is the natural number following 1728 and preceding 1730. It is also known as the Hardy-Ramanujan number after a famous anecdote of the British mathematician G. H. Hardy regarding a hospital visit to the Indian mathematician Srinivasa Ramanujan.…
1729 Time Limit: 3 Seconds Memory Limit: 65536 KB 1729 is the natural number following 1728 and preceding 1730. It is also known as the Hardy-Ramanujan number after a famous anecdote of the British mathematician G. H. Hardy regarding a hospital…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1729 看了题目感觉像Nim,但是有范围限制,有点不知道SG函数该怎么写 看了题解,最后才明白该怎么去理解 . 首先进行对s和c进行分类, 1.c = 0 的时候,无论怎样都填不满,直接跳过: 2.c = s 的时候,先手必败,即是P态: 3.c < s 的时候,可以分为两种情况: 1)c^2 + c < s 的时候,递归 2)c^2 + c > s 的时候,先手必胜,即N态 int mex(…